Bug 1461795 - Use FileAvoidWrite when writing mozinfo.json; r=chmanchester
Since MozbuildObject.from_environment() reads from mozinfo.json, tup picks up that file as a dependency for anything that imports buildconfig (eg: all generated files). Using FileAvoidWrite when creating mozinfo.json will help avoid unnecessary work after re-running configure in the tup backend. MozReview-Commit-ID: EEOPQYJA1MV
This commit is contained in:
@@ -108,7 +108,6 @@ def config_status(config):
|
||||
# executable permissions.
|
||||
os.chmod('config.status', 0o755)
|
||||
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
|
||||
os.environ[b'WRITE_MOZINFO'] = b'1'
|
||||
from mozbuild.config_status import config_status
|
||||
|
||||
# Some values in sanitized_config also have more complex types, such as
|
||||
|
||||
@@ -22,6 +22,7 @@ from mozbuild.base import MachCommandConditions
|
||||
from mozbuild.frontend.emitter import TreeMetadataEmitter
|
||||
from mozbuild.frontend.reader import BuildReader
|
||||
from mozbuild.mozinfo import write_mozinfo
|
||||
from mozbuild.util import FileAvoidWrite
|
||||
from itertools import chain
|
||||
|
||||
from mozbuild.backend import (
|
||||
@@ -114,10 +115,8 @@ def config_status(topobjdir='.', topsrcdir='.', defines=None,
|
||||
non_global_defines=non_global_defines, substs=substs,
|
||||
source=source, mozconfig=mozconfig)
|
||||
|
||||
# mozinfo.json only needs written if configure changes and configure always
|
||||
# passes this environment variable.
|
||||
if 'WRITE_MOZINFO' in os.environ:
|
||||
write_mozinfo(os.path.join(topobjdir, 'mozinfo.json'), env, os.environ)
|
||||
with FileAvoidWrite(os.path.join(topobjdir, 'mozinfo.json')) as f:
|
||||
write_mozinfo(f, env, os.environ)
|
||||
|
||||
cpu_start = time.clock()
|
||||
time_start = time.time()
|
||||
|
||||
Reference in New Issue
Block a user