-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrapGAppsHook taints build environment with wrong/its stdenv #172249
Comments
This is a workaround for NixOS#172249. By re-exporting build tool envvars with full paths to the stdenv's tools, we can work around the tainted environment & PATH.
The problem seems to be that It was apparently added to fix issues on aarch64-darwin, though the error logs are gone. I'll try to reproduce the errors in a test PR. EDIT:
ping @bergkvist |
Seems like we're hitting #148189. Maybe we can add |
I remember I was stuck on that codesign_allocate error for some time while working on the fix for aarch64-darwin - and that adding cc to deps made the error go away. I don't think I dug much deeper into the underlying cause after that. |
Based on my tests, adding I'll make a PR soon. EDIT: #172366 |
Note that this had to be unfixed on aarch64-darwin for now: #174038 |
Describe the bug
Summary:
Including
wrapGAppsHook
in thenativeBuildInputs
of a derivation X that uses a non-standard stdenv (i.e.stdenv = gcc10Stdenv;
) taints derivation X's environment with the compiler that is used by (presumably)makeBinaryWrapper
, causing the wrong compiler to get used by the build.Hit this while trying to unbreak
palemoon
. Our default compiler right now is GCC11, which the packaged version of Pale Moon doesn't support.(For slightly complicated reasons, the Pale Moon version we have packaged isn't technically the latest version some of the online docs assume, but it is the recommended one. We could bump the package, but I'd rather wait until the next good version is released. See #165221 for more details.)
Since the packaged version is only compatible with up to GCC10, I tried to change the
all-packages.nix
entry toThis makes the Nix-level asserts pass (which check
stdenv.cc.version
for license compliance reasons), but the compiler the build actually ends up using is GCC11, which leads to a failed build.78 0:04.10(B checking for the target C compiler... /nix/store/bg35nfwn6zd616facdywiysgpprfvsji-gcc-wrapper-11.3.0/bin/gcc
Turns out that the culprit is
wrapGAppsHook
which seems to insert its GCC before the desired stdenv's GCC.which -a gcc
insidepalemoon
'spostPatch
returns:Steps To Reproduce
A minimal reproducer (on a checkout of eb935d1):
Yields the expected output.
Uncommenting the
nativeBuildInputs
yields:I'll push an expected-to-work PR for
palemoon
shortly, which would be a more complicated reproducer of this.Expected behavior
Builds should use the compiler they are told to use.
Screenshots
Additional context
It looks like
wrapGAppsHook
was recently migrated to the newmakeBinaryWrapper
via #164163. That seems like the most likely culprit to me.Notify maintainers
CC @ncfavier (author of #164163)
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: