Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Allow for non-fatal shell execution, and turn “install_name_tool” sta…
Browse files Browse the repository at this point in the history
…ging failures to warnings as we find a more permanent solution to AOT dylibs not always having enough field space for the new path (all other dylibs made in the build with the XCode toolchain typically do, as they are built with the “-headerpad_max_install_names” flag.
  • Loading branch information
alexischr committed Aug 14, 2017
1 parent 3daa357 commit 141e6a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bockbuild/darwinprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ class stage_binaries (Profile.FileProcessor):
def process(self, path, fixup_func):
staged_path = fixup_func(path)

run_shell('install_name_tool -id %s %s' %
(staged_path, path), False)

run_shell('install_name_tool -id %s %s' %
(staged_path, path), fatal=False)
libs = backtick('otool -L %s' % path)
for line in libs:
# parse 'otool -L'
Expand All @@ -343,4 +343,4 @@ def process(self, path, fixup_func):
remap = fixup_func(rpath)
if remap != rpath:
run_shell('install_name_tool -change %s %s %s' %
(rpath, remap, path), False)
(rpath, remap, path), fatal=False)
9 changes: 6 additions & 3 deletions bockbuild/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,16 +686,19 @@ def run(cmd, args, cwd, env=None):
return (exit_code, stdout[:-1], stderr)


def run_shell(cmd, print_cmd=False, cwd=None):
def run_shell(cmd, print_cmd=False, cwd=None, fatal=True):
if print_cmd:
print '++', cmd
if not print_cmd:
trace(cmd)
proc = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=cwd)
exit_code = proc.wait()
if not exit_code == 0:
raise CommandException('"%s" failed, error code %s' %
(cmd, exit_code), cwd)
msg = '"%s" failed, error code %s' % (cmd, exit_code)
if fatal:
raise CommandException(msg, cwd)
else:
warn (msg)


def backtick(cmd, print_cmd=False, echo=False):
Expand Down

0 comments on commit 141e6a5

Please sign in to comment.