Skip to content

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

@jtojnar

Description

@jtojnar

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

  • Remove scan-build from libclang so it has a canonical home in clang-analyzer.
  • Patch scan-build code to point to lib output.
  • Move ccc-analyzer to out output.

Notify maintainers

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

Metadata

Nixpkgs a2e281f

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: libclang
# a list of nixos modules affected by the problem
module:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions