Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ChrootDerivationBuilder Struct Reference
Inheritance diagram for nix::ChrootDerivationBuilder:
nix::UnixDerivationBuilderImpl nix::DerivationBuilderImpl nix::DerivationBuilder nix::DerivationBuilderParams nix::RestrictionContext nix::ChrootFreeBSDDerivationBuilder nix::ChrootLinuxDerivationBuilder

Public Member Functions

 ChrootDerivationBuilder (std::shared_ptr< BuildingStore > store, std::shared_ptr< DerivationBuilderCallbacks > miscMethods, DerivationBuilderParams params)
bool needsHashRewrite () override
void setBuildTmpDir () override
std::filesystem::path tmpDirInSandbox () override
virtual gid_t sandboxGid ()
void prepareSandbox () override
Strings getPreBuildHookArgs () override
std::filesystem::path realPathInHost (const StorePath &p) override
void cleanupBuild (bool force) override
std::pair< std::filesystem::path, std::filesystem::path > addDependencyPrep (const StorePath &path)
Public Member Functions inherited from nix::UnixDerivationBuilderImpl
void cleanupOnDestruction () noexcept
std::optional< Descriptor > startBuild () override
BuilderExit unprepareBuild () override
void cleanupBuild (bool force) override
bool killChild () override
 DerivationBuilderImpl (std::shared_ptr< BuildingStore > store, std::shared_ptr< DerivationBuilderCallbacks > miscMethods, DerivationBuilderParams params)
Public Member Functions inherited from nix::DerivationBuilderImpl
 DerivationBuilderImpl (std::shared_ptr< BuildingStore > store, std::shared_ptr< DerivationBuilderCallbacks > miscMethods, DerivationBuilderParams params)
SingleDrvOutputs registerOutputs (LocalStore &localStore) override
SingleDrvOutputs checkSubmittedOutputs (LocalStore &localStore) override
Public Member Functions inherited from nix::DerivationBuilder
MuxablePipePollState::CommChannel logChannel ()
Descriptor logDescriptor ()
Public Member Functions inherited from nix::RestrictionContext
bool isAllowed (const DerivedPath &id)
void addDependency (const StorePath &path)

Public Attributes

std::filesystem::path chrootRootDir
std::optional< AutoDelete > autoDelChroot
PathsInChroot pathsInChroot
Public Attributes inherited from nix::DerivationBuilderImpl
Sync< OutputPathMap > submittedOutputs
Public Attributes inherited from nix::DerivationBuilder
AutoCloseFD builderOut
Public Attributes inherited from nix::RestrictionContext
Sync< State > state_
Public Attributes inherited from nix::DerivationBuilderParams
const StorePath & drvPath
BuildResult & buildResult
const BasicDerivation & drv
const DerivationOptions< StorePath > & drvOptions
const StorePathSet & inputPaths
const std::map< std::string, InitialOutput > initialOutputs
const BuildMode & buildMode
PathsInChroot defaultPathsInChroot
StringSet systemFeatures
DesugaredEnv desugaredEnv

Additional Inherited Members

Protected Types inherited from nix::UnixDerivationBuilderImpl
typedef StringMap Environment
Protected Types inherited from nix::DerivationBuilderImpl
typedef std::map< StorePath, StorePath > RedirectedOutputs
Protected Member Functions inherited from nix::UnixDerivationBuilderImpl
const StorePathSet & originalPaths () override
bool isAllowed (const StorePath &path) override
bool isAllowed (const DrvOutput &id) override
bool isAllowed (const DerivedPath &req)
bool shouldModifySandbox () override
void submitOutput (const SingleDerivedPath &path, const OutputName &output) override
virtual std::unique_ptr< UserLock > getBuildUser ()
PathsInChroot getPathsInSandbox ()
virtual void prepareUser ()
void openSlave ()
virtual void startChild ()
void processSandboxSetupMessages ()
void addDependencyImpl (const StorePath &path) override
void chownToBuilder (const std::filesystem::path &path)
void chownToBuilder (int fd, const std::filesystem::path &path)
void writeBuilderFile (const OsFilename &name, std::string_view contents)
void runChild (RunChildArgs args)
virtual void enterChroot ()
virtual void setUser ()
virtual void execBuilder (const Strings &args, const Strings &envStrs)
virtual void killSandbox (bool getStats)
Protected Attributes inherited from nix::UnixDerivationBuilderImpl
std::filesystem::path topTmpDir
AutoCloseFD tmpDirFd
Environment env
bool usingSubmitted
AutoCloseFD daemonSocket
std::thread daemonThread
std::list< DaemonWorkerState > daemonWorkerThreads
Protected Attributes inherited from nix::DerivationBuilderImpl
Pid pid
std::shared_ptr< BuildingStore > store
std::shared_ptr< DerivationBuilderCallbacks > miscMethods
std::filesystem::path tmpDir
const derivation::Type derivationType
const LocalSettings & localSettings = store->getLocalSettings()
std::unique_ptr< UserLock > buildUser
StringMap inputRewrites
StringMap outputRewrites
RedirectedOutputs redirectedOutputs
OutputPathMap scratchOutputs
Static Protected Attributes inherited from nix::UnixDerivationBuilderImpl
static const std::filesystem::path homeDir = "/homeless-shelter"

Member Function Documentation

◆ cleanupBuild()

void nix::ChrootDerivationBuilder::cleanupBuild ( bool force)
overridevirtual

Delete the temporary directory, if we have one.

Parameters
forceWe know the build succeeded, so don't attempt to preserve anything for debugging.

Implements nix::DerivationBuilder.

Reimplemented in nix::ChrootFreeBSDDerivationBuilder.

◆ getPreBuildHookArgs()

Strings nix::ChrootDerivationBuilder::getPreBuildHookArgs ( )
overridevirtual

Reimplemented from nix::UnixDerivationBuilderImpl.

◆ needsHashRewrite()

bool nix::ChrootDerivationBuilder::needsHashRewrite ( )
inlineoverridevirtual

Whether we need to perform hash rewriting if there are valid output paths.

Reimplemented from nix::UnixDerivationBuilderImpl.

◆ prepareSandbox()

void nix::ChrootDerivationBuilder::prepareSandbox ( )
overridevirtual

Called by prepareBuild() to do any setup in the parent to prepare for a sandboxed build.

Reimplemented from nix::UnixDerivationBuilderImpl.

Reimplemented in nix::ChrootFreeBSDDerivationBuilder, and nix::ChrootLinuxDerivationBuilder.

◆ realPathInHost()

std::filesystem::path nix::ChrootDerivationBuilder::realPathInHost ( const StorePath & p)
overridevirtual

Where an output path lives while the build runs.

Sandboxing can put it somewhere other than its final home, so this is a hook rather than just Store::toRealPath.

Reimplemented from nix::DerivationBuilderImpl.

◆ setBuildTmpDir()

void nix::ChrootDerivationBuilder::setBuildTmpDir ( )
overridevirtual

Reimplemented from nix::UnixDerivationBuilderImpl.

◆ tmpDirInSandbox()

std::filesystem::path nix::ChrootDerivationBuilder::tmpDirInSandbox ( )
overridevirtual

Return the path of the temporary directory in the sandbox.

Reimplemented from nix::UnixDerivationBuilderImpl.

Member Data Documentation

◆ autoDelChroot

std::optional<AutoDelete> nix::ChrootDerivationBuilder::autoDelChroot

RAII cleanup for the chroot directory.

◆ chrootRootDir

std::filesystem::path nix::ChrootDerivationBuilder::chrootRootDir

The chroot root directory.


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