Expose sh in $PATH in the base combinator
Some software reasonably expects `sh` to exist in PATH. I think I haven't run into this before since a lot of nixified software explicitly declares its dependencies on bash, but I've run into a few where this isn't the case.
This commit is contained in:
parent
ec9f9f98d8
commit
b843338efa
2 changed files with 16 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ spec = parallel $ inTestM $ do
|
|||
`shouldOutput` "Hello, world!\n"
|
||||
|
||||
it "sets a sane default path" $ do
|
||||
defaultPath <- evalNixExpr [i| "${pkgs.coreutils}/bin" |]
|
||||
defaultPath <- evalNixExpr [i| "${pkgs.coreutils}/bin:/bin" |]
|
||||
[i| jail "test" (sh ''echo -n "$PATH"'') [] |]
|
||||
`shouldOutput` defaultPath
|
||||
|
||||
|
|
@ -29,6 +29,10 @@ spec = parallel $ inTestM $ do
|
|||
[i| jail "test" (sh ''echo -n "''${MY_ENV_VAR-unset}"'') [] |]
|
||||
`shouldOutput` "unset"
|
||||
|
||||
it "provides `sh` in the default path" $ do
|
||||
[i| jail "test" (sh ''sh -c "echo hello"'') [] |]
|
||||
`shouldOutput` "hello\n"
|
||||
|
||||
describe "forwarding package overrides to the jailed derivation" $ do
|
||||
-- This is a nix expression of a package that prints out the value of an
|
||||
-- overridable `run`:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue