Move stdenvCross and customStdenv to pkgs/stdenv#20108
Move stdenvCross and customStdenv to pkgs/stdenv#20108Ericson2314 merged 6 commits intoNixOS:masterfrom
Conversation
|
@Ericson2314, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nbp to be a potential reviewer. |
pkgs/top-level/default.nix
Outdated
There was a problem hiding this comment.
Indenting by 6 spaces without lining up to something seems odd.
There was a problem hiding this comment.
Hmm it's supposed to be beginning of res + 2, but that does look odd. Seeing that
let # note newline
foo = ...;
bar = ...;would be IMO proper style for multiple lets, I'll just unindent back to two from let.
|
Besides my minor indentation complaint, it looks good to me. You are basically cleaning up the arguments that are given to the top-level stdenv.nix and all-packages.nix. EDIT: The pull request has changed dramatically since I made this comment and I have not had time to review it fully. |
[Trying my best to indent properly while avoiding excessive drift]
007c302 to
eed34bd
Compare
|
@DavidEGrayson so while you definitely want to rebase on this, you probably also should rebase on top of #15043 To make all that less of a pain I rebased my bitrotted rebase of vcunat's stdenv on |
|
I kind of like |
|
@nbp in the follow up PR they completely diverge https://github.com/NixOS/nixpkgs/pull/15043/files#diff-69df24a05ec3d577cb638113e9837ae1R49; during development (as 1 big PR) the |
|
I actually think |
|
I'm working on maybe moving some commits from the original (now followup) PR to this, to motivate (either way, i debug them so no loss). The @vcunat stuff may be needed just to get things working again, but that may swing things in the direction of leave this as is to not over-complicate with semantic change. |
|
Ok, added more commits from the original PR because I believe I figured out how to preserve exact semantics, yay! |
|
@DavidEGrayson thanks for your test script, it gives me much more confidence in this :). I still recommend looking at the my |
|
I'm glad you found it useful! |
|
Do you have a moment for IRC? |
|
|
336e22a to
f822985
Compare
|
@nbp ok now this is actually ready to go! all the stdenv combinations have been tested. And yes...I did fine a bug in in |
nbp
left a comment
There was a problem hiding this comment.
Fix the nits, and I would be ok for merging.
The allowCustomOverrides attribute is added as argument of the top-level of nixpkgs set computation to compensate from the fact that the stdenv replacement and the stdenvCross do benefit from the overridden configuration provided by the user, as opposed to the bootstrapping stdenv.
pkgs/stdenv/cross/default.nix
Outdated
pkgs/stdenv/cross/default.nix
Outdated
There was a problem hiding this comment.
Do not use with, to prevent issues caused by adding names such as vanillaStdenv & crossSystem at the top-level of nixpkgs set, or from the config override.
pkgs/stdenv/cross/default.nix
Outdated
There was a problem hiding this comment.
This is working, because the derivation used to build the stdenvCross are in fact using forceNativeDrv to use the nativeDrv attribute of the resulting derivation build with vanillaStdenv (second argument of makeStdenvCross) So technically you could use the same buildPackages as used in custom.nix.
I think you can fix this comment for now, and make a follow-up patch for that after.
There was a problem hiding this comment.
Yeah I originally had a proper fix along those lines, but was getting missing identifier errors. Follow-up patch is the intent, but there is some broken code out there that will make it non-trivial.
By fixing comment, you mean add basically what you wrote explaining why this works at all? Or just the "the the"?
There was a problem hiding this comment.
both, the "the the", and explaining why this works.
|
I suggest you rename this pull-request to “Move stdenvCross and customStdenv to pkgs/stdenv.” |
|
@nbp Thanks! I will fix those things momentarily. |
f822985 to
4783b77
Compare
...but actually is weird just like the original
4783b77 to
6bfe042
Compare
|
@nbp Ok fixed everything (and tested again)! I took part of your review message and also made it a comment. More explanation never hurts! |
Motivation for this change
Cleanup enabled by #19940. This too leads up to #15043. I pulled some more commits from #15043 so that now
top-level/stdenv.nixhardly needs to exist.Cross compiling still behaviors weird (I don't want to change semantics with this patch), but the weirdness is syntactically isolated from normal behavior:
pkgs/stdenv/cross/default.nixwon't be imported unless one is cross compiling and the weirdness is confined to there.@zimbatm this should basically be what you reviewed originally, modulo identifier renaming.Things done
I modified @DavidEGrayson's excellent test script at https://gist.github.com/Ericson2314/fc745290db68b20235bdc457961b3658 . It now just checks for all combinations with all combinations: native target, cross compiling, custom stdenvs, and custom stdenvs + cross compiling. You can replicate my results by running
nix-instantiate --eval -E 'import (builtins.fetchTarball https://gist.github.com/Ericson2314/fc745290db68b20235bdc457961b3658/archive/master.tar.gz) {}' -A testsPassCC @nbp @DavidEGrayson