-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
Minimal/bootstrappable Linux stdenv #123095
Comments
This is by no means complete, but I have been able to build several of the base tools for live-bootstrap using Nix, see https://github.com/siraben/mes-overlay/tree/master/pkgs |
A good reason to do this too is that a smaller bootstrap seed could be stored in nixpkgs itself instead of requiring someone (presumably with special permissions) to host a new binary bootstrap tarball. |
Here are few risks:
|
The same project also has the ARM bootstrap WIP, see for instance the seeds.
Indeed, this just for Linux bootstrap, but shouldn't affect the others much, since we separate stdenvs anyway.
The bootstrappable people put a lot of emphasis on reproducibility for their stages (up to and not including GCC), so I think this would help. EDIT: for now, only the x86-linux bootstrap is demonstrably mature enough to be a viable replacement for our current tarball |
Right no even x86-linux bootstrap in live-bootstrap project is probably not mature enough, but it's getting there. Other arches are indeed less advanced. But that's probably not important, can do each arch separately. And there are two choices:
|
If anybody interested, i had my own take on doing this (this is not production ready code, just an experiment) - we can build at least until M2-planet - without using stdenv/bash from host, just by using kaem-optional-seed as builder, generate script for it using nix and go from there. See results and raw derivation Problems are:
From there - we have derivation which produces executables which can:
nix can be used to generate different flavors of kaem scripts for each of arch. For me questions are:
Reading materials:
|
There is some progress. https://www.freelists.org/post/bootstrappable/GNU-Mes-024-released See also this effort: https://github.com/andrewchambers/trusting-trust/ That was discussed in https://matrix.to/#/#bootstrappable:libera.chat Very exciting stuff! |
A cheap way for us to achieve a verifiable bootstrap seed would be to use GUIX to generate it. That might be less work than implementing full source bootstrap in nixpkgs. It can be replaced later. This seem to be used to generate the bootstrap-tools in bootstrap-files/x86_64.nix. Do you think that would make sense or should we just implement full source bootstrap as GUIX does? It would be great to see some progress here! |
Guix SD has achieved full source bootstrapping: https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/ |
For those reading this issue, check out the PRs linked in #227914 to see what packages have been added via the minimal bootstrap. Great progress so far, with expansion to other platforms planned! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/aux-foundational-packages/46707/4 |
Has anyone looked into bootstrapping nixpkgs using zig? Sure, tarball would not be small enough to be committed into the repository but I feel like that would be a good solution all around, and it would not involve creating so many derivations to get a basic compiler |
Well the initial post of the issue covers that. We could live with a large bootstrap tarball containing a relatively modern copy of gcc/clang/zig but that's then what we have to trust completely. The objective is to have an auditable bootstrap from the smallest and most understandable binary blob. The bootstrap process from |
Motivation
Currently, NixOS relies on a 130 MB (uncompressed) bootstrap for x86_64-linux. Thus, there is quite a big trusted computing base. With years of effort accumulated in projects such as live-bootstrap, it appears feasible to replace the Linux stdenv with a far smaller base of around 1 KB, while retaining the latest versions of autotools, bash, gcc and so on to bootstrap the rest of Nixpkgs.
See also bootstrap seed reduction carried out in Guix[0].
References
[0] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25/
The text was updated successfully, but these errors were encountered: