Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8b15650e7421
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7cf874c17d46
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 2, 2020

  1. Don't use readDerivation() in addValidPath()

    readDerivation() requires a valid path.
    
    Fixes #4210.
    edolstra committed Nov 2, 2020
    1
    Copy the full SHA
    7cf874c View commit details
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/libstore/local-store.cc
11 changes: 9 additions & 2 deletions src/libstore/local-store.cc
Original file line number Diff line number Diff line change
@@ -623,7 +623,10 @@ uint64_t LocalStore::addValidPath(State & state,
efficiently query whether a path is an output of some
derivation. */
if (info.path.isDerivation()) {
auto drv = readDerivation(info.path);
auto drv = parseDerivation(
*this,
readFile(Store::toRealPath(info.path)),
Derivation::nameFromPath(info.path));

/* Verify that the output paths in the derivation are correct
(i.e., follow the scheme for computing output paths from
@@ -1000,7 +1003,11 @@ void LocalStore::registerValidPaths(const ValidPathInfos & infos)
for (auto & i : infos)
if (i.path.isDerivation()) {
// FIXME: inefficient; we already loaded the derivation in addValidPath().
checkDerivationOutputs(i.path, readDerivation(i.path));
checkDerivationOutputs(i.path,
parseDerivation(
*this,
readFile(Store::toRealPath(i.path)),
Derivation::nameFromPath(i.path)));
}

/* Do a topological sort of the paths. This will throw an