Skip to content

Commit

Permalink
Demote llvm-nm failures from exceptions to logged debug messages, bec…
Browse files Browse the repository at this point in the history
…ause it can be expected that llvm-nm might fail, and processing that failure is done proper by examining the returncode of the run later, so eagerly stopping the build here is not needed. Fixes #5007.
  • Loading branch information
juj committed Mar 8, 2017
1 parent 28d43cc commit 93a082b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ def parallel_llvm_nm(files):

for i in range(len(files)):
if object_contents[i].returncode != 0:
raise Exception('llvm-nm failed on file ' + files[i] + ': return code ' + str(object_contents[i].returncode) + ', error: ' + object_contents[i].output)
logging.debug('llvm-nm failed on file ' + files[i] + ': return code ' + str(object_contents[i].returncode) + ', error: ' + object_contents[i].output)
Building.uninternal_nm_cache[files[i]] = object_contents[i]
return object_contents

Expand Down Expand Up @@ -1919,8 +1919,9 @@ def llvm_nm(filename, stdout=PIPE, stderr=PIPE, include_internal=False):
ret = Building.llvm_nm_uncached(filename, stdout, stderr, include_internal)

if ret.returncode != 0:
raise Exception('llvm-nm failed on file ' + filename + ': return code ' + str(ret.returncode) + ', error: ' + ret.output)
logging.debug('llvm-nm failed on file ' + filename + ': return code ' + str(ret.returncode) + ', error: ' + ret.output)

# Even if we fail, write the results to the NM cache so that we don't keep trying to llvm-nm the failing file again later.
if include_internal: Building.internal_nm_cache[filename] = ret
else: Building.uninternal_nm_cache[filename] = ret

Expand Down

0 comments on commit 93a082b

Please sign in to comment.