-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
{nixos-container,lsb-release}: use substitute
rather than substituteAll
, fix cross-compilation
#300322
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
The |
Right you are. I did the following on
Then looked at the shebang at the top of the result (which is where
Then used
Definitely wrong. It looks like the correct thing to do is use |
substitute
rather than substituteAll
substitute
rather than substituteAll
, fix cross-compilation
while # some nix code
substituteAllish {
src = ./the/file;
substitutions = {
inherit coreutils;
stuff = someComputation;
etc.
};
}; # substituteAllish mock implementation
{ lib, src, substitutions):
let
subs = lib.flatten ( map (pair: [ "--subst-var-by" pair.name pair.value ]) (lib.attrsets.attrsToList substitutions ));
in
substitute { inherit src; substitutions = subs; etc. } ? |
I've been cooking exactly that patch @a-n-n-a-l-e-e. My hope is that I'll get through enough of these Edit: made a PR with the cooked patch: #301350 |
Let's collaborate on what better would look like on #237216. |
5ac45d5
to
c89f4ad
Compare
substitute
rather than substituteAll
, fix cross-compilationsubstitute
rather than substituteAll
, fix cross-compilation
Description of changes
This change fixes cross-compilation of the
lsb-release
andnixos-container
scripts, all of which used thestdenv
environment variableshell
instead ofruntimeShell
string as the shebang... leading to a cross-compilation mess.There's no other change in produced output. Rationale for using
substitute
instead ofsubstituteAll
is here:substituteAll
is a terrible function and we need to stop using it / fix it respectively #237216Previously:
substitute
rather thansubstituteAll
#300308Things done
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)