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

release-notes: add autoPatchelfHookWithLibgcc, explain libgcc changes #232000

Closed
wants to merge 3 commits into from
Closed

release-notes: add autoPatchelfHookWithLibgcc, explain libgcc changes #232000

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented May 15, 2023

Description of changes

This PR contains two commits:

  1. Add autoPatchelfHookWithLibgcc, which is the "dammit just make it work" copypasta for people who get stung by the libgcc changes.
  2. Add (quite a bit of) text to the release notes to try to help out-of-tree Nix packages which are downstream of nixpkgs and encounter breakage due to the libgcc changes.

Closes #225963

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.

Adam Joseph added 2 commits May 15, 2023 00:24
This commit adds a variant of autoPatchelfHook which includes
`stdenv.cc.cc.libgcc` among the `propagatedBuildInputs`.

This was originally suggested by @vcunat here:

  #225963
This commit adds (quite a bit of) text to the release notes to try
to help out-of-tree Nix packages which are downstream of nixpkgs and
encounter breakage due to the libgcc changes.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation labels May 15, 2023
@ghost
Copy link
Author

ghost commented May 15, 2023

Note: I will be offline from sometime in the next few hours until after the end of the month.

Please don't hesitate to edit this PR aggressively if necessary. I'm unlikely to be able to respond to review comments before the release deadline.

@ghost ghost requested a review from RaitoBezarius May 15, 2023 08:07
@ghost ghost changed the title release-notes: explain libgcc changes release-notes: add autoPatchelfHookWithLibgcc, explain libgcc changes May 15, 2023
@ghost ghost requested a review from vcunat May 15, 2023 08:08
@ghost ghost added the 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign label May 15, 2023
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels May 15, 2023
@ncfavier
Copy link
Member

Pushed a fix to the NixOS manual.

By the way, why or null?

@ghost
Copy link
Author

ghost commented Jun 8, 2023

By the way, why or null?

Because stdenv.cc might not have a libgcc output. Two cases come to mind:

  1. Future: using a non-gcc compiler (clang?)
  2. Current: even our gcc does not always create a libgcc output. Here are the current conditions which cause its creation, but these may (and almost certainly will) change in the future.

@ghost
Copy link
Author

ghost commented Jun 8, 2023

Note: I will be offline from sometime in the next few hours until after the end of the month.

Please don't hesitate to edit this PR aggressively if necessary. I'm unlikely to be able to respond to review comments before the release deadline.

I'm back and pretty close to conquering my backlog. Not sure if this is still being considered for the release (would technically be a "backport" at this point), but I can respond to comments now.

@ncfavier
Copy link
Member

ncfavier commented Jun 8, 2023

Because stdenv.cc might not have a libgcc output.

Shouldn't compilation of things that depend on libgcc fail in those cases? (or is libgcc included by other means?)

@ghost
Copy link
Author

ghost commented Jul 12, 2023

There are many situations where stdenv.cc doesn't have a libgcc output:

  • pkgsStatic
  • cross-compilers to platforms which lack dynamic linkers (arm-none-eabi)
  • a hypothetical future non-gcc-based stdenv

Shouldn't compilation of things that depend on libgcc fail in those cases?

Unfortunately no. This is the big problem with libgcc. The glibc developers have decided to dlopen() it and not build with -lgcc, so the dependency is completely invisible to nixpkgs and patchelf. This is the root cause of all our troubles. Note that this is very similar to the headaches which led to /run/opengl-driver as well as NixOS's reliance on nscd. dlopen() simply doesn't align well with Nix's worldview.

@ghost ghost closed this Aug 6, 2023
@ghost ghost deleted the pr/autoPatchelfWithLibgcc branch August 6, 2023 05:00
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

autoPatchelfHook does not understand dlopen()
1 participant