#include <derivation-goal.hh>
Public Types | |
enum struct | NeedRestartForMoreOutputs { OutputsUnmodifedDontNeed , OutputsAddedDoNeed , BuildInProgressWillNotNeed } |
enum | RetrySubstitution { NoNeed , YesNeed , AlreadyRetried } |
![]() | |
enum | ExitCode { ecBusy , ecSuccess , ecFailed , ecNoSubstituters , ecIncompleteClosure } |
using | handle_type = std::coroutine_handle<promise_type> |
Public Member Functions | |
DerivationGoal (const StorePath &drvPath, const OutputsSpec &wantedOutputs, Worker &worker, BuildMode buildMode=bmNormal) | |
DerivationGoal (const StorePath &drvPath, const BasicDerivation &drv, const OutputsSpec &wantedOutputs, Worker &worker, BuildMode buildMode=bmNormal) | |
void | timedOut (Error &&ex) override |
std::string | key () override |
void | addWantedOutputs (const OutputsSpec &outputs) |
Co | init () override |
Co | getDerivation () |
Co | loadDerivation () |
Co | haveDerivation () |
Co | outputsSubstitutionTried () |
Co | gaveUpOnSubstitution () |
Co | closureRepaired () |
Co | inputsRealised () |
Co | tryToBuild () |
virtual Co | tryLocalBuild () |
Co | buildDone () |
Co | resolvedFinished () |
HookReply | tryBuildHook () |
virtual int | getChildStatus () |
virtual SingleDrvOutputs | registerOutputs () |
Path | openLogFile () |
virtual void | signRealisation (Realisation &) |
void | closeLogFile () |
virtual void | closeReadPipes () |
virtual void | cleanupHookFinally () |
virtual void | cleanupPreChildKill () |
virtual void | cleanupPostChildKill () |
virtual bool | cleanupDecideWhetherDiskFull () |
virtual void | cleanupPostOutputsRegisteredModeCheck () |
virtual void | cleanupPostOutputsRegisteredModeNonCheck () |
virtual bool | isReadDesc (Descriptor fd) |
void | handleChildOutput (Descriptor fd, std::string_view data) override |
void | handleEOF (Descriptor fd) override |
void | flushLine () |
std::map< std::string, std::optional< StorePath > > | queryPartialDerivationOutputMap () |
OutputPathMap | queryDerivationOutputMap () |
std::pair< bool, SingleDrvOutputs > | checkPathValidity () |
SingleDrvOutputs | assertPathValidity () |
virtual void | killChild () |
Co | repairClosure () |
void | started () |
Done | done (BuildResult::Status status, SingleDrvOutputs builtOutputs={}, std::optional< Error > ex={}) |
void | waiteeDone (GoalPtr waitee, ExitCode result) override |
StorePathSet | exportReferences (const StorePathSet &storePaths) |
JobCategory | jobCategory () const override |
Hint for the scheduler, which concurrency limit applies. | |
![]() | |
Co | init_wrapper () |
Done | amDone (ExitCode result, std::optional< Error > ex={}) |
virtual void | cleanup () |
BuildResult | getBuildResult (const DerivedPath &) const |
Goal (Worker &worker, DerivedPath path) | |
void | work () |
void | addWaitee (GoalPtr waitee) |
void | trace (std::string_view s) |
std::string | getName () const |
Public Attributes | |
bool | useDerivation |
StorePath | drvPath |
std::shared_ptr< DerivationGoal > | resolvedDrvGoal |
OutputsSpec | wantedOutputs |
std::map< std::pair< StorePath, std::string >, StorePath > | inputDrvOutputs |
NeedRestartForMoreOutputs | needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed |
RetrySubstitution | retrySubstitution = RetrySubstitution::NoNeed |
std::unique_ptr< Derivation > | drv |
std::unique_ptr< ParsedDerivation > | parsedDrv |
PathLocks | outputLocks |
StorePathSet | inputPaths |
std::map< std::string, InitialOutput > | initialOutputs |
AutoCloseFD | fdLogFile |
std::shared_ptr< BufferedSink > | logFileSink |
std::shared_ptr< BufferedSink > | logSink |
unsigned long | logSize |
std::list< std::string > | logTail |
std::string | currentLogLine |
size_t | currentLogLinePos = 0 |
std::string | currentHookLine |
std::unique_ptr< HookInstance > | hook |
std::optional< DerivationType > | derivationType |
BuildMode | buildMode |
std::unique_ptr< MaintainCount< uint64_t > > | mcExpectedBuilds |
std::unique_ptr< MaintainCount< uint64_t > > | mcRunningBuilds |
std::unique_ptr< Activity > | act |
std::unique_ptr< Activity > | actLock |
std::map< ActivityId, Activity > | builderActivities |
std::string | machineName |
![]() | |
Worker & | worker |
Goals | waitees |
WeakGoals | waiters |
size_t | nrFailed = 0 |
size_t | nrNoSubstituters = 0 |
size_t | nrIncompleteClosure = 0 |
std::string | name |
ExitCode | exitCode = ecBusy |
std::optional< Co > | top_co |
std::optional< Error > | ex |
Additional Inherited Members | |
![]() | |
BuildResult | buildResult |
A goal for building some or all of the outputs of a derivation.
|
strong |
See needRestart
; just for that field.
See retrySubstitution
; just for that field.
void nix::DerivationGoal::addWantedOutputs | ( | const OutputsSpec & | outputs | ) |
Add wanted outputs to an already existing derivation goal.
SingleDrvOutputs nix::DerivationGoal::assertPathValidity | ( | ) |
Aborts if any output is not valid or corrupt, and otherwise returns a 'SingleDrvOutputs' structure containing all outputs.
std::pair< bool, SingleDrvOutputs > nix::DerivationGoal::checkPathValidity | ( | ) |
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 outputs.
|
virtual |
Cleanup hooks for buildDone()
void nix::DerivationGoal::closeLogFile | ( | ) |
Close the log file.
|
virtual |
Close the read side of the logger pipe.
|
overridevirtual |
|
overridevirtual |
Reimplemented from nix::Goal.
|
inlineoverridevirtual |
|
overridevirtual |
Implements nix::Goal.
|
virtual |
Forcibly kill the child process, if any.
Path nix::DerivationGoal::openLogFile | ( | ) |
Open a log file and a pipe to it.
std::map< std::string, std::optional< StorePath > > nix::DerivationGoal::queryPartialDerivationOutputMap | ( | ) |
Wrappers around the corresponding Store methods that first consult the derivation. This is currently needed because when there is no drv file there also is no DB entry.
|
virtual |
Check that the derivation outputs all exist and register them as valid.
|
inlinevirtual |
Sign the newly built realisation if the store allows it
|
overridevirtual |
HookReply nix::DerivationGoal::tryBuildHook | ( | ) |
Is the build hook willing to perform the build?
|
overridevirtual |
Reimplemented from nix::Goal.
std::optional<DerivationType> nix::DerivationGoal::derivationType |
The sort of derivation we are building.
std::unique_ptr<Derivation> nix::DerivationGoal::drv |
The derivation stored at drvPath.
StorePath nix::DerivationGoal::drvPath |
The path of the derivation.
AutoCloseFD nix::DerivationGoal::fdLogFile |
File descriptor for the log file.
std::unique_ptr<HookInstance> nix::DerivationGoal::hook |
The build hook.
Mapping from input derivations + output names to actual store paths. This is filled in by waiteeDone() as each dependency finishes, before inputsRealised() is reached.
StorePathSet nix::DerivationGoal::inputPaths |
All input paths (that is, the union of FS closures of the immediate input paths).
unsigned long nix::DerivationGoal::logSize |
Number of bytes received from the builder's stdout/stderr.
std::list<std::string> nix::DerivationGoal::logTail |
The most recent log lines.
std::string nix::DerivationGoal::machineName |
The remote machine on which we're building.
NeedRestartForMoreOutputs nix::DerivationGoal::needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed |
Whether additional wanted outputs have been added.
PathLocks nix::DerivationGoal::outputLocks |
The remainder is state held during the build. Locks on (fixed) output paths.
std::shared_ptr<DerivationGoal> nix::DerivationGoal::resolvedDrvGoal |
The goal for the corresponding resolved derivation
RetrySubstitution nix::DerivationGoal::retrySubstitution = RetrySubstitution::NoNeed |
Whether to retry substituting the outputs after building the inputs. This is done in case of an incomplete closure.
bool nix::DerivationGoal::useDerivation |
Whether to use an on-disk .drv file.
OutputsSpec nix::DerivationGoal::wantedOutputs |
The specific outputs that we need to build.