-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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-bootstrap: component packages for bootstrap-tools
#260193
base: master
Are you sure you want to change the base?
Conversation
Very cool. Some of this looks a decent amount simpler e.g. binutils vs binutils-static. Thoughts are do we need to keep the non-static version? or are these sufficiently divergent that we can't do an |
The main pain point i've found with doing something like an |
cool cool. any thoughts on dropping some of the non-static copies that aren't used? |
Yeah I agree it would be good to drop the non-static versions of things if possible. Also the current (non-mimimal, not your work) bootstrap tools design of throwing everything together in one FHS tree is bad and we should break with it. |
It is not yet good enough for GCC. If we can make it better and a stronger split rather than try to understand what is there, that is good with me. |
This is good feedback and something that could use better clarity. The |
So you are saying regardless of the naming we currently need all these duplicated package definitions for the next round of bootstrapping? |
Indeed, to provide a stronger assurance that minimal-bootstrap can be a self-contained abstraction and that the tools provided as the interface don't leak any unexpected behaviour/bugs. Would love to take ideas for alternate names or ways to organise the files so that the intent is clearer |
pname = "coreutils-static"; | ||
version = "9.4"; | ||
|
||
src = fetchurl { | ||
url = "mirror://gnu/coreutils/coreutils-${version}.tar.gz"; | ||
hash = "sha256-X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; | ||
}; |
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.
Can this be deduped with the musl variant?
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.
There's a motivation to prevent dependency cycles and rebuild loops, and favouring simpler code over deduplication. Important to the "trust" factor will be the the ability for bootstrap to be readable and understandable by end users who wish to, and duplicating code so as to not need to jump between files helps with that I think.
Hope this explanation makes sense? It's something that I need to write up as part of the documentation deliverable for the STF fund.
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.
There's a motivation to prevent dependency cycles and rebuild loops, and favouring simpler code over deduplication.
Per what I wrote in #260193 (comment), I rather have duplication than simpler code.
My guess is that code I wrote was getting within @emilytrau's way, which is understandable. So I think it would be good if newer deduplication we had was driven by @emilytrau so the burden of untangling on first readthrough will be on the rest of us, not her.
In previous PRs I was saying this can wait to the end, but now I that we are getting nearer a combinatorial explosion of stuff, I am getting wary about continuing to wait.
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.
FWIW I think we can do better than the rest of Nixpkgs by preferring Nix-language-level than shell-level abstractions. The benefit is then the final produced code that is in the derivation (try nix derivation show | jq ...
) will have all those abstractions removed, and what is left is simple (but verbose) commands! Best of both worlds!
# Patch | ||
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches} |
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 not sure how much this is in scope but maybe applying patches would be a candidate to move into some wrapper around runCommand to reduce duplication?
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 a code style choice where we don't create abstractions over the run command semantics so that it can be easily understood when reading the code
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 would rather have simple forest and complex trees, than simple trees and complex forest, if that makes sense.
If you do anything at all, no matter how baroque, to deduplicate these packages, I will probably prefer it. I find it easier to read.
pkgs/os-specific/linux/minimal-bootstrap/linux-headers/default.nix
Outdated
Show resolved
Hide resolved
26bc4a9
to
20be577
Compare
Congratulations on getting near the finish line! Maybe an English nitpick, but is there a proof somewhere that no lesser bootstrap is possible? That's what minimal means (an element of a partial order such that any other element less-than-or-equal-to it is equal to it). I think you might have meant minimalist or minimized or something else. I didn't bring this up earlier since until now there appeared to be more pressing problems, but it looks like those have all been conquered! I only point it out because, although this is quite an achievement, the entire If we were to someday have a bootstrap starting from only a scheme/forth interpreter written in hex0, would that be |
You could also argue that this simply means the minimal bootstrap upstreamed in nixpkgs. |
@emilytrau -- would you mind if I restarted some work here? |
@philiptaron please and thank you |
Description of changes
Packages many components of
bootstrap-tools
as statically linked binaries. The only missing tool is agcc
that targetsglibc
, I'm still working on understanding how compiler/libc split works 😅Related #227914
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)