1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

DerivationBuildingGoal::inputPaths make local variable

This commit is contained in:
John Ericson 2025-08-29 15:17:45 -04:00
parent abc4f86e4e
commit c02beddf8a
2 changed files with 11 additions and 9 deletions

View file

@ -155,6 +155,12 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution(bool storeDerivation)
/* Determine the full set of input paths. */
/**
* All input paths (that is, the union of FS closures of the
* immediate input paths).
*/
StorePathSet inputPaths;
if (storeDerivation) {
assert(drv->inputDrvs.map.empty());
/* Store the resolved derivation, as part of the record of
@ -348,7 +354,7 @@ tryToBuild:
if (buildLocally) {
useHook = false;
} else {
switch (tryBuildHook(initialOutputs)) {
switch (tryBuildHook(inputPaths, initialOutputs)) {
case rpAccept:
/* Yes, it has started doing so. Wait until we get
EOF from the hook. */
@ -801,7 +807,8 @@ BuildError DerivationBuildingGoal::fixupBuilderFailureErrorMessage(BuilderFailur
return BuildError{e.status, msg};
}
HookReply DerivationBuildingGoal::tryBuildHook(const std::map<std::string, InitialOutput> & initialOutputs)
HookReply DerivationBuildingGoal::tryBuildHook(
const StorePathSet & inputPaths, const std::map<std::string, InitialOutput> & initialOutputs)
{
#ifdef _WIN32 // TODO enable build hook on Windows
return rpDecline;

View file

@ -58,12 +58,6 @@ private:
* The remainder is state held during the build.
*/
/**
* All input paths (that is, the union of FS closures of the
* immediate input paths).
*/
StorePathSet inputPaths;
/**
* File descriptor for the log file.
*/
@ -114,7 +108,8 @@ private:
/**
* Is the build hook willing to perform the build?
*/
HookReply tryBuildHook(const std::map<std::string, InitialOutput> & initialOutputs);
HookReply
tryBuildHook(const StorePathSet & inputPaths, const std::map<std::string, InitialOutput> & initialOutputs);
/**
* Open a log file and a pipe to it.