Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::DummyStoreImpl Struct Reference
Inheritance diagram for nix::DummyStoreImpl:
nix::DummyStore nix::Store nix::StoreDirConfig

Public Types

using Config = DummyStoreConfig
Public Types inherited from nix::DummyStore
using Config = DummyStoreConfig
Public Types inherited from nix::Store
using Config = StoreConfig
using PathsSource = std::vector<std::pair<ValidPathInfo, std::unique_ptr<Source>>>

Public Member Functions

 DummyStoreImpl (ref< const Config > config)
void queryPathInfoUncached (const StorePath &path, Callback< std::shared_ptr< const ValidPathInfo > > callback) noexcept override
bool isValidPathUncached (const StorePath &path) override
std::optional< TrustedFlag > isTrustedClient () override
std::optional< StorePath > queryPathFromHashPart (const std::string &hashPart) override
void addToStore (const ValidPathInfo &info, Source &source, RepairFlag repair, CheckSigsFlag checkSigs) override
StorePath addToStoreFromDump (Source &source, std::string_view name, FileSerialisationMethod dumpMethod=FileSerialisationMethod::NixArchive, ContentAddressMethod hashMethod=FileIngestionMethod::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references=StorePathSet(), RepairFlag repair=NoRepair) override
StorePath writeDerivation (const Derivation &drv, RepairFlag repair=NoRepair) override
Derivation readDerivation (const StorePath &drvPath) override
Derivation readInvalidDerivation (const StorePath &drvPath) override
void registerDrvOutputUnchecked (const Realisation &output) override
void queryRealisationUncached (const DrvOutput &drvOutput, Callback< std::shared_ptr< const UnkeyedRealisation > > callback) noexcept override
std::shared_ptr< MemorySourceAccessor > getMemoryFSAccessor (const StorePath &path, bool requireValidPath=true)
std::shared_ptr< SourceAccessor > getFSAccessor (const StorePath &path, bool requireValidPath=true) override
ref< SourceAccessor > getFSAccessor (bool requireValidPath) override
Public Member Functions inherited from nix::DummyStore
 DummyStore (ref< const Config > config)
bool operator== (const DummyStore &) const
Public Member Functions inherited from nix::Store
 operator const Config & () const
