stdenv: fix propagatedUserEnvPkgs when __structuredAttrs is true again#392928
Conversation
This is a follow-up of NixOS#388908. Previously, $out/nix-support/propagated-user-env-packages was not created when __structuredAttrs is true, the first element of propagatedUserEnvPkgs is null and the length of propagatedUserEnvPkgs is at least 2. Fixes NixOS#388829
|
The |
wolfgangwalther
left a comment
There was a problem hiding this comment.
Ah, I even thought about this part in the fir PR - but then assumed that "nobody is going to pass an empty string as the first pkg anyway, so it should be fine". Didn't think about null.
|
To err on the safe side before merging, has anyone built and confirmed that it works? I originally planned to test it tonight, but my tablet is temporarily unavailable. |
|
What attribute do you want tested? I'll spin up a build on my Ampere system at home. |
I would like to see if pkgs.hello.overrideAttrs { __structuredAttrs = true; propagatedUserEnvPkgs = [ null pkgs.bash ]; }built output produces the correct I would be curious about the result for
Thanks a lot! |
Ok it built and only has bash interactive in it. |
ShamrockLee
left a comment
There was a problem hiding this comment.
I know little about Emacs and its plugins.
Nevertheless, since stdenv's setup.sh works as expected, plut two other approavals, it should be safe to merge.
The issue NixOS#392928 fixes seems to affect many elisp packages. For example, about 900 MELPA packages are affected. This commit is a temporary fix and should be reverted after NixOS#392928 reaches master. Close: NixOS#388829
This is a follow-up of #388908.
Previously,
$out/nix-support/propagated-user-env-packageswas not created when__structuredAttrswas enabled, the first element ofpropagatedUserEnvPkgswasnulland the length ofpropagatedUserEnvPkgswas at least 2.Fixes #388829
With this patch applied, condition check result for each
propagatedUserEnvPkgsis shown below.propagatedUserEnvPkgs__structuredAttrsenabled__structuredAttrsdisablednullfalsefalse[ ]falsefalse[ null ]falsefalse[ null "foo" ]true( previously wasfalse)trueThings done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.