From 7c9ece5dcaf6407449616c9d2d302853829c4f7d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Jul 2020 14:25:43 +0200 Subject: [PATCH] exportReferencesGraph: Fix support for non-top-level store paths Fixes #3471. --- src/libstore/build.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 347fe1b99..0ef2f288f 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2041,7 +2041,10 @@ void DerivationGoal::startBuilder() if (!std::regex_match(fileName, regex)) throw Error("invalid file name '%s' in 'exportReferencesGraph'", fileName); - auto storePath = worker.store.parseStorePath(*i++); + auto storePathS = *i++; + if (!worker.store.isInStore(storePathS)) + throw BuildError("'exportReferencesGraph' contains a non-store path '%1%'", storePathS); + auto storePath = worker.store.parseStorePath(worker.store.toStorePath(storePathS)); /* Write closure info to . */ writeFile(tmpDir + "/" + fileName,