-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
rustc: fix pkgsLLVM #429745
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
base: master
Are you sure you want to change the base?
rustc: fix pkgsLLVM #429745
Conversation
I committed and tested commit 15470fe, and the build was successful without setting the rpath. |
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.
We don't need to set set the rpath here if we correct #320432 (comment).
We can also remove the fake libgcc here since it was already added in #330037.
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.
Done
22cc1a3
to
530378f
Compare
@@ -101,7 +101,9 @@ stdenv.mkDerivation (finalAttrs: { | |||
(stdenv.hostPlatform.isLinux && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD && useLLVM) | |||
"--push-state --as-needed -L${llvmPackages.libcxx}/lib -lc++ -lc++abi -lLLVM-${lib.versions.major llvmPackages.llvm.version} --pop-state" | |||
++ optional (stdenv.hostPlatform.isDarwin && !withBundledLLVM) "-lc++ -lc++abi" | |||
++ optional stdenv.hostPlatform.isFreeBSD "-rpath ${llvmPackages.libunwind}/lib" | |||
++ optional ( | |||
with stdenv.hostPlatform; isFreeBSD || (isLinux && useLLVM && !withBundledLLVM) |
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.
Why not just check useLLVM though? If it's needed on both Linux and FreeBSD, it's probably not OS-specific, right?
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.
Probably but what if someone sets useLLVM
to false on FreeBSD? Or how does setting withBundledLLVM
on BSD change things?
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.
@rhelmot WDYT?
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 really sorry I haven't had time to look into this. If I'm the only blocker, please merge it and I'll un-break FreeBSD when I get back to it.
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.
Then let's be optimistic, and just set it to useLLVM && !withBundledLLVM
.
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.
Done
@RossComputerGuy @alyssais It would be great to get this merged, because it blocks kernel builds on pkgsLLVM. |
530378f
to
42ddf94
Compare
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.
Can the commit message please explain why each of these changes is being made?
42ddf94
to
2691fcc
Compare
Done |
It doesn't really explain why still, just what changes are happening, which I can see from the diff. Why is each of these changes the correct thing to do? |
Idk how to explain why, it just does. |
I don't think it should be necessary to do any of this I get the strong impression that there is something buggy with how the toolchain is wired up in I am worried about adding to these hacks if we can't explain them, because when we start to move these yo principled toolchain conditions they will start to apply to Darwin and we will need to explain what they are actually conditioning on. I think there needs to be more work put into figuring out what the underlying problem with |
Because when rust is a dependency, it comes from I did find an easier solution to the |
If |
No because it's linking from something like |
@@ -101,7 +101,7 @@ stdenv.mkDerivation (finalAttrs: { | |||
(stdenv.hostPlatform.isLinux && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD && useLLVM) | |||
"--push-state --as-needed -L${llvmPackages.libcxx}/lib -lc++ -lc++abi -lLLVM-${lib.versions.major llvmPackages.llvm.version} --pop-state" | |||
++ optional (stdenv.hostPlatform.isDarwin && !withBundledLLVM) "-lc++ -lc++abi" | |||
++ optional stdenv.hostPlatform.isFreeBSD "-rpath ${llvmPackages.libunwind}/lib" | |||
++ optional (useLLVM && !withBundledLLVM) "-rpath ${llvmPackages.libunwind}/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.
In FreeBSD, we can try adding LLVM libunwind to buildInputs instead of setting rpath here. If moving libunwind to buildInputs works, we can remove it.
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.
Done
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5785 |
I really don't think this is ready for review… It's blocked by a change request, and we're still waiting to find out why it works. |
I thought we already knew the why:
|
Well last time I asked, I got "Idk how to explain why, it just does.", and the discussion since didn't seem particularly conclusive, still none of that information is in the commit message, and Emily's further probing on Matrix from earlier is still unresponded to, so I'm not sure how the reviewability is supposed to have changed here. |
When was that? It might've been when I was at work or asleep. |
2691fcc
to
94540df
Compare
Updated the commit message |
https://matrix.to/#/!kxOJEqURGkuOHTRRQB:matrix.org/$jfJfEVIbG_BXOxjKQw4CMiQfwVWRVdrZrGkt_CVnCjk?via=matrix.org&via=nixos.dev&via=tchncs.de (it pinged you) |
We add Other than that, it seems like this is likely downstream of either or both of issues wiring up ccForBuild = ccPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
cxxForBuild = cxxPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
ccForHost = ccPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
cxxForHost = cxxPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
ccForTarget = ccPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
cxxForTarget = cxxPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv; |
|
94540df
to
b300c0a
Compare
Rebased messed up |
c0f3aec
to
7a4a629
Compare
Managed to do some testing and the funky |
7a4a629
to
6119905
Compare
Fixes `libunwind` from not being included due to improper usage of `lib.optional` by passing a list instead of a single item. Drops the hack for `llvmPackages` since just passing it through works now.
6119905
to
37c2603
Compare
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.
Great to see the hacks going away, thank you!
Things done
Fixes #311930
Works on aarch64-linux after stacking #409265
passthru.tests
.nixpkgs-review
on this PR. See nixpkgs-review usage../result/bin/
.Add a 👍 reaction to pull requests you find important.