Skip to content

Commit

Permalink
Bug 1426558 - Make autospider builds not rely on system libnspr. r=sfink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glandium committed Dec 21, 2017
1 parent 734a648 commit 0f519f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/app.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ else:
'/js/src/tests',
]

if CONFIG['JS_STANDALONE'] and CONFIG['OS_ARCH'] != 'WINNT':
DIRS += [
'/build/unix',
]

DIRS += [
'/config/external/fdlibm',
'/config/external/nspr',
Expand Down
4 changes: 4 additions & 0 deletions js/src/devtools/automation/autospider.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ def ensure_dir_exists(name, clobber=True, creation_marker_filename="CREATED-BY-A
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'))
Expand Down
2 changes: 2 additions & 0 deletions js/src/devtools/rootAnalysis/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def env(config):
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):
Expand Down

0 comments on commit 0f519f5

Please sign in to comment.