Skip to content
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

pkgsCross.gnu64.stdenv fails to build on x86_64-linux #243176

Closed
uri-canva opened this issue Jul 13, 2023 · 5 comments
Closed

pkgsCross.gnu64.stdenv fails to build on x86_64-linux #243176

uri-canva opened this issue Jul 13, 2023 · 5 comments
Labels
0.kind: bug Something is broken

Comments

@uri-canva
Copy link
Contributor

error: builder for '/nix/store/h1mi656mpg23rj5d7kv4z3alwzgrf3wj-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0.drv' failed with exit code 1;
       last 10 log lines:
       > /nix/store/c2bq8xsayc90s33fd5xbm1vh5lrmwcfq-coreutils-9.3/bin/install -c -m 644 unwind.h /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0/include
       > /nix/store/51sszqz1d9kpx480scb1vllc00kxlx79-bash-5.2-p15/bin/bash ../../../gcc-12.3.0/libgcc/../mkinstalldirs /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0/include
       > /nix/store/c2bq8xsayc90s33fd5xbm1vh5lrmwcfq-coreutils-9.3/bin/install -c -m 644 ../../../gcc-12.3.0/libgcc/gcov.h /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0/include
       > make[1]: Leaving directory '/build/build/x86_64-unknown-linux-gnu/libgcc'
       > Moving /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/x86_64-unknown-linux-gnu/lib/libgcc_s.so to /nix/store/1sc78iyqi0bx2a2dbba2h6jycj58p2hh-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0-lib/x86_64-unknown-linux-gnu/lib/libgcc_s.so
       > Moving /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/x86_64-unknown-linux-gnu/lib/libgcc_s.so.1 to /nix/store/1sc78iyqi0bx2a2dbba2h6jycj58p2hh-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0-lib/x86_64-unknown-linux-gnu/lib/libgcc_s.so.1
       > Removing empty /nix/store/i4zdpqis141x9i5y6iylpq3ddvy79ng8-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0/x86_64-unknown-linux-gnu/lib/ and (possibly) its parents
       > /nix/store/qr60k7sz61hvv2baadlfv5qjr8q7vlg6-builder.sh: line 243: type: install_name_tool: not found
       > preFixupLibGccPhase
       > mv: cannot stat '/nix/store/1sc78iyqi0bx2a2dbba2h6jycj58p2hh-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0-lib/lib/libgcc_s.so': No such file or directory
       For full logs, run 'nix-store -l /nix/store/h1mi656mpg23rj5d7kv4z3alwzgrf3wj-x86_64-unknown-linux-gnu-stage-static-gcc-12.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/927jr7zwi4ll0y8d4g1dfx6s7syq5a7h-glibc-x86_64-unknown-linux-gnu-2.37-8.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2rfx2h31jbsld7p8v3r2c8q7ha39vmqw-x86_64-unknown-linux-gnu-stage-final-gcc-wrapper-12.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7rm333lrks2j5r2hy4dy3g0bxghmn4jz-stdenv-linux.drv' failed to build

Broken by #238154.

@ghost
Copy link

ghost commented Jul 13, 2023

⚠️ Note: this wasn't working even before #238154. ⚠️

Nixpkgs gcc expression has a lot of problems, and has always had a lot of problems, when hostPlatform.config == buildPlatform.config but hostPlatform != buildPlatform.

gcc is designed to make install differently when the two config values are equal, because it's designed for an FHS universe where there is only one /usr. So it has to be careful not to overwrite the hostPlatform libraries when it installs the buildPlatform libraries.

Nixpkgs doesn't have this problem, and we generally want stuff in $lib, not $lib/${targetConfig}/lib. But it's a game of whack-a-mole with gcc's Makefiles because "what upstream wants" is and always will be "what most distros do" -- which isn't what we do.

Please be patient.

Right now, touching anything in builder.sh causes a full stdenv rebuild, meaning a weeks-long PR cycle through staging. This friction is why our gcc expression is in such a sorry state of disrepair. Nobody wants to work on it when it's so fragile and cumbersome.

#237856 will take us a long way towards making it easier to fix these kinds of bugs, without a stdenv rebuild, and without having to go through staging. Please be patient and wait a bit, so I can fix this problem the easy way once that's done, instead of having to fix it the really really hard and painful way right this instant.

If you're in urgent need of a fix, try disabling link-time optimization (enableLTO=false).

@ghost ghost self-assigned this Jul 13, 2023
@uri-canva
Copy link
Contributor Author

Exciting! Will that link up with some of the work being done for #87909? Looking forward to it!

@ghost
Copy link

ghost commented Jul 13, 2023

Exciting! Will that link up with some of the work being done for #87909?

I am very much in favor of that PR. If we can get consensus around it being a good idea (which I think it is) then I will certainly implement it.

Also: once I fix this I will add pkgsCross.gnu64.stdenv to pkgs.tests.cross.sanity so this doesn't happen again:

@dongcarl
Copy link
Contributor

Has there been more progress on this? Does this work on -unstable now?

@ghost
Copy link

ghost commented Nov 4, 2023

Fixed by

@ghost ghost closed this as completed Nov 4, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants