minimal-bootstrap: Hook up with stdenv#479322
Conversation
c9d1c3b to
d471874
Compare
d471874 to
ae9fd4a
Compare
699b700 to
e0cd0e3
Compare
e0cd0e3 to
c39cdb6
Compare
c39cdb6 to
5787f79
Compare
5787f79 to
b166aeb
Compare
| } | ||
| else | ||
| throw "Musl libc only supports 64-bit Linux systems."; | ||
| throw "Musl libc only supports 64-bit Linux systems, and i686-linux."; |
There was a problem hiding this comment.
Perl seems to be broken on i686-linux-musl. But maybe it could be worth working towards support for this platform?
There was a problem hiding this comment.
I was able to build pkgsCross.musl32.perl , is it broken?
There was a problem hiding this comment.
Ah, it seems to work on cross. But through pkgsMusl.pkgsi686Linux, I didn't manage to build stdenv. I will try again now with the new staging, in case it makes a difference.
|
note: this is from my run without the change, I'm confirming that the changes work now.
|
|
Above commit fixes building the 4 failing tests from my nixpkgs-review run, however it and several other tests from this set fail. |
|
Thanks a lot! I'll try and look into this. |
|
I believe the test previously passed because bootstrapTools had all tools in the same |
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/introducing-determinate-secure-packages/74300/6 |
Pandapip1
left a comment
There was a problem hiding this comment.
Nitpick: I see ${earlyBash}/bin/bash is used in several places. Is there a reason meta.mainProgram isn't set in pkgs/os-specific/linux/minimal-bootstrap/bash/common.nix and the usage replaced with lib.getExe earlyBash?
9af441a to
adce18e
Compare
Thanks, this makes sense. I've updated the usage in the last commit for this. |
Pandapip1
left a comment
There was a problem hiding this comment.
Looks like a few got missed
| preHook = '' | ||
| # Don't patch #!/interpreter because it leads to retained | ||
| # dependencies on the bootstrapTools in the final stdenv. | ||
| dontPatchShebangs=1 | ||
| ${commonPreHook} | ||
| ''; | ||
| shell = "${bootstrapTools}/bin/bash"; | ||
| initialPath = [ bootstrapTools ]; | ||
| shell = "${stage0.bash}/bin/bash"; |
There was a problem hiding this comment.
| shell = "${stage0.bash}/bin/bash"; | |
| shell = lib.getExe stage0.bash; |
There was a problem hiding this comment.
Hmm, this is interesting. We have to be careful with stage0.bash: for instance on *-darwin and aarch64-linux, this package is actually just bootstrapTools, which also contains coreutils, diffutils and various other binaries, alongside bash.
There was a problem hiding this comment.
How about
| shell = "${stage0.bash}/bin/bash"; | |
| shell = lib.getExe' stage0.bash "bash"; |
That being said, it probably makes sense for whatever defines stage0.bash to at the very least override the mainProgram to bash with lib.overrideDerivation
There was a problem hiding this comment.
Yes, we should not set meta.mainProgram in that derivation, and we should use lib.getExe' stage0.bash "bash" for any user affected by this.
There was a problem hiding this comment.
Maybe stage0.bash should override its own meta.mainProgram. That's e.g. what the netcat package does.
| @@ -407,7 +351,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check | |||
| # Historically, the wrapper didn't use runtimeShell, so the used shell had to be changed explicitly | |||
| # (or stdenvNoCC.shell would be used) which happened in stage4. | |||
| binutils = super.binutils.override { | |||
| runtimeShell = "${bootstrapTools}/bin/bash"; | |||
| runtimeShell = "${stage0.bash}/bin/bash"; | |||
There was a problem hiding this comment.
| runtimeShell = "${stage0.bash}/bin/bash"; | |
| runtimeShell = lib.getExe stage0.bash; |
| PATH = "${pkgs.strace}/bin:${stdenv.bootstrapTools}/bin"; | ||
| initialPath = [ | ||
| stdenv.bootstrapTools | ||
| builder = "${initialBash}/bin/bash"; |
There was a problem hiding this comment.
| builder = "${initialBash}/bin/bash"; | |
| builder = lib.getExe initialBash; |
| make-symlinks-relative = | ||
| (derivation { | ||
| name = "test-make-symlinks-relative"; | ||
| system = stdenv.system; | ||
| builder = "${bootstrapTools}/bin/bash"; | ||
| initialPath = "${bootstrapTools}"; | ||
| builder = "${initialBash}/bin/bash"; |
There was a problem hiding this comment.
| builder = "${initialBash}/bin/bash"; | |
| builder = lib.getExe initialBash; |
adce18e to
3b2053b
Compare
|
I'm going to do a build overnight of the stdenv tests. What attributes, other than the ones you've already tested, would be good to look at? |
|
Everything came up roses. Time for merge. |
|
Thank you, philip! |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/a-full-source-bootstrap-for-nixos/74801/4 |
|
I've bisected, and this PR seems to have caused a meaningful regression in eval stats. These are the stats from before this PR for evaluating {
"cpuTime": 0.18691299855709076,
"envs": {
"bytes": 3404768,
"elements": 237289,
"number": 188307
},
"gc": {
"cycles": 1,
"heapSize": 402915328,
"totalBytes": 40377200
},
"list": {
"bytes": 491928,
"concats": 2895,
"elements": 61491
},
"nrAvoided": 210007,
"nrExprs": 100441,
"nrFunctionCalls": 176146,
"nrLookups": 99160,
"nrOpUpdateValuesCopied": 1046448,
"nrOpUpdates": 13566,
"nrPrimOpCalls": 87447,
"nrThunks": 204223,
"sets": {
"bytes": 23685976,
"elements": 1440982,
"number": 26261
},
"sizes": {
"Attr": 16,
"Bindings": 24,
"Env": 8,
"Value": 16
},
"symbols": {
"bytes": 379841,
"number": 40460
},
"time": {
"cpu": 0.18691299855709076,
"gc": 0.003,
"gcFraction": 0.016050248100234074
},
"values": {
"bytes": 9913600,
"number": 619600
}
}And after: {
"cpuTime": 0.23173899948596954,
"envs": {
"bytes": 4403392,
"elements": 309401,
"number": 241023
},
"gc": {
"cycles": 1,
"heapSize": 402915328,
"totalBytes": 47616448
},
"list": {
"bytes": 680344,
"concats": 3408,
"elements": 85043
},
"nrAvoided": 282334,
"nrExprs": 111836,
"nrFunctionCalls": 222780,
"nrLookups": 131452,
"nrOpUpdateValuesCopied": 1081021,
"nrOpUpdates": 31391,
"nrPrimOpCalls": 109830,
"nrThunks": 266123,
"sets": {
"bytes": 25548440,
"elements": 1521326,
"number": 50301
},
"sizes": {
"Attr": 16,
"Bindings": 24,
"Env": 8,
"Value": 16
},
"symbols": {
"bytes": 381967,
"number": 40657
},
"time": {
"cpu": 0.23173899948596954,
"gc": 0.003,
"gcFraction": 0.012945598309539749
},
"values": {
"bytes": 11084448,
"number": 692778
}
}While I'm certainly a fan of minimal bootstrapping, I'd appreciate if some effort could be put in to minimize this regression. Anecdotally, this has caused an ~25% regression to the eval times of my personal package set, which I expect to be representative of the penalty at scale. |
This PR builds upon #459002 to bootstrap x86_64-linux and i686-linux glibc and musl stdenvs from the minimal hex0 seed.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.stdenv.bootstrapToolsis removed on affected platforms?Add a 👍 reaction to pull requests you find important.