Bug 1469712 - Don't update mtime for backend file during --dry-run; r=gps

When we do a './mach build-backend --dry-run', no files in the objdir
should be written or touched. Updating the mtime of the backend file
during dry-run causes a future './mach build' to think that the backend
is up-to-date when it is not, which causes an incorrect build.

MozReview-Commit-ID: 2NA0rcSGrvL

--HG--
extra : amend_source : f694503264dc6275568c453de59b7f13983091f7
This commit is contained in:
Mike Shal 2018-06-19 17:15:37 -04:00
Родитель 827ee0085c
Коммит e9fda85331
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -174,9 +174,10 @@ class BuildBackend(LoggingMixin):
with self._write_file(list_file) as fh:
fh.write('\n'.join(sorted(self._backend_output_files)))
else:
# Always update its mtime.
with open(list_file, 'a'):
os.utime(list_file, None)
# Always update its mtime if we're not in dry-run mode.
if not self.dry_run:
with open(list_file, 'a'):
os.utime(list_file, None)
# Write out the list of input files for the backend
with self._write_file('%s.in' % list_file) as fh: