stdenv: fix propagatedUserEnvPkgs when __structuredAttrs is true#388908
Conversation
Previously, when __structuredAttrs is true, only the first element of propagatedUserEnvPkgs was written to $out/nix-support/propagated-user-env-packages.
…pers" This reverts commit d64a233. A stdenv bug breaks emacs.pkgs.withPackages wrapper. A fix PR[1] will take a few weeks to reach users because it has to go through a staging cycle. Revert this for now to unbreak emacs.pkgs.withPackages wrapper. [1]: NixOS#388908
wolfgangwalther
left a comment
There was a problem hiding this comment.
I just read the code, but I think this breaks the structuredAttrs = false case with multiple of those packages.
Those lines of code seemed to rely on the fact that those are separated by spaces and thus passed as separate arguments to printf / printWords - this won't work anymore right now.
|
@wolfgangwalther I think it works regardless of |
Ah, you're right... I only looked at how the arguments are passed... but those two functions literally do the separation by spaces that we then already have.. so in this specific case it does indeed not make a difference. |
philiptaron
left a comment
There was a problem hiding this comment.
I ran the stdenv test suite (tests.stdenv) and they all passed. The PR looks sane to me. Any objections to merging?
|
I put a note on my list to check for similar patterns to fix - but that should not block merging this one. |
ShamrockLee
left a comment
There was a problem hiding this comment.
The functionality should be okay, and ShellCheck doesn't complain about these changes.
| mkdir $out/nix-support | ||
| if [ "$propagatedUserEnvPkgs" ]; then | ||
| printf '%s ' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages | ||
| printf '%s ' "${propagatedUserEnvPkgs[@]}" > $out/nix-support/propagated-user-env-packages |
There was a problem hiding this comment.
I personally prefer
| printf '%s ' "${propagatedUserEnvPkgs[@]}" > $out/nix-support/propagated-user-env-packages | |
| echo -n "${propagatedUserEnvPkgs[*]} " > $out/nix-support/propagated-user-env-packages |
but it's not a blocker.
|
Given that this PR gets approvals, let's merge it to catch the next staging-next which will start in a few days. |
…pers" This reverts commit d64a233. A stdenv bug breaks emacs.pkgs.withPackages wrapper. A fix PR[1] will take a few weeks to reach users because it has to go through a staging cycle. Revert this for now to unbreak emacs.pkgs.withPackages wrapper. [1]: NixOS#388908
Previously, when __structuredAttrs is true, only the first element of propagatedUserEnvPkgs was written to
$out/nix-support/propagated-user-env-packages.
part of #205690
Things 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.