Skip to content

Commit

Permalink
Fix the nix command with CA derivations
Browse files Browse the repository at this point in the history
Prevents a crash because most `nix` subcommands assumed that derivations
know their output path, which isn't the case for CA derivations
  • Loading branch information
thufschmitt committed Dec 11, 2020
1 parent 253571e commit eb45308
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nix/installables.cc
Expand Up @@ -409,7 +409,7 @@ std::vector<InstallableValue::DerivationInfo> InstallableAttrPath::toDerivations
for (auto & drvInfo : drvInfos) {
res.push_back({
state->store->parseStorePath(drvInfo.queryDrvPath()),
state->store->parseStorePath(drvInfo.queryOutPath()),
state->store->maybeParseStorePath(drvInfo.queryOutPath()),
drvInfo.queryOutputName()
});
}
Expand Down
6 changes: 6 additions & 0 deletions tests/content-addressed.sh
Expand Up @@ -50,7 +50,13 @@ testGC () {
nix-collect-garbage --experimental-features ca-derivations --option keep-derivations true
}

testNixCommand () {
clearStore
nix build --experimental-features 'nix-command ca-derivations' --file ./content-addressed.nix --no-link
}

testRemoteCache
testDeterministicCA
testCutoff
testGC
testNixCommand

0 comments on commit eb45308

Please sign in to comment.