clang analyzer script's python interpreter is not configurable
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).
@llvm/issue-subscribers-clang-static-analyzer
Author: dann frazier (dannf)
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).
I’d like to work on this.
My current plan is to make the Python shebang used by scan-build-py configurable from CMake, instead of hardcoding #!/usr/bin/env python3, while keeping the current default behavior unchanged. I think this should cover the installed entry-point scripts as well as the related wrapper scripts under libexec, so they all use the same interpreter choice.
I guess it makes sense, but I'm just a regular user of python. Definitely not a power user.