-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
llvmPackages.libc: init at 20.0.0-unstable-2024-12-08 #363449
Conversation
91c39aa
to
44e5254
Compare
44e5254
to
c16e82d
Compare
c16e82d
to
50de490
Compare
The non-full variant doesn't seem to be used? |
As of this time, the overlay build isn't a dependency for anything. |
What is "the overlay build"? I don't see it explained anywhere here. |
The overlay build is the non full build of LLVM libc. |
What's the point of it? |
I asked the LLVM libc team on their Discord server:
|
What does "kinda borked" mean? |
The full build has some problems still needing to be worked out. There's some odd C++ errors preventing compiling. Overlay builds work. |
So then why add two attributes, one that works and one that doesn't? Why not just one libc attribute that builds as much as we can? Is this actually useful for anything yet? If not, maybe we should just wait until we can at least build it properly. |
I was recommended to have both as an option since it'll allow for flexibility if things are broken. I'm going to be working on fixing the full build soon, just haven't gotten time. I've got some PR's merged upstream and some other might've flown under my radar so it could be working. |
For flexibility, wouldn't a single attribute with an option we could flip be better? Otherwise, we'd have to change everything that referred to the attribute all at once if we wanted to go from full to overlay. |
My thinking was to probably have 3, two are the actual builds and one is an alias. I think other parts of LLVM does this already in nixpkgs. |
But if the full build is working, why would we ever need the alias? Why does it need an attribute too? |
We already have to set a boolean anyways for full builds. The dependencies are different too. Providing both makes it easier to test if both work and for people to experiment with. |
If full is building, why would I want to test with overlay? |
I was meaning people who write software using nix could try it out. I know some people who would want to try it out. |
Yes, but is there a reason they'd specifically want to test out the non-full version, even if full is available and building? |
ec43413
to
f1645ab
Compare
lib/systems/default.nix
Outdated
@@ -91,7 +91,7 @@ let | |||
&& final.parsed.kernel == platform.parsed.kernel; | |||
isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details"; | |||
# Derived meta-data | |||
useLLVM = final.isFreeBSD || final.isOpenBSD; | |||
useLLVM = final.isFreeBSD || final.isOpenBSD || final.isLLVMLibc; |
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.
OOC does it make sense to ever use LLVM libc with GCC?
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.
Hard to say based on whether GCC supports the naked attribute for specific targets. I was thinking the LLVM abi which means to use the libc that it'd make sense to use the entire toolchain. That's what the team upstream thinks as well.
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.
Certainly we'd want $arch-unknown-linux-llvm
to use both an LLVM toolchain and libc, but I'm not sure about pkgsLLVMLibc
— I think it's a bit surprising that it works differently from pkgsMusl and replaces the toolchain as well. Having it only change the libc would make it more composable (with #303849), and still allow getting to an LLVM toolchain+libc combination with pkgsLLVM.pkgsLLVMLibc.
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.
Yeah, I could drop the LLVM toolchain part once the composable PR lands. It won't work properly without 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.
Sounds good, except maybe then we should just wait for that PR to add this attr, so we don't make a breaking change to it later? It'll still be possible to use LLVM libc by calling Nixpkgs with the appropriate triple.
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 figured out pkgsLLVM.pkgsLLVMLibc
actually doesn't require the composable PR so it should eval right.
f1645ab
to
357295d
Compare
Eval failure |
357295d
to
41b1402
Compare
Eval should be fixed now |
Will likely merge this tomorrow, libunwind and libcxx don't quite work but there's possible fixes. The LLVM libc monthly meeting is tomorrow so I'm hoping to figure out how we can get those building. |
This might have broken the r-ryantm-updates bot? nix-community/infra#1676 |
cc @infinisil shouldn't this have been caught by CI? |
I was thinking the same thing now that you mention it, I'm not sure why CI didn't catch it. |
Might be a case of nix-community/infra#1180 Edit: Nope |
Things done
Adds LLVM libc, we've got the overlay building but full is still kinda borked. We're only going to support from >= LLVM 20 because it requires a lot of patching in previous versions. We're hoping the inclusion of LLVM libc at the point it is right now could help further its development and we can figure out how to package it better early on.
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.