[PATCH] D109659: Fix scan-build-py executable lookup path

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 12 06:48:17 PDT 2021


serge-sans-paille created this revision.
serge-sans-paille added reviewers: sylvestre.ledru, isthismyaccount, phosek.
Herald added a subscriber: whisperity.
serge-sans-paille requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Once installed, scan-build-py doesn't know anything about its auxiliary executable and can't find them.
Use relative path wrt. scan-build-py script.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109659

Files:
  clang/tools/scan-build-py/lib/libscanbuild/analyze.py


Index: clang/tools/scan-build-py/lib/libscanbuild/analyze.py
===================================================================
--- clang/tools/scan-build-py/lib/libscanbuild/analyze.py
+++ clang/tools/scan-build-py/lib/libscanbuild/analyze.py
@@ -39,8 +39,10 @@
 
 __all__ = ['scan_build', 'analyze_build', 'analyze_compiler_wrapper']
 
-COMPILER_WRAPPER_CC = 'analyze-cc'
-COMPILER_WRAPPER_CXX = 'analyze-c++'
+scanbuild_dir = os.path.dirname(__import__('sys').argv[0])
+
+COMPILER_WRAPPER_CC = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-cc')
+COMPILER_WRAPPER_CXX = os.path.join(scanbuild_dir, '..', 'libexec', 'analyze-c++')
 
 CTU_EXTDEF_MAP_FILENAME = 'externalDefMap.txt'
 CTU_TEMP_DEFMAP_FOLDER = 'tmpExternalDefMaps'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109659.372121.patch
Type: text/x-patch
Size: 738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210912/509b5e76/attachment.bin>


More information about the cfe-commits mailing list