Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch overridden files automatically #450

Merged
merged 1 commit into from
Jun 30, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Jun 29, 2018

As @bridiver 's comment(#371 (comment)), touching automatically would be much better than by using options.

Touch overridden file automatically when it is older than file in chromium_src.

Issue #352
Close #434

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

Touch overridden file when it is older than file in chromium_src to
trigger rebuild.
@simonhong simonhong force-pushed the touch_overridden_files_automatically branch from c3fe88d to ca9a328 Compare June 29, 2018 12:49
@simonhong simonhong requested a review from darkdh June 29, 2018 22:59

if (fs.existsSync(overriddenFile)) {
// If overriddenFile is older than file in chromium_src, touch it to trigger rebuild.
if (fs.statSync(chromiumSrcFile).mtimeMs - fs.statSync(overriddenFile).mtimeMs > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this check? this might causes build fail after chromium upgrade even there is nothing conflicted (when chromium_src files don't need to modified after chromium upgrade).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we updated chromium then the overriden file will have an older timestamp, right? This only touches if the chromium_src file is newer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what we're trying to do is to ensure that ninja detects the changes to chromium_src because we do the substitution at compile time

Copy link
Member Author

@simonhong simonhong Jun 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, after rebasing on newer version, files in chromium_src is older than original file.
If overridden files are updated during the rebase, it will trigger rebuild w/o this touching.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see. If chromium_src timestamp gets updated after chromium upgrade, it will trigger rebuild then we don't need to touch anything to trigger it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, and we don't want to unnecessarily trigger larger rebuilds for files that haven't changed

@simonhong simonhong merged commit 4058a15 into master Jun 30, 2018
@cezaraugusto cezaraugusto deleted the touch_overridden_files_automatically branch July 9, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants