Bug 1478557 - Use the command string rather than output list as a key for cargo commands in the tup backend.
MozReview-Commit-ID: B8FtvHScXon
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -261,17 +261,17 @@ class TupBackend(CommonBackend):
# dependencies that aren't specified by moz.build and cause errors
# in Tup. Express these as a group dependency.
self._early_generated_files = '$(MOZ_OBJ_ROOT)/<early-generated-files>'
self._shlibs = '$(MOZ_OBJ_ROOT)/<shlibs>'
self._gtests = '$(MOZ_OBJ_ROOT)/<gtest>'
self._default_group = '$(MOZ_OBJ_ROOT)/<default>'
- self._rust_outputs = set()
+ self._rust_cmds = set()
self._built_in_addons = set()
self._built_in_addons_file = 'dist/bin/browser/chrome/browser/content/browser/built_in_addons.json'
def _get_mozconfig_env(self, config):
env = {}
loader = MozconfigLoader(config.topsrcdir)
@@ -795,34 +795,33 @@ class TupBackend(CommonBackend):
header = 'RUSTC'
else:
inputs.add(invocation['program'])
header = 'RUN'
invocation['full-deps'] = set(inputs)
invocation['full-deps'].update(invocation['outputs'])
- output_key = tuple(outputs)
- if output_key not in self._rust_outputs:
+ cmd_key = ' '.join(command)
+ if cmd_key not in self._rust_cmds:
+ self._rust_cmds.add(cmd_key)
# 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')
- self._rust_outputs.add(output_key)
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)),
)
for dst, link in invocation['links'].iteritems():
- self._rust_outputs.add(output_key)
rust_backend_file.symlink_rule(link, dst, self._rust_libs)
for val in enumerate(invocations):
_process(*val)
def _gen_rust_rules(self, obj, backend_file):
cargo_flags = self._get_cargo_flags(obj)