-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
stdenv-darwin: now with 50% less LLVM! #87583
Conversation
cc @LnL7 |
Nice work! |
This should probably be rebased against @ofborg eval |
Now against staging. |
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.
The goal here is to build all of the stdenv tooling from scratch without any references to the tools used to bootstrap it. Secondly some of the overrides are there to reduce the tree needed to do this, by default certain packages like sqlite would be included by python/cmake while they are not actually needed for example.
Assuming libxml2 from stage 3 and any other dependencies of that first llvm already don't have references anymore, then there shouldn't be any reason to build another one. If this is the case I wonder if we could even get rid of a stage.
Could you double check this?
$ nix-store -qR $(nix-build -A stdenv.__bootPackages.stdenv) | grep bootstrap
/nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools
/nix/store/vvk6w4jdwm5m5r1f6mlvqjx4p1lpmik8-bootstrap-stage4-binutils-wrapper-
/nix/store/xkl1gvhj841qq3m0abxlg9w06dpx11hh-bootstrap-stage4-clang-wrapper-
/nix/store/1rkmy85jsvqq9bnbcz4fwm246n4h9r3a-bootstrap-stage4-stdenv-darwin
$ nix-store -qR $(nix-build -A stdenv) | grep bootstrap
|
Is anything blocking this at this point? |
Nope- merged to staging. If you could be on alert for any breakages from this that would be good though. Occasionally staging-next will get stuck because we don’t know why something broke. |
Motivation for this change
On Darwin, stdenv was building LLVM twice, with the only difference being that one used a stage 3 libxml2 and the other used one from stage 4. Unless I'm missing something (which is quite possible!), there's no reason to do this, and we can save a bunch of build time by just using the one LLVM.
I tested this by building stdenv and using it to build GNU hello, and also checked to make sure bootstrap-tools didn't end up in stdenv's closure.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)