Skip to content

Commit

Permalink
nix-shell: Don't add root for shell with --out-link.
Browse files Browse the repository at this point in the history
It is an input of the shell itself.
  • Loading branch information
jsoo1 committed Nov 1, 2022
1 parent 9aff695 commit 921ce36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ static void main_nix_build(int argc, char * * argv)
auto shellDrvOutputs = store->queryPartialDerivationOutputMap(shellDrv.value());
auto shellDrvOut = shellDrvOutputs.at("out").value();
shell = store->printStorePath(shellDrvOut) + "/bin/bash";

if (outLink) writeOutLink(*outLink + "-shell", shellDrvOut, "out");
}

if (settings.isExperimentalFeatureEnabled(Xp::CaDerivations)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/nix-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ output=$($TEST_ROOT/spaced\ \\\'\"shell.shebang.rb abc ruby)

# Test nix-shell --out-link -p creates gcroot
nix-shell --pure -p foo --out-link $TEST_ROOT/gcroots/foo-root
[ -L $TEST_ROOT/gcroots/foo-root ] && [ -L $TEST_ROOT/gcroots/foo-root-shell ]
[ -L $TEST_ROOT/gcroots/foo-root ]

# Test nix-shell --out-link -A creates gcroot
nix-shell --pure -A foo --out-link $TEST_ROOT/gcroots/foo-attr-root
[ -L $TEST_ROOT/gcroots/foo-attr-root ] && [ -L $TEST_ROOT/gcroots/foo-attr-root-shell ]
[ -L $TEST_ROOT/gcroots/foo-attr-root ]

# Test 'nix develop'.
nix develop -f "$shellDotNix" shellDrv -c bash -c '[[ -n $stdenv ]]'
Expand Down

0 comments on commit 921ce36

Please sign in to comment.