Skip to content

Standard library headers not being found properly bear+gcc under Nix #424

@varungandhi-src

Description

@varungandhi-src

Reproduction steps (on Linux):

  1. Install Nix
  2. Run the following: (borrowed from the official docs)
git clone https://github.com/NixOS/nix.git && cd nix
git checkout 2cdc9c32e746a620458a1dd87655d2a6c3800f64
nix --extra-experimental-features nix-command --extra-experimental-features flakes develop

./bootstrap.sh
./configure $configureFlags --prefix=$(pwd)/outputs/out

sudo apt-get install bear
bear --force-wrapper -- make -j "$NIX_BUILD_CORES"

jq '[.[] | select(.file | contains("legacy.cc"))]' compile_commands.json > min.json
wget https://github.com/sourcegraph/scip-clang/releases/download/v0.2.7/scip-clang-x86_64-linux
chmod +x scip-clang
scip-clang --compdb-path=min.json --show-compiler-diagnostics
In file included from src/libcmd/legacy.cc:1:
src/libcmd/legacy.hh:4:10: fatal error: 'functional' file not found
#include <functional>
         ^~~~~~~~~~~~
1 error generated.

The above error shouldn't come up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions