Bug 1480313 - Set check_unchanged for cargo build script rules in the Tup build.
MozReview-Commit-ID: Cx3sP5m16Yl
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -807,27 +807,37 @@ class TupBackend(CommonBackend):
header = 'RUN'
invocation['full-deps'] = set(inputs)
invocation['full-deps'].update(invocation['outputs'])
cmd_key = ' '.join(command)
if cmd_key not in self._rust_cmds:
self._rust_cmds.add(cmd_key)
+ # We have some custom build scripts that depend on python code
+ # as well as invalidate a lot of the rust build, so set
+ # check_unchanged to try to reduce long incremental builds
+ # when only changing python.
+ check_unchanged = False
+ if (invocation['target_kind'][0] == 'custom-build' and
+ os.path.basename(invocation['program']) != 'rustc'):
+ check_unchanged = True
+
# The two rust libraries in the tree share many prerequisites,
# so we need to prune common dependencies and therefore build
# all rust from the same Tupfile.
rust_backend_file = self._get_backend_file('toolkit/library/rust')
rust_backend_file.rule(
command,
inputs=sorted(inputs),
outputs=outputs,
output_group=self._rust_libs,
extra_inputs=[self._installed_files],
display='%s %s' % (header, display_name(invocation)),
+ check_unchanged=check_unchanged,
)
for dst, link in invocation['links'].iteritems():
rust_backend_file.symlink_rule(link, dst, self._rust_libs)
for val in enumerate(invocations):
_process(*val)