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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdenv: cleanup darwin bootstrapping #43561
Conversation
# Hack to make sure we don't link ncurses in bootstrap tools. The proper | ||
# solution is to avoid passing -L/nix-store/...-bootstrap-tools/lib, | ||
# quite a sledgehammer just to get the C runtime. | ||
gettext = super.gettext.overrideAttrs (old: { |
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.
@Ericson2314 why was it composed like this?
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.
You mean not part of persistent
? I gather to separate concerns: we aren't "persisting" anything with this override.
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.
Did I do this? I kind of like it the way it was, now that I figure out what's going on :)
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec { | |||
LDFLAGS = optionalString (!stdenv.isDarwin) "-lgcc_s"; | |||
NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; | |||
|
|||
buildInputs = optionals stdenv.isDarwin [ CF configd ]; |
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.
What were these for? I think the other interpreters still have these.
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.
Not sure about configd but that's probably optional since it was already disabled. As for CF, the darwin bootstrap-tools include CoreFoundation so that's used while building the stdenv itself.
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.
So we can probably remove them from the other cpythons? I bet it was just copy pasted from this one - someone not realizing that only 2.7 is used in bootstrapping.
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.
Please do it in a separate commit, but within this PR.
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.
No, we can't make packages from the final set depend on bootstrap tools. I'll add a comment to the expression explaining what's going on.
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.
Okay, it might be clearer to leave these in but just null them out in stdenv/darwin/default.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.
I am still a little confused on why this is needed. Packages don't usually depend on CF or configd. Doesn't the stdenv provide a version that non-boot cpython can pick up?
Failure on x86_64-darwin (full log) Attempted: stdenv Partial log (click to expand)
|
@@ -188,7 +188,15 @@ in rec { | |||
}; | |||
|
|||
stage1 = prevStage: let | |||
persistent = _: super: { python = super.python.override { configd = null; }; }; | |||
persistent = self: super: with prevStage; { | |||
cmake = super.cmake.override { |
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.
Could you verify that this still works on cross? I can't remember the exact reason but we had to do super.buildPackages.cmake
to avoid cross compilation issues.
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 don't fully understand what buildPackages implies in this context.
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.
This is fine @matthewbauer because the bootstrapping is explicitly native. We don't need to worry about persisting things with a target platform in the final stage, as if the host platform changes stdenv overrides are already chucked out. cmake
has no target platform, and this is also an early stage platform, so we are good.
@@ -281,6 +292,15 @@ in rec { | |||
ncurses libffi zlib gmp pcre gnugrep | |||
coreutils findutils diffutils patchutils; | |||
|
|||
# Hack to make sure we don't link ncurses in bootstrap tools. The proper | |||
# solution is to avoid passing -L/nix-store/...-bootstrap-tools/lib, | |||
# quite a sledgehammer just to get the C runtime. |
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.
Yes eventually let's change bootstrap tools to keep builds separate rather than going FHS for no reason whatsoever!
Also gets rid of the full python and some of it's dependencies in the stdenv build closure.
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Attempted: stdenv Partial log (click to expand)
|
Great work! |
Motivation for this change
I finally spent some time to clean this up. 馃槃
Also gets rid of the full python and some of it's dependencies in the stdenv build closure.
db, gdbm, openssl, readline, sqlite and python2 no longer cause an stdenv rebuild.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)