# HG changeset patch
# User Mike Shal <mshal@mozilla.com>
# Date 1525899064 14400
# Node ID 9260cc524bb54d9318075578488de8a6f40677eb
# Parent  1eb04a9bfb7a82eb6fac5e29be7c6b03999d9361
Bug 1454912 - Revert "Bug 1218999 - Update mtimes when building a GENERATED_FILES target, even when contents don't change."; r=nalexander

We no longer want to update mtimes of FileAvoidWrites so that downstream
rules aren't triggered if the files aren't changed. Since the .stub file
target of GENERATED_FILES are always touched, make won't continually
rebuild them.

MozReview-Commit-ID: GxrFgCJTYk

diff --git a/python/mozbuild/mozbuild/action/file_generate.py b/python/mozbuild/mozbuild/action/file_generate.py
--- a/python/mozbuild/mozbuild/action/file_generate.py
+++ b/python/mozbuild/mozbuild/action/file_generate.py
@@ -95,25 +95,16 @@ def main(argv):
                 # Add dependencies on any buildconfig items that were accessed
                 # by the script.
                 deps |= set(buildconfig.get_dependencies())
 
                 mk = Makefile()
                 mk.create_rule([args.dep_target]).add_dependencies(deps)
                 with FileAvoidWrite(args.dep_file) as dep_file:
                     mk.dump(dep_file)
-        # Even when our file's contents haven't changed, we want to update
-        # the file's mtime so make knows this target isn't still older than
-        # whatever prerequisite caused it to be built this time around.
-        try:
-            os.utime(args.output_file, None)
-        except:
-            print('Error processing file "{0}"'.format(args.output_file),
-                  file=sys.stderr)
-            traceback.print_exc()
     except IOError as e:
         print('Error opening file "{0}"'.format(e.filename), file=sys.stderr)
         traceback.print_exc()
         return 1
     return ret
 
 if __name__ == '__main__':
     sys.exit(main(sys.argv[1:]))

