aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-16 14:54:04 +0100
committerGitHub <noreply@github.com>2020-12-16 14:54:04 +0100
commitae3c3e3bb29cce34c98320f1fce4da63436f2bc8 (patch)
treef6a419592ed8fb3782f7420a62a35882e86484d2 /src
parentfdc8e7cbe7728cc1d855ab5f56fc8451f2eb9ce3 (diff)
parent6e899278d305da904fb766937f56344841c022b3 (diff)
Merge pull request #4370 from NixOS/ca/more-precise-build-noop
Better detect when `buildPaths` would be a no-op
Diffstat (limited to 'src')
-rw-r--r--src/libstore/store-api.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 7bf9235b2..50905bb33 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -729,9 +729,17 @@ void Store::buildPaths(const std::vector<StorePathWithOutputs> & paths, BuildMod
StorePathSet paths2;
for (auto & path : paths) {
- if (path.path.isDerivation())
- unsupported("buildPaths");
- paths2.insert(path.path);
+ if (path.path.isDerivation()) {
+ if (settings.isExperimentalFeatureEnabled("ca-derivations")) {
+ for (auto & outputName : path.outputs) {
+ if (!queryRealisation({path.path, outputName}))
+ unsupported("buildPaths");
+ }
+ } else
+ unsupported("buildPaths");
+
+ } else
+ paths2.insert(path.path);
}
if (queryValidPaths(paths2).size() != paths2.size())