mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
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 <nixpkgs> {};
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 0774e8ba33
)
This commit is contained in:
parent
fb02a952bd
commit
0812ddeb09
@ -151,7 +151,7 @@ std::optional<nlohmann::json> ParsedDerivation::prepareStructuredAttrs(Store & s
|
|||||||
for (auto i = e->begin(); i != e->end(); ++i) {
|
for (auto i = e->begin(); i != e->end(); ++i) {
|
||||||
StorePathSet storePaths;
|
StorePathSet storePaths;
|
||||||
for (auto & p : *i)
|
for (auto & p : *i)
|
||||||
storePaths.insert(store.parseStorePath(p.get<std::string>()));
|
storePaths.insert(store.toStorePath(p.get<std::string>()).first);
|
||||||
json[i.key()] = store.pathInfoToJSON(
|
json[i.key()] = store.pathInfoToJSON(
|
||||||
store.exportReferences(storePaths, inputPaths), false, true);
|
store.exportReferences(storePaths, inputPaths), false, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user