diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-08-15 09:58:18 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-08-24 08:27:38 -0400 |
commit | 9a988c6c0ed719a03350d7e7dc7e62f555068bfd (patch) | |
tree | 64af2b6f77c8dd8dc27ef83b3629157263b180f2 /site_scons | |
parent | 1a02e9f98305c6de293e98bfbdcc69f5cc33b9e0 (diff) | |
download | mongo-9a988c6c0ed719a03350d7e7dc7e62f555068bfd.tar.gz |
SERVER-9666 If abidw fails, fall back to contents
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/abilink.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/site_scons/site_tools/abilink.py b/site_scons/site_tools/abilink.py index 82500082aa3..b61a38deda9 100644 --- a/site_scons/site_tools/abilink.py +++ b/site_scons/site_tools/abilink.py @@ -35,16 +35,26 @@ def generate(env): def get_contents(self): if not self.rexists(): return '' + fname = self.rfile().abspath + contents = None + try: # TODO: If there were python bindings for libabigail, we # could avoid the shell out (and probably be faster, as we # could get exactly the information we want). contents = subprocess.check_output([env.subst('$ABIDW'), fname]) - except EnvironmentError, e: - if not e.filename: - e.filename = fname - raise + except subprocess.CalledProcessError, e: + # ABIDW sometimes fails. In that case, log an error + # and fall back to the normal contents + print "WARNING: ABIDW failed for target %s, please file a bug report" % fname + try: + contents = open(fname, "rb").read() + except EnvironmentError, e: + if not e.filename: + e.filename = fname + raise + return contents def get_content_hash(self): |