Merge pull request #4370 from NixOS/ca/more-precise-build-noop

Better detect when `buildPaths` would be a no-op
This commit is contained in:
Eelco Dolstra 2020-12-16 14:54:04 +01:00 committed by GitHub
commit ae3c3e3bb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -729,8 +729,16 @@ void Store::buildPaths(const std::vector<StorePathWithOutputs> & paths, BuildMod
StorePathSet paths2; StorePathSet paths2;
for (auto & path : paths) { for (auto & path : paths) {
if (path.path.isDerivation()) if (path.path.isDerivation()) {
if (settings.isExperimentalFeatureEnabled("ca-derivations")) {
for (auto & outputName : path.outputs) {
if (!queryRealisation({path.path, outputName}))
unsupported("buildPaths"); unsupported("buildPaths");
}
} else
unsupported("buildPaths");
} else
paths2.insert(path.path); paths2.insert(path.path);
} }