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

Classes

struct  Connection

Public Member Functions

LegacySSHStoreConfigWithLogconfig () override
const LegacySSHStoreConfigWithLogconfig () const override
 LegacySSHStore (const std::string &scheme, const std::string &host, LegacySSHStoreConfigWithLog config)
ref< ConnectionopenConnection ()
std::string getUri () override
kj::Promise< Result< std::shared_ptr< const ValidPathInfo > > > queryPathInfoUncached (const StorePath &path) override
kj::Promise< Result< void > > addToStore (const ValidPathInfo &info, AsyncInputStream &source, RepairFlag repair, CheckSigsFlag checkSigs) override
kj::Promise< Result< box_ptr< Source > > > narFromPath (const StorePath &path) override
kj::Promise< Result< std::optional< StorePath > > > queryPathFromHashPart (const std::string &hashPart) override
kj::Promise< Result< StorePath > > addToStoreRecursive (std::string_view name, const PreparedDump &source, HashType hashAlgo, RepairFlag repair) override
kj::Promise< Result< StorePath > > addToStoreFlat (std::string_view name, const Path &srcPath, HashType hashAlgo, RepairFlag repair) override
kj::Promise< Result< StorePath > > addTextToStore (std::string_view name, std::string_view s, const StorePathSet &references, RepairFlag repair) override
kj::Promise< Result< BuildResult > > buildDerivation (const StorePath &drvPath, const BasicDerivation &drv, BuildMode buildMode) override
kj ::Promise< Result< void > > buildPaths (const std::vector< DerivedPath > &drvPaths, BuildMode buildMode, std::shared_ptr< Store > evalStore) override
kj::Promise< Result< void > > ensurePath (const StorePath &path) override
virtual ref< FSAccessorgetFSAccessor () override
kj::Promise< Result< void > > repairPath (const StorePath &path) override
kj::Promise< Result< void > > computeFSClosure (const StorePathSet &paths, StorePathSet &out, bool flipDirection=false, bool includeOutputs=false, bool includeDerivers=false) override
kj::Promise< Result< StorePathSet > > queryValidPaths (const StorePathSet &paths, SubstituteFlag maybeSubstitute=NoSubstitute) override
kj::Promise< Result< void > > connect () override
kj::Promise< Result< unsigned int > > getProtocol () override
kj::Promise< Result< std::optional< TrustedFlag > > > isTrustedClient () override
kj::Promise< Result< std::shared_ptr< const Realisation > > > queryRealisationUncached (const DrvOutput &) override
Public Member Functions inherited from nix::Store
virtual std::optional< AssociatedCredentialsassociatedCredentials () const
virtual kj::Promise< Result< void > > init ()
StorePath parseStorePath (std::string_view path) const
std::optional< StorePathmaybeParseStorePath (std::string_view path) const
std::string printStorePath (const StorePath &path) const
StorePathSet parseStorePathSet (const PathSet &paths) const
PathSet printStorePathSet (const StorePathSet &path) const
std::string showPaths (const StorePathSet &paths)
bool isInStore (PathView path) const
bool isStorePath (std::string_view path) const
std::pair< StorePath, PathtoStorePath (PathView path) const
Path followLinksToStore (std::string_view path) const
StorePath followLinksToStorePath (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 makeTextPath (std::string_view name, const TextInfo &info) const
StorePath makeFixedOutputPathFromCA (std::string_view name, const ContentAddressWithReferences &ca) const
StorePath computeStorePathForPathRecursive (std::string_view name, const PreparedDump &source) const
StorePath computeStorePathForPathFlat (std::string_view name, const Path &srcPath) const
StorePath computeStorePathForText (std::string_view name, std::string_view s, const StorePathSet &references) const
kj::Promise< Result< bool > > isValidPath (const StorePath &path)
kj::Promise< Result< void > > substitutePaths (const StorePathSet &paths)
virtual kj::Promise< Result< StorePathSet > > queryAllValidPaths ()
kj::Promise< Result< ref< const ValidPathInfo > > > queryPathInfo (const StorePath &path)
kj::Promise< Result< std::shared_ptr< const Realisation > > > queryRealisation (const DrvOutput &)
virtual bool pathInfoIsUntrusted (const ValidPathInfo &)
virtual bool realisationIsUntrusted (const Realisation &)
virtual kj::Promise< Result< void > > queryReferrers (const StorePath &path, StorePathSet &referrers)
virtual kj::Promise< Result< StorePathSet > > queryValidDerivers (const StorePath &path)
virtual kj::Promise< Result< StorePathSet > > queryDerivationOutputs (const StorePath &path)
virtual kj::Promise< Result< std::map< std::string, std::optional< StorePath > > > > queryPartialDerivationOutputMap (const StorePath &path, Store *evalStore=nullptr)
virtual kj::Promise< Result< std::map< std::string, std::optional< StorePath > > > > queryStaticPartialDerivationOutputMap (const StorePath &path)
kj::Promise< Result< OutputPathMap > > queryDerivationOutputMap (const StorePath &path, Store *evalStore=nullptr)
virtual kj::Promise< Result< StorePathSet > > querySubstitutablePaths (const StorePathSet &paths)
virtual kj::Promise< Result< void > > querySubstitutablePathInfos (const StorePathCAMap &paths, SubstitutablePathInfos &infos)
virtual kj::Promise< Result< void > > addMultipleToStore (PathsSource &pathsToCopy, Activity &act, RepairFlag repair=NoRepair, CheckSigsFlag checkSigs=CheckSigs)
kj::Promise< Result< ValidPathInfo > > addToStoreSlow (std::string_view name, const Path &srcPath, FileIngestionMethod method=FileIngestionMethod::Recursive, HashType hashAlgo=HashType::SHA256, std::optional< Hash > expectedCAHash={})
virtual kj::Promise< Result< StorePath > > addToStoreFromDump (AsyncInputStream &dump, std::string_view name, FileIngestionMethod method=FileIngestionMethod::Recursive, HashType hashAlgo=HashType::SHA256, RepairFlag repair=NoRepair, const StorePathSet &references=StorePathSet())
virtual kj::Promise< Result< void > > registerDrvOutput (const Realisation &output)
virtual kj::Promise< Result< void > > registerDrvOutput (const Realisation &output, CheckSigsFlag checkSigs)
virtual kj::Promise< Result< std::vector< KeyedBuildResult > > > buildPathsWithResults (const std::vector< DerivedPath > &paths, BuildMode buildMode=bmNormal, std::shared_ptr< Store > evalStore=nullptr)
virtual kj::Promise< Result< void > > addTempRoot (const StorePath &path)
kj::Promise< Result< std::string > > makeValidityRegistration (const StorePathSet &paths, bool showDerivers, bool showHash)
kj::Promise< Result< JSON > > pathInfoToJSON (const StorePathSet &storePaths, bool includeImpureInfo, bool showClosureSize, Base hashBase=Base::Base32, AllowInvalidFlag allowInvalid=DisallowInvalid)
kj::Promise< Result< std::pair< uint64_t, uint64_t > > > getClosureSize (const StorePath &storePath)
virtual kj::Promise< Result< void > > optimiseStore ()
virtual kj::Promise< Result< bool > > verifyStore (bool checkContents, RepairFlag repair=NoRepair)
virtual kj::Promise< Result< void > > addSignatures (const StorePath &storePath, const StringSet &sigs)
kj::Promise< Result< Derivation > > derivationFromPath (const StorePath &drvPath)
kj::Promise< Result< Derivation > > readDerivation (const StorePath &drvPath)
kj::Promise< Result< Derivation > > readInvalidDerivation (const StorePath &drvPath)
kj::Promise< Result< void > > computeFSClosure (const StorePath &path, StorePathSet &out, bool flipDirection=false, bool includeOutputs=false, bool includeDerivers=false)
virtual kj::Promise< Result< void > > queryMissing (const std::vector< DerivedPath > &targets, StorePathSet &willBuild, StorePathSet &willSubstitute, StorePathSet &unknown, uint64_t &downloadSize, uint64_t &narSize)
kj::Promise< Result< StorePaths > > topoSortPaths (const StorePathSet &paths)
kj::Promise< Result< void > > exportPaths (const StorePathSet &paths, Sink &sink)
kj::Promise< Result< void > > exportPath (const StorePath &path, Sink &sink)
kj::Promise< Result< StorePaths > > importPaths (Source &source, CheckSigsFlag checkSigs=CheckSigs)
kj::Promise< Result< Stats<> > > getStats ()
kj::Promise< Result< StorePathSet > > exportReferences (const StorePathSet &storePaths, const StorePathSet &inputPaths)
kj::Promise< Result< std::optional< StorePath > > > getBuildDerivationPath (const StorePath &)
kj::Promise< void > clearPathInfoCache ()
virtual Path toRealPath (const Path &storePath)
Path toRealPath (const StorePath &storePath)
virtual kj::Promise< Result< void > > setOptions ()
virtual kj::Promise< Result< std::optional< std::string > > > getVersion ()

Static Public Member Functions

static std::set< std::string > uriSchemes ()

Public Attributes

LegacySSHStoreConfigWithLog config_
std::string host
ref< Pool< Connection > > connections
SSH ssh

Additional Inherited Members

Public Types inherited from nix::Store
using PathsSource
Static Public Attributes inherited from nix::Store
static constexpr const char * MissingName = "x"
Protected Member Functions inherited from nix::Store
 Store (const StoreConfig &config)
virtual kj::Promise< Result< bool > > isValidPathUncached (const StorePath &path)
void unsupported (const std::string &op)
Protected Attributes inherited from nix::Store
Sync< State, AsyncMutex > state
std::shared_ptr< NarInfoDiskCachediskCache
Stats< std::atomic > stats

Member Function Documentation

◆ addTextToStore()

kj::Promise< Result< StorePath > > nix::LegacySSHStore::addTextToStore ( std::string_view name,
std::string_view s,
const StorePathSet & references,
RepairFlag repair )
inlineoverridevirtual

Like addToStore, but the contents written to the output path is a regular file containing the given string.

Implements nix::Store.

◆ addToStore()

kj::Promise< Result< void > > nix::LegacySSHStore::addToStore ( const ValidPathInfo & info,
AsyncInputStream & narSource,
RepairFlag repair,
CheckSigsFlag checkSigs )
inlineoverridevirtual

Import a path into the store.

Implements nix::Store.

◆ addToStoreFlat()

kj::Promise< Result< StorePath > > nix::LegacySSHStore::addToStoreFlat ( std::string_view name,
const Path & srcPath,
HashType hashAlgo,
RepairFlag repair )
inlineoverridevirtual

Reimplemented from nix::Store.

◆ addToStoreRecursive()

kj::Promise< Result< StorePath > > nix::LegacySSHStore::addToStoreRecursive ( std::string_view name,
const PreparedDump & source,
HashType hashAlgo,
RepairFlag repair )
inlineoverridevirtual

Copy the contents of a path to the store and register the validity the resulting path.

Returns
The resulting path is returned.
Parameters
filterThis function can be used to exclude files (see libutil/archive.hh).

Reimplemented from nix::Store.

◆ buildDerivation()

kj::Promise< Result< BuildResult > > nix::LegacySSHStore::buildDerivation ( const StorePath & drvPath,
const BasicDerivation & drv,
BuildMode buildMode )
inlineoverridevirtual

Build a single non-materialized derivation (i.e. not from an on-disk .drv file).

Parameters
drvPathThis is used to deduplicate worker goals so it is imperative that is correct. That said, it doesn't literally need to be store path that would be calculated from writing this derivation to the store: it is OK if it instead is that of a Derivation which would resolve to this (by taking the outputs of it's input derivations and adding them as input sources) such that the build time referenceable-paths are the same.

