aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2023-01-31 12:51:12 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2023-05-08 12:58:59 +0200
commit2ca2c80c4e08544cb64f4dc00d083fb9540c2b04 (patch)
treef757a8d618fd8e1f6cff1ccc82cd8835efcd0884 /src/libstore/build
parent869fb1a2f6b8374feacb5ed730e0a0f6cbb195c4 (diff)
libstore: also pass unwanted outputs to the post-build-hook
Diffstat (limited to 'src/libstore/build')
-rw-r--r--src/libstore/build/derivation-goal.cc9
-rw-r--r--src/libstore/build/derivation-goal.hh6
-rw-r--r--src/libstore/build/local-derivation-goal.cc3
3 files changed, 8 insertions, 10 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index a4bb94b0e..2aaeaec6e 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -1064,7 +1064,7 @@ void DerivationGoal::resolvedFinished()
worker.store.registerDrvOutput(newRealisation);
}
outputPaths.insert(realisation.outPath);
- builtOutputs.emplace(wantedOutput, realisation);
+ builtOutputs.emplace(outputName, realisation);
}
runPostBuildHook(
@@ -1406,7 +1406,7 @@ std::pair<bool, SingleDrvOutputs> DerivationGoal::checkPathValidity()
);
}
}
- if (info.wanted && info.known && info.known->isValid())
+ if (info.known && info.known->isValid())
validOutputs.emplace(i.first, Realisation { drvOutput, info.known->path });
}
@@ -1457,8 +1457,9 @@ void DerivationGoal::done(
mcRunningBuilds.reset();
if (buildResult.success()) {
- assert(!builtOutputs.empty());
- buildResult.builtOutputs = std::move(builtOutputs);
+ auto wantedBuiltOutputs = filterDrvOutputs(wantedOutputs, std::move(builtOutputs));
+ assert(!wantedBuiltOutputs.empty());
+ buildResult.builtOutputs = std::move(wantedBuiltOutputs);
if (status == BuildResult::Built)
worker.doneBuilds++;
} else {
diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/build/derivation-goal.hh
index 7033b7a58..01a08d391 100644
--- a/src/libstore/build/derivation-goal.hh
+++ b/src/libstore/build/derivation-goal.hh
@@ -306,15 +306,13 @@ struct DerivationGoal : public Goal
* Update 'initialOutputs' to determine the current status of the
* outputs of the derivation. Also returns a Boolean denoting
* whether all outputs are valid and non-corrupt, and a
- * 'SingleDrvOutputs' structure containing the valid and wanted
- * outputs.
+ * 'SingleDrvOutputs' structure containing the valid outputs.
*/
std::pair<bool, SingleDrvOutputs> checkPathValidity();
/**
* Aborts if any output is not valid or corrupt, and otherwise
- * returns a 'SingleDrvOutputs' structure containing the wanted
- * outputs.
+ * returns a 'SingleDrvOutputs' structure containing all outputs.
*/
SingleDrvOutputs assertPathValidity();
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 21cd6e7ee..2f545627b 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -2701,8 +2701,7 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
signRealisation(thisRealisation);
worker.store.registerDrvOutput(thisRealisation);
}
- if (wantedOutputs.contains(outputName))
- builtOutputs.emplace(outputName, thisRealisation);
+ builtOutputs.emplace(outputName, thisRealisation);
}
return builtOutputs;