mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
Remove registerOutputs
from drv goal
Easy to inline in one spot, and assert in the other.
This commit is contained in:
parent
a87589a035
commit
0e7e1f5b57
4 changed files with 11 additions and 29 deletions
|
@ -945,7 +945,15 @@ Goal::Co DerivationGoal::hookDone()
|
||||||
|
|
||||||
/* Compute the FS closure of the outputs and register them as
|
/* Compute the FS closure of the outputs and register them as
|
||||||
being valid. */
|
being valid. */
|
||||||
auto builtOutputs = registerOutputs();
|
auto builtOutputs =
|
||||||
|
/* When using a build hook, the build hook can register the output
|
||||||
|
as valid (by doing `nix-store --import'). If so we don't have
|
||||||
|
to do anything here.
|
||||||
|
|
||||||
|
We can only early return when the outputs are known a priori. For
|
||||||
|
floating content-addressing derivations this isn't the case.
|
||||||
|
*/
|
||||||
|
assertPathValidity();
|
||||||
|
|
||||||
StorePathSet outputPaths;
|
StorePathSet outputPaths;
|
||||||
for (auto & [_, output] : builtOutputs)
|
for (auto & [_, output] : builtOutputs)
|
||||||
|
@ -1174,18 +1182,6 @@ HookReply DerivationGoal::tryBuildHook()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SingleDrvOutputs DerivationGoal::registerOutputs()
|
|
||||||
{
|
|
||||||
/* When using a build hook, the build hook can register the output
|
|
||||||
as valid (by doing `nix-store --import'). If so we don't have
|
|
||||||
to do anything here.
|
|
||||||
|
|
||||||
We can only early return when the outputs are known a priori. For
|
|
||||||
floating content-addressing derivations this isn't the case.
|
|
||||||
*/
|
|
||||||
return assertPathValidity();
|
|
||||||
}
|
|
||||||
|
|
||||||
Path DerivationGoal::openLogFile()
|
Path DerivationGoal::openLogFile()
|
||||||
{
|
{
|
||||||
logSize = 0;
|
logSize = 0;
|
||||||
|
|
|
@ -262,12 +262,6 @@ struct DerivationGoal : public Goal
|
||||||
*/
|
*/
|
||||||
HookReply tryBuildHook();
|
HookReply tryBuildHook();
|
||||||
|
|
||||||
/**
|
|
||||||
* Check that the derivation outputs all exist and register them
|
|
||||||
* as valid.
|
|
||||||
*/
|
|
||||||
virtual SingleDrvOutputs registerOutputs();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a log file and a pipe to it.
|
* Open a log file and a pipe to it.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2330,15 +2330,7 @@ void LocalDerivationGoal::runChild()
|
||||||
|
|
||||||
SingleDrvOutputs LocalDerivationGoal::registerOutputs()
|
SingleDrvOutputs LocalDerivationGoal::registerOutputs()
|
||||||
{
|
{
|
||||||
/* When using a build hook, the build hook can register the output
|
assert(!hook);
|
||||||
as valid (by doing `nix-store --import'). If so we don't have
|
|
||||||
to do anything here.
|
|
||||||
|
|
||||||
We can only early return when the outputs are known a priori. For
|
|
||||||
floating content-addressing derivations this isn't the case.
|
|
||||||
*/
|
|
||||||
if (hook)
|
|
||||||
return DerivationGoal::registerOutputs();
|
|
||||||
|
|
||||||
std::map<std::string, ValidPathInfo> infos;
|
std::map<std::string, ValidPathInfo> infos;
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ struct LocalDerivationGoal : public DerivationGoal
|
||||||
* Check that the derivation outputs all exist and register them
|
* Check that the derivation outputs all exist and register them
|
||||||
* as valid.
|
* as valid.
|
||||||
*/
|
*/
|
||||||
SingleDrvOutputs registerOutputs() override;
|
SingleDrvOutputs registerOutputs();
|
||||||
|
|
||||||
void signRealisation(Realisation &) override;
|
void signRealisation(Realisation &) override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue