Bug 1426558 - Make autospider builds not rely on system libnspr. r?sfink
The only reason autospider builds succeed in running tests at the moment
is that there is a libnspr4 library installed at the system level on
Centos that is binary compatible with what the js shell requires.
While on the long run we should just avoid depending on libnspr4 at all,
in the short term, we should make the effort to make those tests use the
libnspr4 present in dist/bin.
For the tests executed from js/src/Makefile.in, it turns out there is
already a level of wrapping that does that, relying on run-mozilla.sh,
which is only installed on gecko builds. Installing it on standalone js
builds solve half the problem.
The other half is addressed by setting LD_LIBRARY_PATH before invoking
the js shell in the various places it's invoked.
--- a/js/app.mozbuild
+++ b/js/app.mozbuild
@@ -8,16 +8,21 @@ if CONFIG['COMPILE_ENVIRONMENT']:
DIRS += [
'/js/src',
]
else:
TEST_DIRS += [
'/js/src/tests',
]
+if CONFIG['JS_STANDALONE'] and CONFIG['OS_ARCH'] != 'WINNT':
+ DIRS += [
+ '/build/unix',
+ ]
+
DIRS += [
'/config/external/fdlibm',
'/config/external/nspr',
'/config/external/zlib',
'/memory',
'/mozglue',
]
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -225,16 +225,20 @@ 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)
+bindir = os.path.join(OBJDIR, 'dist', 'bin')
+env['LD_LIBRARY_PATH'] = ':'.join(
+ p for p in (bindir, env.get('LD_LIBRARY_PATH')) if p)
+
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')
--- a/js/src/devtools/rootAnalysis/analyze.py
+++ b/js/src/devtools/rootAnalysis/analyze.py
@@ -27,16 +27,18 @@ except:
exec(compile(open(thefile).read(), filename=thefile, mode="exec"), globals)
def env(config):
e = dict(os.environ)
e['PATH'] = ':'.join(p for p in (config.get('gcc_bin'), config.get('sixgill_bin'), e['PATH']) if p)
e['XDB'] = '%(sixgill_bin)s/xdb.so' % config
e['SOURCE'] = config['source']
e['ANALYZED_OBJDIR'] = config['objdir']
+ bindir = os.path.dirname(config['js'])
+ e['LD_LIBRARY_PATH'] = ':'.join(p for p in (e.get('LD_LIBRARY_PATH'), bindir) if p)
return e
def fill(command, config):
try:
return tuple(s % config for s in command)
except:
print("Substitution failed:")
problems = []