Skip to content

stdenv: fix pkgsMusl#224947

Merged
lovesegfault merged 1 commit intostaging-nextfrom
unknown repository
Apr 6, 2023
Merged

stdenv: fix pkgsMusl#224947
lovesegfault merged 1 commit intostaging-nextfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 6, 2023

Description of changes

I broke pkgsMusl with #209870.

Something odd is happening with xgcc (the temporary compiler that should be used only to compile gcc, although we are using it to compile a temporary patchelf too) and libstdc++.

The temporary fix in this commit is to use -static-libstdc++ for the ephemeral patchelf built by xgcc. It isn't pretty, but it appears to work.

I'm starting to think we shouldn't even be trying to recompile patchelf until we build the final gcc. But that is too big of a change to be making this close to ZHF.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ghost ghost requested a review from trofi April 6, 2023 05:37
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Apr 6, 2023
@ghost ghost requested a review from alyssais April 6, 2023 05:37
@ghost ghost marked this pull request as ready for review April 6, 2023 06:08
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

pkgsMusl.stdenv builds for me with this commit. Let's see if ofborg agrees.

@ofborg build pkgsMusl.stdenv

@ghost ghost mentioned this pull request Apr 6, 2023
4 tasks
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

@trofi trofi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, wrong libstdc++ sounds problematic. static-libstdc++ should be fine as a short-term workaround.

@ofborg ofborg bot added 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 6, 2023
@alyssais
Copy link
Copy Markdown
Member

alyssais commented Apr 6, 2023

Is there any way we could get this to not cause any rebuilds for non-musl, so we can get it into staging-next? If we just merge this into staging now, we'll have a cycle where musl is completely broken. (We can then immediately remove any musl conditional we don't want to keep on staging, to keep the code clean.)

@alyssais alyssais added the 6.topic: musl Running or building packages with musl libc label Apr 6, 2023
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

Is there any way we could get this to not cause any rebuilds for non-musl, so we can get it into staging-next?

Let me see.

@ghost ghost marked this pull request as draft April 6, 2023 09:50
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

So it turns out this can be separated from #224945 , which is what causes the rebuilds.

Verifying that it still works...

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

@ofborg build pkgsMusl.stdenv

I broke `pkgsMusl` with #209870.

Something odd is happening with `xgcc` (the temporary compiler that
should be used only to compile `gcc`, although we are using it to
compile a temporary `patchelf` too) and `libstdc++`.

The temporary fix in this commit is to use `-static-libstdc++` for
the ephemeral `patchelf` built by `xgcc`.  It isn't pretty, but it
appears to work.

Incorporates:

- #224945
@ghost ghost changed the base branch from staging to staging-next April 6, 2023 10:22
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

@ghost ghost marked this pull request as ready for review April 6, 2023 10:22
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

@ghost ghost requested a review from alyssais April 6, 2023 10:23
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 6, 2023

Rebased to staging-next

@ofborg build pkgsMusl.stdenv

@alyssais
Copy link
Copy Markdown
Member

alyssais commented Apr 6, 2023

OfBorg looks like it had a networking hiccup on aarch64-linux, but I built pkgsMusl.stdenv successfully on the community builder.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. labels Apr 6, 2023
@ofborg ofborg bot added 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 6, 2023
@lovesegfault lovesegfault merged commit 41e3330 into NixOS:staging-next Apr 6, 2023
@ghost ghost deleted the pr/stdenv/unbreak-pkgsMusl branch April 6, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: musl Running or building packages with musl libc 6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants