{nixos-container,lsb-release}: use substitute rather than substituteAll, fix cross-compilation#300322
{nixos-container,lsb-release}: use substitute rather than substituteAll, fix cross-compilation#300322philiptaron wants to merge 2 commits intoNixOS:stagingfrom
substitute rather than substituteAll, fix cross-compilation#300322Conversation
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 substituteAllsubstitute 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-releaseandnixos-containerscripts, all of which used thestdenvenvironment variableshellinstead ofruntimeShellstring as the shebang... leading to a cross-compilation mess.There's no other change in produced output. Rationale for using
substituteinstead ofsubstituteAllis here:substituteAllis a terrible function and we need to stop using it / fix it respectively #237216Previously:
substituterather 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/)