NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.2k stars 14.2k forks source link

scan-build from libclang unable to find ccc-analyzer #151367

Open jtojnar opened 2 years ago

jtojnar commented 2 years ago

Describe the bug

scan-build program from libclang looks for ccc-analyzer in ../libexec but it is installed into a different output.

Steps To Reproduce

$ nix-build -A libclang.all
$ result/bin/scan-build -o /tmp/foo echo
scan-build: 'ccc-analyzer' does not exist at '/nix/store/54fwpd1lsgr1kadg9989cvafqkzfsqm8-clang-7.1.0/bin/ccc-analyzer'

Expected behaviour

scan-build should find ccc-analyzer.

Additional context

It works with scan-build from clang-analyzer:

$ nix-build -A clang-analyzer
$ result/bin/scan-build -o /tmp/foo echo
scan-build: Using '/nix/store/52w8z9p8m5idz4fsh9y1znmms59da8ba-clang-wrapper-13.0.0/bin/clang' for static analysis
[…]

This is bug is especially annoying because when it is first on PATH, it shadows the working program.

Possible solutions

Notify maintainers

cc @lovek323 @7c6f434c @dtzWill @primeos (libclang) cc @thoughtpolice @Mic92 (clang-analyzer)

Metadata

Nixpkgs a2e281f5770247855b85d70c43454ba5bff34613

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: libclang
# a list of nixos modules affected by the problem
module:
Mic92 commented 2 years ago

The llvm code build system is quite convoluted. Otherwise we could have just disabled scan-build from libclang build.

jtojnar commented 2 years ago

Possibly will be fixed by https://github.com/NixOS/nixpkgs/pull/144302

hmih commented 2 years ago

Still happening on aarch64-darwin.

disconnect3d commented 1 year ago

Still happening on Darwin x86_64. Fix please! :)

ranguli commented 1 year ago

And on NixOS x86_64 too :(