From c1319831fbf26131c0a973b705b9bba7f067a601 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 17 Apr 2024 21:51:59 +0200 Subject: [PATCH] Fix exportReferencesGraph when given store subpath With Nix 2.3, it was possible to pass a subpath of a store path to exportReferencesGraph: with import {}; let hello = writeShellScriptBin "hello" '' echo ${toString builtins.currentTime} ''; in writeClosure [ "${hello}/bin/hello" ] This regressed with Nix 2.4, with a very confusing error message, that presumably indicates it was unintentional: error: path '/nix/store/3gl7kgjr4pwf03f0x70dgx9ln3bhl7zc-hello/bin/hello' is not in the Nix store (cherry picked from commit 0774e8ba33c060f56bad3ff696796028249e915a) Change-Id: I00920fb33077b831a1bb4a1b68d515ba8c3c2a69 --- src/libstore/parsed-derivations.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index 1d900c272..992a79c6e 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -151,7 +151,7 @@ std::optional ParsedDerivation::prepareStructuredAttrs(Store & s for (auto i = e->begin(); i != e->end(); ++i) { StorePathSet storePaths; for (auto & p : *i) - storePaths.insert(store.parseStorePath(p.get())); + storePaths.insert(store.toStorePath(p.get()).first); json[i.key()] = store.pathInfoToJSON( store.exportReferences(storePaths, inputPaths), false, true); }