Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
derivation-builder.hh File Reference
#include <filesystem>
#include <nlohmann/json_fwd.hpp>
#include "nix/store/build-result.hh"
#include "nix/store/daemon.hh"
#include "nix/store/derivation-options.hh"
#include "nix/store/build/derivation-building-misc.hh"
#include "nix/store/derivations.hh"
#include "nix/store/parsed-derivations.hh"
#include "nix/util/processes.hh"
#include "nix/util/muxable-pipe.hh"
#include "nix/util/json-impls.hh"
#include "nix/store/restricted-store.hh"
#include "nix/store/build/derivation-env-desugar.hh"

Go to the source code of this file.

Classes

struct  nix::BuilderFailureError
struct  nix::ChrootPath
struct  nix::DerivationBuilderParams
struct  nix::DerivationBuilderCallbacks
struct  nix::BuilderExit
struct  nix::DerivationBuilder
struct  nix::ExternalBuilder
struct  nix::BuildingStore
struct  nix::DerivationBuilderDeleter

Typedefs

typedef std::map< std::filesystem::path, ChrootPath > nix::PathsInChroot
using nix::DerivationBuilderUnique = std::unique_ptr<DerivationBuilder, DerivationBuilderDeleter>

Functions

void nix::rethrowExceptionAsError ()
void nix::handleChildException (bool sendException)
void nix::to_json (nlohmann::json &j, const ChrootPath &cp)
void nix::from_json (const nlohmann::json &j, ChrootPath &cp)
void nix::preserveDeathSignal (fun< void()> setCredentials)
std::unique_ptr< BuildingStore > nix::makeBuildingStoreFromLocalStore (LocalStore &localStore)
DerivationBuilderUnique nix::makeDerivationBuilder (std::shared_ptr< BuildingStore > store, std::shared_ptr< DerivationBuilderCallbacks > miscMethods, DerivationBuilderParams params)
DerivationBuilderUnique nix::makeExternalDerivationBuilder (std::shared_ptr< BuildingStore > store, std::shared_ptr< DerivationBuilderCallbacks > miscMethods, DerivationBuilderParams params, const ExternalBuilder &handler)

Function Documentation

◆ handleChildException()

void nix::handleChildException ( bool sendException)

Send the current exception to the parent in the format expected by UnixDerivationBuilderImpl::processSandboxSetupMessages().

◆ makeDerivationBuilder()

std::unique_ptr< DerivationBuilder, DerivationBuilderDeleter > nix::makeDerivationBuilder ( std::shared_ptr< BuildingStore > store,
std::shared_ptr< DerivationBuilderCallbacks > miscMethods,
DerivationBuilderParams params )
Parameters
ioportThe worker's I/O completion port, which the log pipe is tied to.

◆ makeExternalDerivationBuilder()

DerivationBuilderUnique nix::makeExternalDerivationBuilder ( std::shared_ptr< BuildingStore > store,
std::shared_ptr< DerivationBuilderCallbacks > miscMethods,
DerivationBuilderParams params,
const ExternalBuilder & handler )
Parameters
handlerMust be chosen such that it supports the given derivation.

◆ preserveDeathSignal()

void nix::preserveDeathSignal ( fun< void()> setCredentials)

Run a callback that may change process credentials (setuid, setgid, etc.) while preserving the parent-death signal.

The parent-death signal setting is cleared by the Linux kernel upon changes to EUID, EGID.

Note
Does nothing on non-Linux systems.
See also
man PR_SET_PDEATHSIG
https://github.com/golang/go/issues/9686

◆ rethrowExceptionAsError()

void nix::rethrowExceptionAsError ( )

Rethrow the current exception as a subclass of Error.