diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-11-02 18:46:44 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-11-02 18:46:44 +0100 |
commit | 7cf874c17d466d5cffdb0eb6215fcfe8930ed757 (patch) | |
tree | 7dbb913e4d5eb00e30fa58d1bbce949d3b2f039f /src/libstore | |
parent | 8b15650e7421cf9433f04c32ac73601aada1e3ab (diff) |
Don't use readDerivation() in addValidPath()
readDerivation() requires a valid path.
Fixes #4210.
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/local-store.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index bfad8fb21..2892b0407 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -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 |