aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-20 17:54:57 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-23 22:42:06 +0000
commit85f2e9e8fa4f7452a05cfffc901d118a7c861d0a (patch)
treed5ba9678bd99592b7bc2bfbccd7caf471f202062 /src
parent450c3500f1e3fb619636c0a29d65300020f99d7d (diff)
Expose schedule entrypoints to all stores
Remote stores still override so the other end schedules.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/binary-cache-store.hh7
-rw-r--r--src/libstore/build/entry-points.cc (renamed from src/libstore/build/local-store-build.cc)6
-rw-r--r--src/libstore/dummy-store.cc7
-rw-r--r--src/libstore/local-store.hh9
-rw-r--r--src/libstore/store-api.cc23
-rw-r--r--src/libstore/store-api.hh6
6 files changed, 6 insertions, 52 deletions
diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/binary-cache-store.hh
index 443a53cac..c2163166c 100644
--- a/src/libstore/binary-cache-store.hh
+++ b/src/libstore/binary-cache-store.hh
@@ -108,13 +108,6 @@ public:
void narFromPath(const StorePath & path, Sink & sink) override;
- BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
- BuildMode buildMode) override
- { unsupported("buildDerivation"); }
-
- void ensurePath(const StorePath & path) override
- { unsupported("ensurePath"); }
-
ref<FSAccessor> getFSAccessor() override;
void addSignatures(const StorePath & storePath, const StringSet & sigs) override;
diff --git a/src/libstore/build/local-store-build.cc b/src/libstore/build/entry-points.cc
index c91cda2fd..9f97d40ba 100644
--- a/src/libstore/build/local-store-build.cc
+++ b/src/libstore/build/entry-points.cc
@@ -5,7 +5,7 @@
namespace nix {
-void LocalStore::buildPaths(const std::vector<StorePathWithOutputs> & drvPaths, BuildMode buildMode)
+void Store::buildPaths(const std::vector<StorePathWithOutputs> & drvPaths, BuildMode buildMode)
{
Worker worker(*this);
@@ -43,7 +43,7 @@ void LocalStore::buildPaths(const std::vector<StorePathWithOutputs> & drvPaths,
}
}
-BuildResult LocalStore::buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
+BuildResult Store::buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
BuildMode buildMode)
{
Worker worker(*this);
@@ -63,7 +63,7 @@ BuildResult LocalStore::buildDerivation(const StorePath & drvPath, const BasicDe
}
-void LocalStore::ensurePath(const StorePath & path)
+void Store::ensurePath(const StorePath & path)
{
/* If the path is already valid, we're done. */
if (isValidPath(path)) return;
diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc
index 3c7caf8f2..8f26af685 100644
--- a/src/libstore/dummy-store.cc
+++ b/src/libstore/dummy-store.cc
@@ -55,13 +55,6 @@ struct DummyStore : public virtual DummyStoreConfig, public virtual Store
void narFromPath(const StorePath & path, Sink & sink) override
{ unsupported("narFromPath"); }
- void ensurePath(const StorePath & path) override
- { unsupported("ensurePath"); }
-
- BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
- BuildMode buildMode) override
- { unsupported("buildDerivation"); }
-
std::optional<const Realisation> queryRealisation(const DrvOutput&) override
{ unsupported("queryRealisation"); }
};
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index d97645058..aa5de31f0 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -133,15 +133,6 @@ public:
StorePath addTextToStore(const string & name, const string & s,
const StorePathSet & references, RepairFlag repair) override;
- void buildPaths(
- const std::vector<StorePathWithOutputs> & paths,
- BuildMode buildMode) override;
-
- BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
- BuildMode buildMode) override;
-
- void ensurePath(const StorePath & path) override;
-
void addTempRoot(const StorePath & path) override;
void addIndirectRoot(const Path & path) override;
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 7aca22bde..f12a564a1 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -747,29 +747,6 @@ const Store::Stats & Store::getStats()
}
-void Store::buildPaths(const std::vector<StorePathWithOutputs> & paths, BuildMode buildMode)
-{
- StorePathSet paths2;
-
- for (auto & path : paths) {
- if (path.path.isDerivation()) {
- auto outPaths = queryPartialDerivationOutputMap(path.path);
- for (auto & outputName : path.outputs) {
- auto currentOutputPathIter = outPaths.find(outputName);
- if (currentOutputPathIter == outPaths.end() ||
- !currentOutputPathIter->second ||
- !isValidPath(*currentOutputPathIter->second))
- unsupported("buildPaths");
- }
- } else
- paths2.insert(path.path);
- }
-
- if (queryValidPaths(paths2).size() != paths2.size())
- unsupported("buildPaths");
-}
-
-
void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
const StorePath & storePath, RepairFlag repair, CheckSigsFlag checkSigs)
{
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index e3de6db17..4db980fe9 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -523,17 +523,17 @@ public:
explicitly choosing to allow it).
*/
virtual BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv,
- BuildMode buildMode = bmNormal) = 0;
+ BuildMode buildMode = bmNormal);
/* 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). */
- virtual void ensurePath(const StorePath & path) = 0;
+ virtual void ensurePath(const StorePath & path);
/* Add a store path as a temporary root of the garbage collector.
The root disappears as soon as we exit. */
virtual void addTempRoot(const StorePath & path)
- { unsupported("addTempRoot"); }
+ { warn("not creating temp root, store doesn't support GC"); }
/* Add an indirect root, which is merely a symlink to `path' from
/nix/var/nix/gcroots/auto/<hash of `path'>. `path' is supposed