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
wrapFish: fix singleton expansion in shell init #113232
wrapFish: fix singleton expansion in shell init #113232
Conversation
This fixes the expansion of the configuration path in the pathological case of a singleton, which would otherwise be used verbatim with the surrounding braces for lookup. GitHub: see NixOS#108491 (review)
CC @teehemkay |
|
||
in writeShellScriptBin "fish" '' | ||
${fish}/bin/fish --init-command " | ||
set --prepend fish_complete_path ${escapeShellArgs complPath} | ||
set --prepend fish_function_path ${escapeShellArgs funcPath} | ||
for c in {${concatStringsSep "," safeConfPath}}/*; source $c; end | ||
set --local fish_conf_source_path ${escapeShellArgs confPath} | ||
for c in $fish_conf_source_path/*; source $c; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pacien I may be missing something obvious, but isn't this going to break in the case where confPath
is not a singleton?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ignore my previous comment and thank you for helping me better understand fish cartesian products.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same question and had to run it myself to totally understand:
$ mkdir a b c d e
$ touch a/1 b/2 c/3 d/4 e/5
$ set --local test a b c d e
$ for c in $test/*; echo $c; end
a/1
b/2
c/3
d/4
e/5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM, thanks!
This fixes the expansion of the configuration path in the pathological
case of a singleton, which would otherwise be used verbatim with the
surrounding braces for lookup.
GitHub: see #108491 (review)
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)