maint: Ask GCC for system headers

In the previous update commit, the Nix `cc.version` didn't match the
in-output directory name anymore, causing a build failure.

By asking GCC properly, we are robust against such discrepancies.

The script isn't great, relying on GCC "log" output specifics, but it
seems that the GCC output has been like this for a while, and the
lines before and after seem to be intentional about their purpose...

(cherry picked from commit 68f928555660cb914105b0ad668d6cadc25223e9)
This commit is contained in:
Robert Hensing 2025-01-08 11:14:09 +01:00
parent d693957c1a
commit 32136109fc
3 changed files with 28 additions and 8 deletions

View file

@ -36,7 +36,7 @@
inputsFrom = [ config.nci.outputs.nix-bindings.devShell ];
inherit (config.nci.outputs.nix-bindings.devShell.env)
LIBCLANG_PATH
BINDGEN_EXTRA_CLANG_ARGS
NIX_CC_UNWRAPPED
;
NIX_DEBUG_INFO_DIRS =
let
@ -66,6 +66,7 @@
];
shellHook = ''
${config.pre-commit.installationScript}
source ${../rust/bindgen-gcc.sh}
echo 1>&2 "Welcome to the development shell!"
'';
# rust-analyzer needs a NIX_PATH for some reason