clang analyzer script's python interpreter is not configurable
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The clang analyzer scripts (`analyze-build`, `intercept-build` and `scan-build`. Install with a non-configurable `#!/usr/bin/env python3` shebang. The `clang` python module builds for whatever version of `python` it finds at build-time. So if `/usr/bin/python3` is `3.14` at build-time, but then later becomes `3.15`, those scripts will not find a module to import. Please make this shebang configurable, possibly via the `-DPYTHON_EXECUTABLE` `cmake` flag.
Our use case:
On wolfi/Chainguard OS systems, we provide multiple `/usr/bin/python3.x` versions concurrently, and we try to configure all OS commands to use a `#!/usr/bin/env python3.x` shebang instead of making assumptions about `python3`. This allows `/usr/bin/python3` free to point to whatever the end-user/application prefers (or to not exist at all).
Contributor guide
Research direction
Start with the analyze-build, intercept-build, and scan-build script entry points and trace how their Python shebangs are installed. Read the CMake configuration around PYTHON_EXECUTABLE and verify how the clang Python module's build-time interpreter is selected. Done means the installed scripts use the configured interpreter rather than a fixed python3, while still importing the matching module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100