virtual void init ()
virtual ref< Builder > getBuilder (std::shared_ptr< Store > evalStore=nullptr)
std::filesystem::path followLinksToStore (std::string_view path) const
StorePath followLinksToStorePath (std::string_view path) const
bool isValidPath (const StorePath &path)
void substitutePaths (const StorePathSet &paths)
virtual StorePathSet queryValidPaths (const StorePathSet &paths, SubstituteFlag maybeSubstitute=NoSubstitute)
virtual StorePathSet queryAllValidPaths ()
ref< const ValidPathInfo > queryPathInfo (const StorePath &path)
void queryPathInfo (const StorePath &path, Callback< ref< const ValidPathInfo > > callback) noexcept
std::optional< std::shared_ptr< const ValidPathInfo > > queryPathInfoFromClientCache (const StorePath &path)
std::shared_ptr< const UnkeyedRealisation > queryRealisation (const DrvOutput &)
void queryRealisation (const DrvOutput &, Callback< std::shared_ptr< const UnkeyedRealisation > > callback) noexcept
virtual bool pathInfoIsUntrusted (const ValidPathInfo &)
virtual bool realisationIsUntrusted (const Realisation &)
virtual void queryReferrers (const StorePath &path, StorePathSet &referrers)
virtual StorePathSet queryValidDerivers (const StorePath &path)
virtual StorePathSet queryDerivationOutputs (const StorePath &path)
virtual std::map< std::string, std::optional< StorePath > > queryPartialDerivationOutputMap (const StorePath &path, Store *evalStore=nullptr)
virtual std::map< std::string, std::optional< StorePath > > queryStaticPartialDerivationOutputMap (const StorePath &path)
virtual std::optional< StorePath > queryStaticPartialDerivationOutput (const StorePath &path, const std::string &outputName)
OutputPathMap queryDerivationOutputMap (const StorePath &path, Store *evalStore=nullptr)
virtual StorePathSet querySubstitutablePaths (const StorePathSet &paths)
virtual void querySubstitutablePathInfos (const StorePathCAMap &paths, SubstitutablePathInfos &infos)
virtual void addMultipleToStore (PathsSource &&pathsToCopy, Activity &act, RepairFlag repair=NoRepair, CheckSigsFlag checkSigs=CheckSigs)
virtual StorePath addToStore (std::string_view name, const SourcePath &path, ContentAddressMethod method=ContentAddressMethod::Raw::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references=StorePathSet(), PathFilter &filter=defaultPathFilter, RepairFlag repair=NoRepair)
ValidPathInfo addToStoreSlow (std::string_view name, const SourcePath &path, ContentAddressMethod method=ContentAddressMethod::Raw::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references=StorePathSet(), std::optional< Hash > expectedCAHash={})
virtual void registerDrvOutput (const Realisation &output, CheckSigsFlag checkSigs)
virtual void narFromPath (const StorePath &path, Sink &sink)
virtual void addTempRoot (const StorePath &path)
virtual void addTempRoots (const StorePathSet &paths)
std::string makeValidityRegistration (const StorePathSet &paths, bool showDerivers, bool showHash)
virtual void optimiseStore ()
virtual bool verifyStore (bool checkContents, RepairFlag repair=NoRepair)
ref< SourceAccessor > requireStoreObjectAccessor (const StorePath &path, bool requireValidPath=true)
virtual void addSignatures (const StorePath &storePath, const std::set< Signature > &sigs)
void signPathInfo (ValidPathInfo &info)
void signRealisation (Realisation &)
Derivation derivationFromPath (const StorePath &drvPath)
virtual void computeFSClosure (const StorePathSet &paths, StorePathSet &out, bool flipDirection=false, bool includeOutputs=false, bool includeDerivers=false)
void computeFSClosure (const StorePath &path, StorePathSet &out, bool flipDirection=false, bool includeOutputs=false, bool includeDerivers=false)
virtual MissingPaths queryMissing (const std::vector< DerivedPath > &targets)
virtual StorePaths topoSortPaths (const StorePathSet &paths)
StorePathSet exportReferences (const StorePathSet &storePaths, const StorePathSet &inputPaths)
std::optional< StorePath > getBuildDerivationPath (const StorePath &)
void clearPathInfoCache ()
virtual void connect ()
virtual unsigned int getProtocol ()
virtual void setOptions ()
virtual std::optional< std::string > getVersion ()
Public Member Functions inherited from nix::StoreDirConfig
StorePath parseStorePath (std::string_view path) const
StorePath parseStorePathCanonical (std::string_view path) const
std::optional< StorePath > maybeParseStorePath (std::string_view path) const
std::string printStorePath (const StorePath &path) const
StringSet printStorePathSet (const StorePathSet &path) const
std::size_t maxCanonicalStorePathLen () const noexcept
bool isInStore (std::string_view path) const
bool isStorePath (std::string_view path) const
std::pair< StorePath, CanonPath > toStorePath (std::string_view path) const
StorePath makeStorePath (std::string_view type, std::string_view hash, std::string_view name) const
StorePath makeStorePath (std::string_view type, const Hash &hash, std::string_view name) const
StorePath makeOutputPath (std::string_view id, const Hash &hash, std::string_view name) const
StorePath makeFixedOutputPath (std::string_view name, const FixedOutputInfo &info) const
StorePath makeFixedOutputPathFromCA (std::string_view name, const ContentAddressWithReferences &ca) const
std::pair< StorePath, Hash > computeStorePath (std::string_view name, const SourcePath &path, ContentAddressMethod method=ContentAddressMethod::Raw::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const

Public Attributes

ref< WholeStoreViewAccessor > wholeStoreView = make_ref<WholeStoreViewAccessor>()
Public Attributes inherited from nix::DummyStore
ref< const Config > config
boost::concurrent_flat_map< StorePath, PathInfoAndContents > contents
boost::concurrent_flat_map< StorePath, Derivation > derivations
boost::concurrent_flat_map< StorePath, std::map< std::string, UnkeyedRealisation > > buildTrace
Public Attributes inherited from nix::Store
const Config & config
Public Attributes inherited from nix::StoreDirConfig
const std::string & storeDir

Additional Inherited Members

Static Public Attributes inherited from nix::Store
static constexpr const char * MissingName = "x"
Protected Member Functions inherited from nix::Store
void invalidatePathInfoCacheFor (const StorePath &path)
 Store (const Store::Config &config)
void unsupported (const std::string &op)
Protected Attributes inherited from nix::Store
std::shared_ptr< SharedSync< LRUCache< StorePath, PathInfoCacheValue > > > pathInfoCache
std::shared_ptr< NarInfoDiskCache > diskCache

Member Function Documentation

◆ addToStore()

void nix::DummyStoreImpl::addToStore ( const ValidPathInfo & info,
Source & narSource,
RepairFlag repair,
CheckSigsFlag checkSigs )
inlineoverridevirtual

Import a path into the store. Note that the entire NAR may not be read from narSource, e.g. if the path is already valid.

Implements nix::Store.

◆ addToStoreFromDump()

StorePath nix::DummyStoreImpl::addToStoreFromDump ( Source & dump,
std::string_view name,
FileSerialisationMethod dumpMethod = FileSerialisationMethod::NixArchive,
ContentAddressMethod hashMethod = FileIngestionMethod::NixArchive,
HashAlgorithm hashAlgo = HashAlgorithm::SHA256,
const StorePathSet & references = StorePathSet(),
RepairFlag repair = NoRepair )
inlineoverridevirtual

Like addToStore(), but the contents of the path are contained in dump, which is either a NAR serialisation (if recursive == true) or simply the contents of a regular file (if recursive == false).

dump may be drained.

Parameters
dumpMethodWhat serialisation format is dump, i.e. how to deserialize it. Must either match hashMethod or be FileSerialisationMethod::NixArchive.
hashMethodHow content addressing? Need not match be the same as dumpMethod.
Todo
remove?

Implements nix::Store.

◆ getFSAccessor() [1/2]

ref< SourceAccessor > nix::DummyStoreImpl::getFSAccessor ( bool requireValidPath)
inlineoverridevirtual
Returns
An object to access files in the Nix store, across all store objects.

Implements nix::Store.

◆ getFSAccessor() [2/2]

std::shared_ptr< SourceAccessor > nix::DummyStoreImpl::getFSAccessor ( const StorePath & path,
bool requireValidPath = true )
inlineoverridevirtual
Returns
An object to access files for a specific store object in the Nix store.
nullptr if the store doesn't contain an object at the given path.

Implements nix::Store.

◆ isTrustedClient()

std::optional< TrustedFlag > nix::DummyStoreImpl::isTrustedClient ( )
inlineoverridevirtual

The dummy store is incapable of not trusting! :)