In the input-addressed case, we usually do use an "original" unresolved derivations's path, as that is what will be used in the buildPaths case. Also, the input-addressed output paths are verified only by that contents of that specific unresolved derivation, so it is nice to keep that information around so if the original derivation is ever obtained later, it can be verified whether the trusted user in fact used the proper output path.

In the content-addressed case, we want to always use the resolved drv path calculated from the provided derivation. This serves two purposes:

  • It keeps the operation trustless, by ruling out a maliciously invalid drv path corresponding to a non-resolution-equivalent derivation.
  • For the floating case in particular, it ensures that the derivation to output mapping respects the resolution equivalence relation, so one cannot choose different resolution-equivalent derivations to subvert dependency coherence (i.e. the property that one doesn't end up with multiple different versions of dependencies without explicitly choosing to allow it).

Reimplemented from nix::Store.

◆ buildPaths()

kj ::Promise< Result< void > > nix::LegacySSHStore::buildPaths ( const std::vector< DerivedPath > & paths,
BuildMode buildMode,
std::shared_ptr< Store > evalStore )
inlineoverridevirtual

For each path, if it's a derivation, build it. Building a derivation means ensuring that the output paths are valid. If they are already valid, this is a no-op. Otherwise, validity can be reached in two ways. First, if the output paths is substitutable, then build the path that way. Second, the output paths can be created by running the builder, after recursively building any sub-derivations. For inputs that are not derivations, substitute them.

Reimplemented from nix::Store.

◆ computeFSClosure()

kj::Promise< Result< void > > nix::LegacySSHStore::computeFSClosure ( const StorePathSet & paths,
StorePathSet & out,
bool flipDirection = false,
bool includeOutputs = false,
bool includeDerivers = false )
inlineoverridevirtual
Parameters
[out]outPlace in here the set of all store paths in the file system closure of storePath; that is, all paths than can be directly or indirectly reached from it. out is not cleared.
flipDirectionIf true, the set of paths that can reach storePath is returned; that is, the closures under the referrers relation instead of the references relation is returned.

Reimplemented from nix::Store.

◆ config() [1/2]

const LegacySSHStoreConfigWithLog & nix::LegacySSHStore::config ( ) const
inlineoverridevirtual

Implements nix::Store.

◆ config() [2/2]

LegacySSHStoreConfigWithLog & nix::LegacySSHStore::config ( )
inlineoverridevirtual

Implements nix::Store.

◆ connect()

kj::Promise< Result< void > > nix::LegacySSHStore::connect ( )
inlineoverridevirtual

Establish a connection to the store, for store types that have a notion of connection. Otherwise this is a no-op.

Reimplemented from nix::Store.

◆ ensurePath()

kj::Promise< Result< void > > nix::LegacySSHStore::ensurePath ( const StorePath & path)
inlineoverridevirtual

Ensure that a path is valid. If it is not currently valid, it may be made valid by running a substitute (if defined for the path).

Reimplemented from nix::Store.

◆ getFSAccessor()

virtual ref< FSAccessor > nix::LegacySSHStore::getFSAccessor ( )
inlineoverridevirtual
Returns
An object to access files in the Nix store.

Implements nix::Store.

◆ getProtocol()

kj::Promise< Result< unsigned int > > nix::LegacySSHStore::getProtocol ( )
inlineoverridevirtual

Get the protocol version of this store or it's connection.

Reimplemented from nix::Store.

◆ getUri()

std::string nix::LegacySSHStore::getUri ( )
inlineoverridevirtual

Implements nix::Store.

◆ isTrustedClient()

kj::Promise< Result< std::optional< TrustedFlag > > > nix::LegacySSHStore::isTrustedClient ( )
inlineoverridevirtual

The legacy ssh protocol doesn't support checking for trusted-user. Try using ssh-ng:// instead if you want to know.

Implements nix::Store.

◆ narFromPath()

kj::Promise< Result< box_ptr< Source > > > nix::LegacySSHStore::narFromPath ( const StorePath & path)
inlineoverridevirtual

Generate a NAR dump of a store path.

Implements nix::Store.

◆ queryPathFromHashPart()

kj::Promise< Result< std::optional< StorePath > > > nix::LegacySSHStore::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()

kj::Promise< Result< std::shared_ptr< const ValidPathInfo > > > nix::LegacySSHStore::queryPathInfoUncached ( const StorePath & path)
inlineoverridevirtual

Queries the path info without caching. Note to implementors: should return nullptr when the path is not found.

Implements nix::Store.

◆ queryRealisationUncached()

kj::Promise< Result< std::shared_ptr< const Realisation > > > nix::LegacySSHStore::queryRealisationUncached ( const DrvOutput & )
inlineoverridevirtual

Implements nix::Store.

◆ queryValidPaths()

kj::Promise< Result< StorePathSet > > nix::LegacySSHStore::queryValidPaths ( const StorePathSet & paths,
SubstituteFlag maybeSubstitute = NoSubstitute )
inlineoverridevirtual

Query which of the given paths is valid. Optionally, try to substitute missing paths.

Reimplemented from nix::Store.

◆ repairPath()

kj::Promise< Result< void > > nix::LegacySSHStore::repairPath ( const StorePath & path)
inlineoverridevirtual

The default instance would schedule the work on the client side, but for consistency with buildPaths and buildDerivation it should happen on the remote side.

We make this fail for now so we can add implement this properly later without it being a breaking change.

Reimplemented from nix::Store.


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