1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Move derivationType from DerivationGoal to LocalDerivationGoal

The super class doesn't actually care.
This commit is contained in:
John Ericson 2025-03-16 18:32:20 -04:00
parent 5283589542
commit 7f8d348f3d
3 changed files with 9 additions and 9 deletions

View file

@ -533,9 +533,6 @@ Goal::Co DerivationGoal::gaveUpOnSubstitution()
debug("added input paths %s", worker.store.showPaths(inputPaths)); debug("added input paths %s", worker.store.showPaths(inputPaths));
/* What type of derivation are we building? */
derivationType = drv->type();
/* Okay, try to build. Note that here we don't wait for a build /* Okay, try to build. Note that here we don't wait for a build
slot to become available, since we don't need one if there is a slot to become available, since we don't need one if there is a
build hook. */ build hook. */

View file

@ -198,11 +198,6 @@ struct DerivationGoal : public Goal
std::unique_ptr<HookInstance> hook; std::unique_ptr<HookInstance> hook;
#endif #endif
/**
* The sort of derivation we are building.
*/
std::optional<DerivationType> derivationType;
BuildMode buildMode; BuildMode buildMode;
std::unique_ptr<MaintainCount<uint64_t>> mcExpectedBuilds, mcRunningBuilds; std::unique_ptr<MaintainCount<uint64_t>> mcExpectedBuilds, mcRunningBuilds;

View file

@ -150,6 +150,13 @@ struct LocalDerivationGoal : DerivationGoal, RestrictionContext
*/ */
std::shared_ptr<AutoDelete> autoDelChroot; std::shared_ptr<AutoDelete> autoDelChroot;
/**
* The sort of derivation we are building.
*
* Just a cached value, can be recomputed from `drv`.
*/
std::optional<DerivationType> derivationType;
/** /**
* Stuff we need to pass to initChild(). * Stuff we need to pass to initChild().
*/ */
@ -478,7 +485,8 @@ Goal::Co LocalDerivationGoal::tryLocalBuild()
co_return tryToBuild(); co_return tryToBuild();
} }
assert(derivationType); /* Cache this */
derivationType = drv->type();
/* Are we doing a chroot build? */ /* Are we doing a chroot build? */
{ {