Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938665 - llvm-core/clang: Module import path mismatch in the intercept-build tool
Summary: llvm-core/clang: Module import path mismatch in the intercept-build tool
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-29 06:20 UTC by aapo.vienamo
Modified: 2024-12-11 14:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aapo.vienamo 2024-08-29 06:20:39 UTC
Invoking intercept-build from the command line results in a crash:
% intercept-build
Traceback (most recent call last):
  File "/usr/lib/llvm/18/bin/intercept-build", line 13, in <module>
    from libscanbuild.intercept import intercept_build
ModuleNotFoundError: No module named 'libscanbuild'

This reproduces at least on clang-17 and -18. The issue is that there's a mismatch of the expected location of the clang specific Python modules.

Internally intercept-build (located at /usr/lib/llvm/18/bin/intercept-build) does:
this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(os.path.dirname(this_dir), 'lib')

Which results in
/usr/lib/llvm/18/lib
but the actual Python modules are installed into
/usr/lib/llvm/18/lib64


Reproducible: Always

Steps to Reproduce:
1. Invoke intercept-build from command line
2.
3.
Actual Results:  
Traceback (most recent call last):
  File "/usr/lib/llvm/18/bin/intercept-build", line 15, in <module>
    from libscanbuild.intercept import intercept_build
ModuleNotFoundError: No module named 'libscanbuild'


Expected Results:  
usage: intercept-build [-h] [--verbose] [--cdb <file>] [--override-compiler] [--use-cc <path>] [--use-c++ <path>] [--append] ...
intercept-build: error: missing build command