|
Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
|
#include <derivation-goal.hh>
Classes | |
| struct | DrvHasRoot |
| struct | InputStream |
Public Types | |
| enum struct | NeedRestartForMoreOutputs { OutputsAddedDoNeed , BuildInProgressWillNotNeed } |
| enum | RetrySubstitution { NoNeed , YesNeed , AlreadyRetried } |
| Public Types inherited from nix::Goal | |
| enum | ExitCode { ecSuccess , ecFailed , ecNoSubstituters , ecIncompleteClosure } |
Public Member Functions | |
| DerivationGoal (const StorePath &drvPath, const OutputsSpec &wantedOutputs, Worker &worker, bool isDependency, BuildMode buildMode=bmNormal) | |
| DerivationGoal (DrvHasRoot, const StorePath &drvPath, const BasicDerivation &drv, const OutputsSpec &wantedOutputs, Worker &worker, bool isDependency, BuildMode buildMode=bmNormal) | |
| WorkResult | timedOut (Error &&ex) |
| kj::Promise< Result< WorkResult > > | workImpl () noexcept override |
| bool | addWantedOutputs (const OutputsSpec &outputs) |
| kj::Promise< Result< WorkResult > > | getDerivation () noexcept |
| kj::Promise< Result< WorkResult > > | loadDerivation () noexcept |
| kj::Promise< Result< WorkResult > > | haveDerivation () noexcept |
| kj::Promise< Result< WorkResult > > | outputsSubstitutionTried () noexcept |
| kj::Promise< Result< WorkResult > > | gaveUpOnSubstitution () noexcept |
| kj::Promise< Result< WorkResult > > | closureRepaired () noexcept |
| kj::Promise< Result< WorkResult > > | inputsRealised () noexcept |
| kj::Promise< Result< WorkResult > > | tryToBuild () noexcept |
| virtual kj::Promise< Result< WorkResult > > | tryLocalBuild () noexcept |
| kj::Promise< Result< WorkResult > > | buildDone () noexcept |
| kj::Promise< Result< WorkResult > > | resolvedFinished () noexcept |
| HookReply | tryBuildHook () |
| virtual int | getChildStatus () |
| virtual kj::Promise< Result< 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 () |
| kj::Promise< Result< std::map< std::string, std::optional< StorePath > > > > | queryPartialDerivationOutputMap () |
| kj::Promise< Result< OutputPathMap > > | queryDerivationOutputMap () |
| kj::Promise< Result< std::pair< bool, SingleDrvOutputs > > > | checkPathValidity () |
| kj::Promise< Result< SingleDrvOutputs > > | assertPathValidity () |
| virtual void | killChild () |
| kj::Promise< Result< WorkResult > > | repairClosure () noexcept |
| void | started () |
| WorkResult | done (BuildResult::Status status, SingleDrvOutputs builtOutputs={}, std::optional< Error > ex={}) |
| void | waiteeDone (GoalPtr waitee) override |
| virtual bool | respectsTimeouts () |
| StorePathSet | exportReferences (const StorePathSet &storePaths) |
| JobCategory | jobCategory () const override |
| Hint for the scheduler, which concurrency limit applies. | |
| Public Member Functions inherited from nix::Goal | |
| Goal (Worker &worker, bool isDependency) | |
| kj::Promise< Result< WorkResult > > | work () noexcept |
| void | trace (std::string_view s) |
| std::string | getName () const |
| virtual void | cleanup () |
Public Attributes | |
| bool | isDone = false |
| bool | useDerivation |
| StorePath | drvPath |
| std::shared_ptr< DerivationGoal > | resolvedDrvGoal |
| OutputsSpec | wantedOutputs |
| std::map< std::pair< StorePath, std::string >, StorePath > | inputDrvOutputs |
| NeedRestartForMoreOutputs | needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed |
| bool | anyHashMismatchSeen = false |
| bool | anyCheckMismatchSeen = false |
| RetrySubstitution | retrySubstitution = RetrySubstitution::NoNeed |
| std::unique_ptr< Derivation > | drv |
| std::unique_ptr< ParsedDerivation > | parsedDrv |
| std::optional< PathLocks > | outputLocks |
| StorePathSet | inputPaths |
| std::map< std::string, InitialOutput > | initialOutputs |
| BuildResult | buildResult |
| 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 |
| AutoCloseFD * | builderOutFD = nullptr |
| std::optional< DerivationType > | derivationType |
| BuildMode | buildMode |
| NotifyingCounter< uint64_t >::Bump | mcExpectedBuilds |
| NotifyingCounter< uint64_t >::Bump | mcRunningBuilds |
| std::unique_ptr< Activity > | act |
| std::unique_ptr< Activity > | actLock |
| std::map< ActivityId, Activity > | builderActivities |
| std::string | machineName |
| Public Attributes inherited from nix::Goal | |
| Worker & | worker |
| const bool | isDependency |
| size_t | nrFailed = 0 |
| size_t | nrNoSubstituters = 0 |
| size_t | nrIncompleteClosure = 0 |
| std::string | name |
Protected Member Functions | |
| kj::Promise< Outcome< void, WorkResult > > | handleChildOutput () noexcept |
| kj::Promise< Outcome< void, WorkResult > > | handleChildStreams (InputStream &builderIn, InputStream *hookIn) noexcept |
| kj::Promise< Outcome< void, WorkResult > > | handleBuilderOutput (InputStream &in) noexcept |
| kj::Promise< Outcome< void, WorkResult > > | handleHookOutput (InputStream &in) noexcept |
| kj::Promise< Outcome< void, WorkResult > > | monitorForSilence () noexcept |
| WorkResult | tooMuchLogs () |
| void | flushLine () |
| Protected Member Functions inherited from nix::Goal | |
| kj::Promise< void > | waitForAWhile () |
| kj::Promise< Result< void > > | waitForGoals (kj::Array< std::pair< GoalPtr, kj::Promise< Result< WorkResult > > > > dependencies) noexcept |
| template<std::derived_from< Goal >... G> | |
| kj::Promise< Result< void > > | waitForGoals (std::pair< std::shared_ptr< G >, kj::Promise< Result< WorkResult > > >... goals) noexcept |
| std::string | lixAsyncTaskContext () const |
Protected Attributes | |
| kj::TimePoint | lastChildActivity = kj::minValue |
| Protected Attributes inherited from nix::Goal | |
| AsyncSemaphore::Token | slotToken |
A goal for building some or all of the outputs of a derivation.
|
strong |
See needRestart; just for that field.
| Enumerator | |
|---|---|
| OutputsAddedDoNeed | The goal state machine is progressing based on the current value of wantedOutputs. No actions are needed. */ OutputsUnmodifedDontNeed, /** wantedOutputs` has been extended, but the state machine is proceeding according to its old value, so we need to restart. |
| BuildInProgressWillNotNeed | The goal state machine has progressed to the point of doing a build, in which case all outputs will be produced, so extensions to wantedOutputs no longer require a restart. |
See retrySubstitution; just for that field.
| bool nix::DerivationGoal::addWantedOutputs | ( | const OutputsSpec & | outputs | ) |
Add wanted outputs to an already existing derivation goal.
| kj::Promise< Result< SingleDrvOutputs > > nix::DerivationGoal::assertPathValidity | ( | ) |
Aborts if any output is not valid or corrupt, and otherwise returns a 'SingleDrvOutputs' structure containing all outputs.
| kj::Promise< Result< 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()
Reimplemented in nix::LocalDerivationGoal.
| void nix::DerivationGoal::closeLogFile | ( | ) |
Close the log file.
|
virtual |
Close the read side of the logger pipe.
Reimplemented in nix::LocalDerivationGoal.
|
noexcept |
The states.
|
inlineoverridevirtual |
|
virtual |
Forcibly kill the child process, if any.
Reimplemented in nix::LocalDerivationGoal.
| Path nix::DerivationGoal::openLogFile | ( | ) |
Open a log file and a pipe to it.
| kj::Promise< Result< 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.
Reimplemented in nix::LocalDerivationGoal.
|
inlinevirtual |
Sign the newly built realisation if the store allows it
Reimplemented in nix::LocalDerivationGoal.
| HookReply nix::DerivationGoal::tryBuildHook | ( | ) |
Is the build hook willing to perform the build?
|
virtualnoexcept |
Reimplemented in nix::LocalDerivationGoal.
|
overridevirtual |
Reimplemented from nix::Goal.
|
overridevirtualnoexcept |
Implements nix::Goal.
| AutoCloseFD* nix::DerivationGoal::builderOutFD = nullptr |
Builder output is pulled from this file descriptor when not null. Owned by the derivation goal or subclass, must not be reset until the build has finished and no more output must be processed by us
| BuildResult nix::DerivationGoal::buildResult |
Build result.
| 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).
| bool nix::DerivationGoal::isDone = false |
Whether this goal has completed. Completed goals can not be asked for more outputs, a new goal must be created instead.
| 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.
| std::optional<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.