23template<
typename T>
class Pool;
27 using StoreConfig::StoreConfig;
29 const Setting<int> maxConnections{
this, 1,
"max-connections",
30 "Maximum number of concurrent connections to the Nix daemon."};
33 std::numeric_limits<unsigned int>::max(),
35 "Maximum age of a connection before it is closed."};
42class RemoteStore :
public virtual Store,
55 kj::Promise<Result<bool>> isValidPathUncached(
const StorePath & path)
override;
57 kj::Promise<Result<StorePathSet>>
queryValidPaths(
const StorePathSet & paths,
58 SubstituteFlag maybeSubstitute = NoSubstitute)
override;
62 kj::Promise<Result<std::shared_ptr<const ValidPathInfo>>>
65 kj::Promise<Result<void>>
72 kj::Promise<Result<std::map<std::string, std::optional<StorePath>>>>
74 kj::Promise<Result<std::optional<StorePath>>>
80 SubstitutablePathInfos & infos)
override;
85 kj::Promise<Result<ref<const ValidPathInfo>>>
addCAToStore(
87 std::string_view name,
90 const StorePathSet & references,
98 std::string_view name,
100 HashType hashAlgo = HashType::SHA256,
101 RepairFlag repair = NoRepair,
102 const StorePathSet & references = StorePathSet()
106 RepairFlag repair, CheckSigsFlag checkSigs)
override;
112 CheckSigsFlag checkSigs)
override;
115 std::string_view name,
117 const StorePathSet & references,
118 RepairFlag repair)
override;
122 kj::Promise<Result<std::shared_ptr<const Realisation>>>
123 queryRealisationUncached(
const DrvOutput &)
override;
126 const std::vector<DerivedPath> & paths,
128 std::shared_ptr<Store> evalStore
132 const std::vector<DerivedPath> & paths,
134 std::shared_ptr<Store> evalStore)
override;
144 kj::Promise<Result<Roots>>
findRoots(
bool censor)
override;
146 kj::Promise<Result<void>>
151 kj::Promise<Result<bool>>
verifyStore(
bool checkContents, RepairFlag repair)
override;
162 try {
unsupported(
"repairPath"); }
catch (...) {
return {result::current_exception()}; }
164 kj::Promise<Result<void>>
165 addSignatures(
const StorePath & storePath,
const StringSet & sigs)
override;
167 kj::Promise<Result<void>>
queryMissing(
const std::vector<DerivedPath> & targets,
168 StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
169 uint64_t & downloadSize, uint64_t & narSize)
override;
171 kj::Promise<Result<void>> addBuildLog(
const StorePath & drvPath, std::string_view log)
override;
173 kj::Promise<Result<std::optional<std::string>>> getVersion()
override;
175 kj::Promise<Result<void>>
connect()
override;
177 kj::Promise<Result<unsigned int>>
getProtocol()
override;
179 kj::Promise<Result<std::optional<TrustedFlag>>>
isTrustedClient()
override;
183 ref<Connection> openConnectionWrapper();
187 virtual ref<Connection> openConnection() = 0;
191 ref<Pool<Connection>> connections;
195 kj::Promise<Result<void>>
setOptions()
override;
199 kj::Promise<Result<ConnectionHandle>> getConnection();
205 virtual kj::Promise<Result<box_ptr<Source>>>
narFromPath(
const StorePath & path)
override;
209 std::atomic_bool failed{
false};
214 Sync<ThreadPool> handlerThreads{
215 std::in_place,
"remote stderr", std::numeric_limits<size_t>::max()
218 kj::Promise<Result<void>> copyDrvsFromEvalStore(
219 const std::vector<DerivedPath> & paths,
220 std::shared_ptr<Store> evalStore);
Definition processes.hh:24
Definition file-descriptor.hh:79
kj::Promise< Result< void > > queryMissing(const std::vector< DerivedPath > &targets, StorePathSet &willBuild, StorePathSet &willSubstitute, StorePathSet &unknown, uint64_t &downloadSize, uint64_t &narSize) override
Definition remote-store.cc:934
virtual ref< FSAccessor > getFSAccessor() override
Definition remote-store.cc:1024
kj::Promise< Result< StorePath > > addTextToStore(std::string_view name, std::string_view s, const StorePathSet &references, RepairFlag repair) override
Definition remote-store.cc:611
kj::Promise< Result< void > > connect() override
Definition remote-store.cc:976
kj::Promise< Result< void > > addToStore(const ValidPathInfo &info, AsyncInputStream &nar, RepairFlag repair, CheckSigsFlag checkSigs) override
Definition remote-store.cc:529
kj::Promise< Result< void > > querySubstitutablePathInfos(const StorePathCAMap &paths, SubstitutablePathInfos &infos) override
Definition remote-store.cc:260
kj::Promise< Result< void > > queryReferrers(const StorePath &path, StorePathSet &referrers) override
Definition remote-store.cc:318
kj::Promise< Result< StorePathSet > > queryAllValidPaths() override
Definition remote-store.cc:237
kj ::Promise< Result< void > > buildPaths(const std::vector< DerivedPath > &paths, BuildMode buildMode, std::shared_ptr< Store > evalStore) override
Definition remote-store.cc:698
kj::Promise< Result< void > > addTempRoot(const StorePath &path) override
Definition remote-store.cc:839
kj::Promise< Result< void > > setOptions() override
Definition remote-store.cc:202
kj::Promise< Result< Roots > > findRoots(bool censor) override
Definition remote-store.cc:851
kj::Promise< Result< unsigned int > > getProtocol() override
Definition remote-store.cc:985
kj::Promise< Result< void > > ensurePath(const StorePath &path) override
Definition remote-store.cc:827
kj::Promise< Result< void > > repairPath(const StorePath &path) override
Definition remote-store.hh:161
kj::Promise< Result< void > > addMultipleToStore(PathsSource &pathsToCopy, Activity &act, RepairFlag repair, CheckSigsFlag checkSigs) override
Definition remote-store.cc:570
kj::Promise< Result< StorePathSet > > queryValidPaths(const StorePathSet &paths, SubstituteFlag maybeSubstitute=NoSubstitute) override
Definition remote-store.cc:222
kj ::Promise< Result< BuildResult > > buildDerivation(const StorePath &drvPath, const BasicDerivation &drv, BuildMode buildMode) override
Definition remote-store.cc:812
virtual kj::Promise< Result< box_ptr< Source > > > narFromPath(const StorePath &path) override
Definition remote-store.cc:1011
kj::Promise< Result< bool > > verifyStore(bool checkContents, RepairFlag repair) override
Definition remote-store.cc:910
kj::Promise< Result< void > > registerDrvOutput(const Realisation &info) override
Definition remote-store.cc:623
kj::Promise< Result< StorePathSet > > querySubstitutablePaths(const StorePathSet &paths) override
Definition remote-store.cc:248
kj::Promise< Result< std::optional< TrustedFlag > > > isTrustedClient() override
Definition remote-store.cc:993
kj::Promise< Result< void > > optimiseStore() override
Definition remote-store.cc:898
kj::Promise< Result< std::shared_ptr< const ValidPathInfo > > > queryPathInfoUncached(const StorePath &path) override
Definition remote-store.cc:294
kj::Promise< Result< void > > addSignatures(const StorePath &storePath, const StringSet &sigs) override
Definition remote-store.cc:922
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()) override
Definition remote-store.cc:514
kj::Promise< Result< ref< const ValidPathInfo > > > addCAToStore(AsyncInputStream &dump, std::string_view name, ContentAddressMethod caMethod, HashType hashType, const StorePathSet &references, RepairFlag repair)
Definition remote-store.cc:413
kj::Promise< Result< std::map< std::string, std::optional< StorePath > > > > queryPartialDerivationOutputMap(const StorePath &path, Store *evalStore=nullptr) override
Definition remote-store.cc:359
kj::Promise< Result< std::vector< KeyedBuildResult > > > buildPathsWithResults(const std::vector< DerivedPath > &paths, BuildMode buildMode, std::shared_ptr< Store > evalStore) override
Definition remote-store.cc:715
kj::Promise< Result< StorePathSet > > queryValidDerivers(const StorePath &path) override
Definition remote-store.cc:332
kj::Promise< Result< StorePathSet > > queryDerivationOutputs(const StorePath &path) override
Definition remote-store.cc:343
kj::Promise< Result< void > > collectGarbage(const GCOptions &options, GCResults &results) override
Definition remote-store.cc:870
kj::Promise< Result< std::optional< StorePath > > > queryPathFromHashPart(const std::string &hashPart) override
Definition remote-store.cc:400
void unsupported(const std::string &op)
Definition store-api.hh:951
std::vector< std::pair< ValidPathInfo, std::function< kj::Promise< Result< box_ptr< AsyncInputStream > > >()> > > PathsSource
Definition store-api.hh:542
FileIngestionMethod
Definition content-address.hh:38
@ Recursive
Definition content-address.hh:47
Definition logging.hh:185
Definition derivations.hh:274
Definition content-address.hh:65
Definition realisation.hh:24
Definition serialise.hh:124
Definition serialise.hh:156
Definition gc-store.hh:22
Definition gc-store.hh:73
Definition gc-store.hh:121
Definition log-store.hh:10
Definition realisation.hh:49
Definition remote-store.hh:26
Definition remote-store-connection.hh:102
Definition remote-store-connection.hh:18
Definition path-info.hh:83