make-binary-wrapper: add cc to propagatedBuildInputs#311794
make-binary-wrapper: add cc to propagatedBuildInputs#311794Ericson2314 merged 1 commit intoNixOS:stagingfrom
Conversation
|
Adding For some reason, I don't recall why, the FreeBSD native compiler will not work correctly without the setup hook. |
|
Sounds sensible to me. Can the commit message be updated with @artemist's explanation? |
Adding cc to propagatedBuildInputs makes derivations with makeBinaryWrapper in nativeBuildInputs run the cc-wrapper setup hook. This isn't an issue for derivations using stdenv, as the cc setup hook is already run by default. However, derivations that are made with stdenvNoCC, e.g. because they're made with runCommand, will not run the cc-wrapper setup hook without this change. For some reason the FreeBSD native compiler will not work correctly without the setup hook.
645a6db to
0c34636
Compare
|
This seems to be causing some weird side effects. pkgsMusl.systemd no longer builds: Given that this is a stdenv rebuild, and it seems unlikely to me that it's something specific about pkgsMusl.systemd that's broken, I think we need to revert this before it makes its way into the next staging cycle and is no longer changeable until the next one. |
|
I finally ran into the error which necessitated this change: while cross-building a perl-env for FreeBSD: This seems to be because perl's buildEnv explicitly includes makeBinaryWrapper but buildEnv uses runCommand (not runCommandCC). What should be the correct fix in this case? |
The "correct" solution to this problem (makeBinaryWrapper fails to be able to compile the binary wrapper when building a freebsd cross env) is that makeBinaryWrapper should propagate or embed a reference to the compiler. However, this causes build failures on musl, so this will have to do for now.
|
I think the issue with this is that the hardening disable flags are not done per platform like the other cc-/bintools-wrapper env vars. (I ran into this with OpenBSD.) |
The "correct" solution to this problem (makeBinaryWrapper fails to be able to compile the binary wrapper when building a freebsd cross env) is that makeBinaryWrapper should propagate or embed a reference to the compiler. However, this causes build failures on musl, so this will have to do for now.
This is required for stdenv on native FreeBSD.
Description of changes
part of #296581
This is an @artemist change. While I don't understand it myself, I recall her telling me that this was something that should have been included for linux as well but was just working anyway by chance. It is required for the native FreeBSD stdenv.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.