Bug 1283898 - Put rust in path for Spidermonkey automation. r=gps
When rust is enabled, the Spidermonkey package tests need to
be able to find the rust toolchain. It's available, because
the job uses the linux64/releng.manifest, but the corresponding
path directives from mozconfig are not imported. So we set
them manually here, falling back to the rustc and cargo in
PATH, like we do for the C++ toolchain.
MozReview-Commit-ID: 8lZSQ0Ffr0c
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -173,16 +173,24 @@ if os.path.exists(os.path.join(compiler_
env.setdefault('CC', os.path.join(compiler_dir, 'bin', compiler))
env.setdefault('CXX', os.path.join(compiler_dir, 'bin', cxx))
platlib = 'lib64' if word_bits == 64 else 'lib'
env.setdefault('LD_LIBRARY_PATH', os.path.join(compiler_dir, platlib))
else:
env.setdefault('CC', compiler)
env.setdefault('CXX', cxx)
+rust_dir = os.path.join(DIR.tooltool, 'rustc')
+if os.path.exists(os.path.join(rust_dir, 'bin', 'rustc')):
+ env.setdefault('RUSTC', os.path.join(rust_dir, 'bin', 'rustc'))
+ env.setdefault('CARGO', os.path.join(rust_dir, 'bin', 'cargo'))
+else:
+ env.setdefault('RUSTC', 'rustc')
+ env.setdefault('CARGO', 'cargo')
+
if platform.system() == 'Darwin':
os.environ['SOURCE'] = DIR.source
set_vars_from_script(os.path.join(DIR.scripts, 'macbuildenv.sh'),
['CC', 'CXX'])
elif platform.system() == 'Windows':
MAKE = env.get('MAKE', 'mozmake')
os.environ['SOURCE'] = DIR.source
if word_bits == 64: