-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
gcc: link $lib/lib -> $lib/$targetConfig correctly and consistently #296219
gcc: link $lib/lib -> $lib/$targetConfig correctly and consistently #296219
Conversation
When native-compiling, gcc will install libraries into: /nix/store/...-$targetConfig-gcc-$version-lib/lib When cross-compiling, gcc will install libraries into: /nix/store/...-$targetConfig-gcc-$version-lib/$targetConfig When cross-compiling, we intended to create a link from $lib/lib to $lib/$targetConfig, so that downstream users can always safely assume that "${lib.getLib stdenv.cc.cc}/lib" is where the gcc libraries are, regardless of whether `stdenv.cc.cc` is a cross compiler or a native compiler. Unfortunately, there were two problems with how we were trying to create these links: 1. The link would be created only when `enableLibGccOutput==true` 2. The link was being created from the incorrect source `$lib/lib/lib` instead of `$lib/lib`. Both of these mistakes are my fault. This commit corrects them by creating the link using `ln -Ts` (which is more predictable) and by creating the link from `gcc/common/builder.nix` rather than from `gcc/common/libgcc.nix`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symlink is correct this time!
# symlink), this ensures that in every case we can assume that | ||
# $lib/lib contains the .so files | ||
lib.optionalString (with stdenv; targetPlatform.config != hostPlatform.config) '' | ||
ln -Ts "''${!outputLib}/''${targetConfig}/lib" $lib/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to come up with any adverse side-effects...
I imagine that without this PR we can use some kind of buildEnv
/symlinkJoin
to generate FHS prefixes with cross-compilation tools that would somehow approximate what you get with ubuntu-like distributions?..
All in all, I don't see any reason not to merge this, but I lack familiarity with wrapper
I think darwin tests hadn't finished? |
@SomeoneSerge any idea if there's an easy way to see the actions that were triggered by a PR (meaning, can I see if the action is still running or if it has failed for this PR)? Failing that when I get home I can try doing a |
Maybe https://github.com/NixOS/nixpkgs/pull/296219/checks?check_run_id=22722654479 and the adjacent ones |
I don't know how I missed the tab labeled Checks... |
Note
This PR is a re-upload of #282236 (part of #284796)
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.