Bug 1478561 - Expose MOZ_AUTOMATION to rust running in the tup build.
MozReview-Commit-ID: 6ekOYJv7iz7
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -721,16 +721,23 @@ class TupBackend(CommonBackend):
env.update({
'MOZ_CARGO_WRAP_LDFLAGS': ' '.join(backend_file.local_flags['LDFLAGS']),
'MOZ_CARGO_WRAP_LD': backend_file.environment.substs['CC'],
linker_env_var: mozpath.join(self.environment.topsrcdir,
'build', 'cargo-linker'),
'RUSTFLAGS': '%s %s' % (' '.join(self.environment.substs['MOZ_RUST_DEFAULT_FLAGS']),
' '.join(self.environment.substs['RUSTFLAGS'])),
})
+
+ if os.environ.get('MOZ_AUTOMATION'):
+ # Build scripts generally read environment variables that are set
+ # by cargo, however, some may rely on MOZ_AUTOMATION. We may need
+ # to audit for others as well.
+ env['MOZ_AUTOMATION'] = os.environ['MOZ_AUTOMATION']
+
return env
def _gen_cargo_rules(self, backend_file, build_plan, cargo_env):
invocations = build_plan['invocations']
processed = set()
def get_libloading_outdir():
for invocation in invocations: