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

stdenv: fix pkgsMusl #224947

Merged
merged 1 commit into from Apr 6, 2023
Merged

stdenv: fix pkgsMusl #224947

merged 1 commit into from Apr 6, 2023

Conversation

ghost
Copy link

@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
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
Author

ghost commented Apr 6, 2023

Copy link
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.

@alyssais
Copy link
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
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
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
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
Author

ghost commented Apr 6, 2023

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

ghost commented Apr 6, 2023

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

ghost commented Apr 6, 2023

Rebased to staging-next

@ofborg build pkgsMusl.stdenv

@alyssais
Copy link
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 10.rebuild-linux: 1-10 and removed 10.rebuild-linux-stdenv This PR causes stdenv to rebuild labels Apr 6, 2023
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 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants