Bug 1455722 - Don't use FileAvoidWrite for writing .xpt files. r=mccr8
authorNika Layzell <nika@thelayzells.com>
Mon, 30 Apr 2018 15:15:00 -0400
changeset 417486 44cb8693cb49517db91ab19621dd5fff234f64eb
parent 417485 f6a510be556683b2240df86e4024b44bd96765aa
child 417487 de518c23c3c7a6d0779c874a9fbaff3cbb4df00c
push id103068
push userryanvm@gmail.com
push dateWed, 09 May 2018 00:26:28 +0000
treeherdermozilla-inbound@44cb8693cb49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1455722
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455722 - Don't use FileAvoidWrite for writing .xpt files. r=mccr8 Unfortunately, FileAvoidWrite causes us to re-generate .xpt files every time we build if a dependency of the .xpt files doesn't affect their output. The easiest solution is to stop performing this option until we get a better build backend like `tup` which can handle problems like this.
python/mozbuild/mozbuild/action/xpidl-process.py
--- a/python/mozbuild/mozbuild/action/xpidl-process.py
+++ b/python/mozbuild/mozbuild/action/xpidl-process.py
@@ -62,18 +62,23 @@ def process(input_dir, inc_paths, bindin
             print_header(idl, fh, path)
 
         with FileAvoidWrite(rs_rt_path) as fh:
             print_rust_bindings(idl, fh, path)
 
         with FileAvoidWrite(rs_bt_path) as fh:
             print_rust_macros_bindings(idl, fh, path)
 
+    # NOTE: We don't use FileAvoidWrite here as we may re-run this code due to a
+    # number of different changes in the code, which may not cause the .xpt
+    # files to be changed in any way. This means that make will re-run us every
+    # time a build is run whether or not anything changed. To fix this we
+    # unconditionally write out the file.
     xpt_path = os.path.join(xpt_dir, '%s.xpt' % module)
-    with FileAvoidWrite(xpt_path) as fh:
+    with open(xpt_path, 'w') as fh:
         jsonxpt.write(jsonxpt.link(xpts), fh)
 
     rule.add_targets([xpt_path])
     if deps_dir:
         deps_path = os.path.join(deps_dir, '%s.pp' % module)
         with FileAvoidWrite(deps_path) as fh:
             mk.dump(fh)