Implements nix::Store.

◆ isValidPathUncached()

bool nix::DummyStoreImpl::isValidPathUncached ( const StorePath & path)
inlineoverridevirtual

Do this to avoid queryPathInfoUncached computing PathInfo that we don't need just to return a bool.

Reimplemented from nix::Store.

◆ queryPathFromHashPart()

std::optional< StorePath > nix::DummyStoreImpl::queryPathFromHashPart ( const std::string & hashPart)
inlineoverridevirtual

Query the full store path given the hash part of a valid store path, or empty if the path doesn't exist.

Implements nix::Store.

◆ queryPathInfoUncached()

void nix::DummyStoreImpl::queryPathInfoUncached ( const StorePath & path,
Callback< std::shared_ptr< const ValidPathInfo > > callback )
inlineoverridevirtualnoexcept

Implements nix::Store.

◆ queryRealisationUncached()

void nix::DummyStoreImpl::queryRealisationUncached ( const DrvOutput & drvOutput,
Callback< std::shared_ptr< const UnkeyedRealisation > > callback )
inlineoverridevirtualnoexcept

Implements nix::Store.

◆ readDerivation()

Derivation nix::DummyStoreImpl::readDerivation ( const StorePath & drvPath)
inlineoverridevirtual

Read a derivation (which must already be valid).

Reimplemented from nix::Store.

◆ readInvalidDerivation()

Derivation nix::DummyStoreImpl::readInvalidDerivation ( const StorePath & drvPath)
inlineoverridevirtual

No such thing as an "invalid derivation" with the dummy store

Reimplemented from nix::Store.

◆ registerDrvOutputUnchecked()

void nix::DummyStoreImpl::registerDrvOutputUnchecked ( const Realisation & output)
inlineoverridevirtual

Add a mapping indicating that deriver!outputName maps to the output path output.

This is redundant for known-input-addressed and fixed-output derivations as this information is already present in the drv file, but necessary for floating-ca derivations and their dependencies as there's no way to retrieve this information otherwise.

The method that does not perform signature checks is internal only, users should explicitly set the checkSigs argument to NoCheckSigs.

Implements nix::Store.

◆ writeDerivation()

StorePath nix::DummyStoreImpl::writeDerivation ( const Derivation & drv,
RepairFlag repair = NoRepair )
inlineoverridevirtual

Write a derivation to the Nix store, and return its path.

Reimplemented from nix::Store.

Member Data Documentation

◆ wholeStoreView

ref<WholeStoreViewAccessor> nix::DummyStoreImpl::wholeStoreView = make_ref<WholeStoreViewAccessor>()

This view conceptually just borrows the file systems objects of each store object from contents, and combines them together into one store-wide source accessor.

This is needed just in order to implement Store::getFSAccessor.


The documentation for this struct was generated from the following file:
  • libstore/dummy-store.cc