1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Merge pull request #13905 from obsidiansystems/derivation-building-goal-simplify-0

Derivation building goal simplify -- no `goto`
This commit is contained in:
John Ericson 2025-09-03 17:34:27 -04:00 committed by GitHub
commit b69576e2b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 272 additions and 260 deletions

View file

@ -7,6 +7,14 @@
namespace nix {
/**
* @note Sometimes this is owned by the `Worker`, and sometimes it is
* owned by a `Goal`. This is for efficiency: rather than starting the
* hook every time we want to ask whether we can run a remote build
* (which can be very often), we reuse a hook process for answering
* those queries until it accepts a build. So if there are N
* derivations to be built, at most N hooks will be started.
*/
struct HookInstance
{
/**
@ -29,6 +37,15 @@ struct HookInstance
*/
Pid pid;
/**
* The remote machine on which we're building.
*
* @Invariant When the hook instance is owned by the `Worker`, this
* is the empty string. When it is owned by a `Goal`, this should be
* set.
*/
std::string machineName;
FdSink sink;
std::map<ActivityId, Activity> activities;