wrapper-common/utils.bash, gcc: @file
params are not put back into an @file
after expansion
#255359
Labels
0.kind: bug
Something is broken
Describe the bug
When a tool uses an
@file
to execute gcc (or any of the gnu linkers) via the wrappers,expandResponseParams
undoes the@file
that the tool uses. For examplehsc2hs
always uses@file
s to run linkers (see https://github.com/haskell/hsc2hs/blob/5bf5c61e7c6e813d03bc069e17289c574185d41c/src/Common.hs#L37).But in the wrappers (via
utils.bash
)expandResponseParams
silently expand@file
s and re-execs the compiler/linker without the@file
in the cc/ld wrappers. Seenixpkgs/pkgs/build-support/wrapper-common/utils.bash
Line 121 in 7fb1b60
NIX_LD_USE_RESPONSE_FILE
herenixpkgs/pkgs/build-support/bintools-wrapper/ld-wrapper.sh
Line 259 in 973d6eb
@file
was explicitly requested by the invoking tool.This results in
E2BIG
for even smallhsc2hs
invocations.This would seem easy enough to fix - by setting an env var like
NIX_REPONSE_FILE_EXPANDED=1
and also checking that, but it seems to break some packages (like bison and ghc itself though maybe this is fixed on staging).Related to #41340
Steps To Reproduce
(on
x86_64-linux
)nix build github:awakesecurity/nixpkgs?ref=reproduce-expand-response-params#haskellPackages.termonad
See reproducing patch here: awakesecurity@97fde27
Expected behavior
@file
s should be restored after expanding if the original execution requested it.Notify maintainers
@vcunat @Ericson2314 @Synthetica9
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: