-
Notifications
You must be signed in to change notification settings - Fork 0
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
Better insulate stdenv #1
Comments
I discovered that this is most likely due to the following code: # The complete chain of package set builders, applied from top to bottom.
# stdenvOverlays must be last as it brings package forward from the
# previous bootstrapping phases which have already been overlayed.
toFix = lib.foldl' (lib.flip lib.extends) (self: {}) ([
stdenvBootstappingAndPlatforms
stdenvAdapters
trivialBuilders
splice
stdenvPackages
otherPackageSets
aliases
configOverrides
] ++ overlays ++ [
stdenvOverrides ]); The actual stdenv is really only defined in I'm in the process of rethinking stdenv and package set composition. |
I was playing with the idea of bootstrap tools being more complete, and thus requires less "nixification"/overlay magic to work. The other desire here is to reduce how much it takes to eval stdenv. As of writing, stdenv alone takes some 320 drvs/sources to compile:
By using the natures of FODs, we could lessen the coupling between stdenv and bootstrapping so that nix just needs to some stdenv polishing before being usable. |
I think the stdenv should be as small as possible. Is it even desirable to override the tools in stdenv? For the C compiler, it's quite easy to extract all the different versions in a separate repository (or a different package set (scope) in corepkgs). The coreutils and other tools that are also in stdenv might be more tricky to extract separately. Maybe this simply requires a slightly different approach to bootstrapping. I really like the elegance of the theory on bootstrapping in multiple stages. I might be able to combine this with my new scope composition idea to only touch stdenv in practice in the programming language adapter packages. From what I've seen so far, the bootstrap files include a C compiler, a subset of coreutils and patchelf. Is it even necessary to require anything else from the bootstrapper than these precompiled files and a working |
I think this has a pro/con of most of these tools can be curated similar to other packages, thus they don't need to be treated different when doing updates or reviews. The main downside is that it can be surprising when you get stdenv rebuild on something like
Yea, I would be fine with increasing the bootstrapping bundle size if it meant that it was more autonomous. The downside is that it will likely be harder to "create" stdenv's in general, so supporting many platforms will increase in difficulty. But mainly including https://github.com/ekala-project/stdenv/blob/master/generic/common-path.nix in the bootstrap tools, then they don't need to be separately added.
In principle yes, but there's also many costs. I'm not saying one is more strictly correct. But I am saying that I would like to investigate if pushing more into the bootstrap would have compounding benefits that are beyond what I mentioned already. |
I did not necessarily mean to change the bootstrap bundle, I don't think it should contain more than the minimal set of tools to bootstrap a c compiler. Adding more to the bootstrap bundle might improve rebuilds or development but will most likely not matter when the bootstrap results get cached.
I would like to see a decrease here as well. The current idea I'm experimenting with (which I think would be a good basis for the ekapkgs poly-repo approach) is to distinguish different scopes where recursion is allowed inside of a scope, but not across scopes. Choosing the scopes so that dependencies can be followed, intuitively improves both ease of maintenance and ease of contribution. For example, it is theoretically useless to put the result of a c compiler derivation in the same recursion scope as the scope that computes different python packages. Recursion for python packages is useful, but a c compiler should not depend on these python packages (recursively). I see a lot of benefits to a proper use of scopes that is uniform across all of ekapkgs. However, as a downside, A source of confusion and issues are override semantics for derivations. Do you have ideas for that? Do you have any intuition for how overrides should merge with the base derivation configuration? |
In downstream overlays, a lot of these packages can be freely overriden, causing non-obvious stdenv rebuilds. Might be nice to create a stdenv package set which has really slimmed downed nix expressions to just achieve stdenv and avoid being affected by downstream overlays
The text was updated successfully, but these errors were encountered: