[PATCH] D58647: [compiler-rt] Provide better llvm-lit failure when llvm-config fails.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 15:00:00 PST 2019


hctim created this revision.
hctim added a reviewer: pcc.
Herald added subscribers: llvm-commits, Sanitizers, jdoerfert, kristof.beyls, javed.absar, dberris.
Herald added projects: Sanitizers, LLVM.

The current error message can cause confusion if llvm-config can't be
executed for reasons other than "not found". In my example, cross
compiling generated an llvm-config binary for aarch64 which couldn't be
executed natively. Instead of telling me that the error was with the
file architecture, it reports the file as not being present.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58647

Files:
  compiler-rt/test/lit.common.cfg


Index: compiler-rt/test/lit.common.cfg
===================================================================
--- compiler-rt/test/lit.common.cfg
+++ compiler-rt/test/lit.common.cfg
@@ -389,7 +389,8 @@
       stdout = subprocess.PIPE,
       env=config.environment)
 except OSError:
-  print("Could not find llvm-config in " + config.llvm_tools_dir)
+  print("Could not launch llvm-config in " + config.llvm_tools_dir)
+  print("    Failed with error #{0}: {1}".format(e.errno, e.strerror))
   exit(42)
 
 if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58647.188258.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190225/4aa245ea/attachment.bin>


More information about the llvm-commits mailing list