aboutsummaryrefslogtreecommitdiff
path: root/src/build-remote
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2023-05-08 09:57:05 -0400
committerGitHub <noreply@github.com>2023-05-08 09:57:05 -0400
commitcd0d8e0bd50d7259057ac138a7227907f88b91d5 (patch)
tree56b779700f44613358c9dc976252d9cc4f274595 /src/build-remote
parentab5ca608bf3005fd125b646a46b7a791464bff6c (diff)
Apply suggestions from code review
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Diffstat (limited to 'src/build-remote')
-rw-r--r--src/build-remote/build-remote.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 1467761c9..7366a7c27 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -312,9 +312,12 @@ connected:
// See the very large comment in `case wopBuildDerivation:` in
// `src/libstore/daemon.cc` that explains the trust model here.
//
- // This condition mirrors that: that code enforces the "rules";
+ // This condition mirrors that: that code enforces the "rules" outlined there;
// we do the best we can given those "rules".
- if (std::optional trust = sshStore->isTrustedClient(); (!trust || *trust) || drv.type().isCA()) {
+ std::optional trusted = sshStore->isTrustedClient();
+ // for backward compatibility (use existing comments here)
+ bool trustedOrLegacy = !trusted || *trusted;
+ if (trustedOrLegacy || drv.type().isCA()) {
// Hijack the inputs paths of the derivation to include all
// the paths that come from the `inputDrvs` set. We don’t do
// that for the derivations whose `inputDrvs` is empty
@@ -331,9 +334,9 @@ connected:
if (!result.success())
throw Error("build of '%s' on '%s' failed: %s", store->printStorePath(*drvPath), storeUri, result.errorMsg);
} else {
- copyPaths(*store, *sshStore, StorePathSet {*drvPath}, NoRepair, NoCheckSigs, substitute);
+ copyClosure(*store, *sshStore, StorePathSet {*drvPath}, NoRepair, NoCheckSigs, substitute);
auto res = sshStore->buildPathsWithResults({ DerivedPath::Built { *drvPath, OutputsSpec::All {} } });
- // One path to build should mean one result back
+ // One path to build should produce exactly one build result
assert(res.size() == 1);
optResult = std::move(res[0]);
}