-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Bin bash cleanup #19125
Bin bash cleanup #19125
Conversation
@@ -113,6 +113,6 @@ stdenv.mkDerivation rec { | |||
}; | |||
|
|||
passthru = { | |||
shellPath = "/bin/bash"; | |||
shellPath = "${bash}/bin/bash"; |
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.
do you know what shellPath
does in this context?
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.
Oops, this might not make sense for bash
itself ;) I only know passthru
not exactly what it is used for, though.
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.
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.
Yeah I read the part about passthru
but I don't know the relevancy for bash.shellPath
;)
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.
@markus1189 all packages that can be used as a login shell have to specify a stub shell path, I believe. So this should almost certainly be left alone.
Suggestion: use Also consider that stuff that ends up in |
b541fec
to
699c085
Compare
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
#!@shell@ |
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 assume @shell@
points to the shell executable like stdenv.shell
? Btw how can I find out how that @
interpolation works?
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.
@shell@
here would be stdenv.shell
, yes. There's a builder/bash procedure substituteAll infile outfile
that substitutes all @pattern@
with the corresponding shell parameter, so if you have $shell = "${bash}/bin/bash"
in the environment when substitution occurs, @shell@
is substituted for that value. From Nix, you'd do something like substituteAll { inherit (stdenv) shell; src = ./foo.sh; }
.
699c085
to
aafbd40
Compare
Thanks! |
Motivation for this change
Found #183 and did some cleanup on hard coded
/bin/bash
paths. The remaining/bin/bash
occurrences found viagrep '\b/bin/bash/\b'
are calls tosed
or substitutions.Some things I like to have reviewed:
stdenv.shell
instead ofbash
?#!/bin/bash
are patched automatically somewhere? I still adapted them to use@bash@
to be explicit.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)