Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
goal.hh File Reference
#include "nix/store/store-api.hh"
#include "nix/store/build-result.hh"
#include <coroutine>
#include <queue>
#include <variant>

Go to the source code of this file.

Classes

class  nix::TimedOut
struct  nix::CompareGoalPtrs
struct  nix::Goal
struct  nix::Goal::ChildOutput
struct  nix::Goal::ChildEOF
struct  nix::Goal::Suspend
struct  nix::Goal::WaitForChildEvent
class  nix::Goal::CoBase
struct  nix::Goal::Co< T >
struct  nix::Goal::AsyncCallback< T >
class  nix::Goal::AwaitableFrameBase
class  nix::Goal::AwaitableFrame< T >
struct  nix::Goal::AwaitableFrameBase::CoAwaiter< void >
struct  nix::Goal::AwaitableFrame< void >
struct  std::coroutine_traits< nix::Goal::Co< T >, ArgTypes... >

Typedefs

typedef std::shared_ptr< Goal > nix::GoalPtr
typedef std::weak_ptr< Goal > nix::WeakGoalPtr
typedef std::set< GoalPtr, CompareGoalPtrs > nix::Goals
typedef std::set< WeakGoalPtr, std::owner_less< WeakGoalPtr > > nix::WeakGoals
typedef std::map< StorePath, WeakGoalPtr > nix::WeakGoalMap

Enumerations

enum struct  nix::JobCategory { Build , Substitution , Administration }

Functions

void nix::addToWeakGoals (WeakGoals &goals, GoalPtr p)

Typedef Documentation

◆ GoalPtr

typedef std::shared_ptr<Goal> nix::GoalPtr

A pointer to a goal.

◆ Goals

typedef std::set<GoalPtr, CompareGoalPtrs> nix::Goals

Set of goals.

◆ WeakGoalMap

typedef std::map<StorePath, WeakGoalPtr> nix::WeakGoalMap

A map of paths to goals (and the other way around).

Enumeration Type Documentation

◆ JobCategory

enum struct nix::JobCategory
strong

Used as a hint to the worker on how to schedule a particular goal. For example, builds are typically CPU- and memory-bound, while substitutions are I/O bound. Using this information, the worker might decide to schedule more or fewer goals of each category in parallel.

Enumerator
Build 

A build of a derivation; it will use CPU and disk resources.

Substitution 

A substitution an arbitrary store object; it will use network resources.

Administration 

A goal that does no "real" work by itself, and just exists to depend on other goals which do do real work. These goals therefore are not limited.

These goals cannot infinitely create themselves, so there is no risk of a "fork bomb" type situation (which would be a problem even though the goal do no real work) either.