aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorValentin Gagarin <valentin.gagarin@tweag.io>2023-03-03 06:38:29 +0100
committerGitHub <noreply@github.com>2023-03-03 06:38:29 +0100
commit37c61907d7111277aeb22d18195c425fe27fed1b (patch)
treeace5534a8807bd8646f1d2c4236f27b48b40e78e /src/nix-store/nix-store.cc
parent8730d3002f9834a1c9c45bc50fd4c46458ae6eef (diff)
parentb2752a4f74bf2697ed9be4e9cb913de03b1b1660 (diff)
Merge pull request #7605 from tweag/comments
add comments
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index d4218550a..587882883 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -72,11 +72,13 @@ static PathSet realisePath(StorePathWithOutputs path, bool build = true)
Derivation drv = store->derivationFromPath(path.path);
rootNr++;
+ /* FIXME: Encode this empty special case explicitly in the type. */
if (path.outputs.empty())
for (auto & i : drv.outputs) path.outputs.insert(i.first);
PathSet outputs;
for (auto & j : path.outputs) {
+ /* Match outputs of a store path with outputs of the derivation that produces it. */
DerivationOutputs::iterator i = drv.outputs.find(j);
if (i == drv.outputs.end())
throw Error("derivation '%s' does not have an output named '%s'",
@@ -141,6 +143,7 @@ static void opRealise(Strings opFlags, Strings opArgs)
toDerivedPaths(paths),
willBuild, willSubstitute, unknown, downloadSize, narSize);
+ /* Filter out unknown paths from `paths`. */
if (ignoreUnknown) {
std::vector<StorePathWithOutputs> paths2;
for (auto & i : paths)