llvmPackages_*.clang-unwrapped: make scan-build work#144302
llvmPackages_*.clang-unwrapped: make scan-build work#144302sternenseemann wants to merge 2 commits intoNixOS:stagingfrom
Conversation
fccaef1 to
aff17c6
Compare
aff17c6 to
78a517d
Compare
|
Checked build & it works |
|
Unsure whether this creates a problem for darwin in its current form since perl is not in bootstrap-tools I believe? |
|
Hello, is there any update on this ? I'm having the same issue as #151367 as of now. ~/repos/NTNU/CSU0013
$ scan-build -V make (71e23ed)
scan-build: 'ccc-analyzer' does not exist at '/nix/store/a5v30qll5i02vr9y97bk1rdx3mm6kvlm-clang-16.0.6/bin/ccc-analyzer' |
78a517d to
7caf02c
Compare
7caf02c to
163eee6
Compare
|
Can I get some feedback on this (again)? For me there are the following questions:
|
|
Haven't had much of a look, but please no unpatched shebangs — it would make it not run in the Nix sandbox, where there's no /usr/bin/env. |
|
This PR has merge conflicts, has gotten stale, and has CI failures, is this PR still something we want to have done? |
|
Yes, we probably should. It's still an issue that scan-build doesn't work. |
|
Alright, any plans on rebasing the PR to resolve the conflicts? |
|
Are there any plans to move forward with this PR? This is still an open issue. |
|
@sternenseemann I'd love to see this land - not a contributor, but anything I can do to help? |
Unfortunately not, this PR requires rebasing which @sternenseemann has to do. |
|
I'll try and remember to do it soon, sorry! |
Move scan-build-py and its dependencies libear, libscanbuild,
analyze{c++,cc} and intercept-{cc,c++} where they are patchShebanged
without incurring an extra dependency on python for $out.
libear, libscanbuild, libexec/{intercept,analyze}-c* are tracked in
clang/tools/scan-build-py, so I assume they aren't used by anything
else.
This is a conservative take on making scan-build work. It basically
needs two things
- perl, idelly via a patched shebang
- Access to {ccc,c++}-analyzer which is provided easily by moving
libexec. Patching scan-build to look into $lib would defeat the
purpose of the separate outputs, of course.
The former is not provided via this change, instead /usr/bin/env and
perl in PATH are required. This is mainly to avoid the closure size
increase of ~100MB caused by perl plus potential bootstrapping trouble
on darwin. (scan-build-py can be made to work without much less problems
since clang-unwrapped.python already depends on python.) We can probably
improve on this by adding scan-build* to clang-tools.
0d6978f to
8792e30
Compare
|
Redid the entire change on current nixpkgs and also made |
|
@RossComputerGuy Just found this again… Do we still want to do this? |
If we want the tools still, sure |
scan-build and c*-analyzer are written in Perl, so we need to add it
as a buildInput, so the interpreter is patched.
For scan-build to discover c*-analyzer, the
binandlibexecdirectories need to be in the same prefix. Since this is no big
trouble for clang, we can just move the libexec directory from the
libto theoutoutput.To be tested how this interacts with bootstrapping for macOS and perhaps
pkgsLLVM.Additional perl dependency may be a problem in some cases?
Motivation for this change
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)