gcc: link $lib/lib -> $lib/$targetConfig correctly and consistently#296219
gcc: link $lib/lib -> $lib/$targetConfig correctly and consistently#296219ConnorBaker merged 1 commit intoNixOS:stagingfrom
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`.
sternenseemann
left a comment
There was a problem hiding this comment.
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.
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 |
|
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 = relaxedsandbox = truenix-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.