Bug 1283898 - Put rust in path for Spidermonkey automation. r=gps draft
authorRalph Giles <giles@mozilla.com>
Wed, 30 Nov 2016 17:40:02 -0800
changeset 449319 9ad714c7e26b2561b66a1141da3f2664341863e7
parent 449318 2b1cc52f0945ef3cff60efbc541ea40b59393482
child 449320 e20de14b6ce3c423fe75b94f8bafe8e402b905cb
push id38543
push userbmo:giles@thaumas.net
push dateTue, 13 Dec 2016 23:13:40 +0000
reviewersgps
bugs1283898
milestone53.0a1
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
js/src/devtools/automation/autospider.py
--- 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: