Closed Bug 1469712 Opened Last year Closed Last year

./mach build-backend --dry-run changes mtime of backend file

Categories

(Firefox Build System :: General, enhancement)

3 Branch
enhancement
Not set

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: mshal, Assigned: mshal)

Details

Attachments

(1 file)

If you change a moz.build file, then './mach build-backend --dry-run --diff' to see what changed in the backend, a future './mach build' will not update the backend. Eg:

./mach build
# Change some moz.build file
./mach build-backend --dry-run --diff
./mach build

The last command should automatically update the backend and build with the new configuration, but the --dry-run command before it is updating the mtime of the backend.FooBackend file so it appears up to date.
Comment on attachment 8986308 [details]
Bug 1469712 - Don't update mtime for backend file during --dry-run;

https://reviewboard.mozilla.org/r/251676/#review258058

::: python/mozbuild/mozbuild/backend/base.py:177
(Diff revision 1)
> -            # Always update its mtime.
> +            # Always update its mtime if we're not in dry-run mode.
> +            if not self.dry_run:
> -            with open(list_file, 'a'):
> +                with open(list_file, 'a'):
> -                os.utime(list_file, None)
> +                    os.utime(list_file, None)

It's not entirely clear to me why we need to bump the mtime here, but this change certainly makes sense.
Attachment #8986308 - Flags: review+
Attachment #8986308 - Flags: review?(core-build-config-reviews)
Attachment #8986308 - Flags: review?(gps)
Comment on attachment 8986308 [details]
Bug 1469712 - Don't update mtime for backend file during --dry-run;

https://reviewboard.mozilla.org/r/251676/#review258060
Attachment #8986308 - Flags: review?(gps) → review+
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4f001c506ff8
Don't update mtime for backend file during --dry-run; r=gps
https://hg.mozilla.org/mozilla-central/rev/4f001c506ff8
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.