Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::BuildResult Struct Reference
Inheritance diagram for nix::BuildResult:
nix::KeyedBuildResult

Public Types

enum  Status {
  Built = 0 , Substituted , AlreadyValid , PermanentFailure ,
  InputRejected , OutputRejected , TransientFailure , CachedFailure ,
  TimedOut , MiscFailure , DependencyFailed , LogLimitExceeded ,
  NotDeterministic , ResolvesToAlreadyValid , NoSubstituters
}

Public Member Functions

std::string toString () const
 DECLARE_CMP (BuildResult)
bool success ()
void rethrow ()
KeyedBuildResult restrictTo (DerivedPath path) const

Public Attributes

enum nix::BuildResult::Status status = MiscFailure
std::string errorMsg = {}
unsigned int timesBuilt = 0
bool isNonDeterministic = false
SingleDrvOutputs builtOutputs = {}
time_t startTime = 0
time_t stopTime = 0
std::optional< std::chrono::microseconds > cpuUser
std::optional< std::chrono::microseconds > cpuSystem

Member Enumeration Documentation

◆ Status

Note
This is directly used in the nix-store –serve protocol. That means we need to worry about compatability across versions. Therefore, don't remove status codes, and only add new status codes at the end of the list.
Enumerator
TransientFailure 

possibly transient

CachedFailure 

no longer used

Member Function Documentation

◆ restrictTo()

KeyedBuildResult nix::BuildResult::restrictTo ( DerivedPath path) const

Project a BuildResult with just the information that pertains to the given path.

A BuildResult may hold information for multiple derived paths; this function discards information about outputs not relevant in path. Build Goals in particular may contain more outputs for a single build result than asked for directly, it's necessary to remove any such additional result to not leak other build infos.

Member Data Documentation

◆ builtOutputs

SingleDrvOutputs nix::BuildResult::builtOutputs = {}

For derivations, a mapping from the names of the wanted outputs to actual paths.

◆ cpuUser

std::optional<std::chrono::microseconds> nix::BuildResult::cpuUser

User and system CPU time the build took.

◆ errorMsg

std::string nix::BuildResult::errorMsg = {}

Information about the error if the build failed.

Todo
This should be an entire ErrorInfo object, not just a string, for richer information.

◆ isNonDeterministic

bool nix::BuildResult::isNonDeterministic = false

If timesBuilt > 1, whether some builds did not produce the same result. (Note that 'isNonDeterministic = false' does not mean the build is deterministic, just that we don't have evidence of non-determinism.)

◆ startTime

time_t nix::BuildResult::startTime = 0

The start/stop times of the build (or one of the rounds, if it was repeated).

◆ timesBuilt

unsigned int nix::BuildResult::timesBuilt = 0

How many times this build was performed.


The documentation for this struct was generated from the following files: