aboutsummaryrefslogtreecommitdiff
path: root/src/build-remote
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-06-21 14:16:13 +0200
committerregnat <rg@regnat.ovh>2021-06-21 14:18:33 +0200
commit498677cbedf9c7dee1df86e775342cdf93a110bd (patch)
treecebf63bbcc729a52b8bd87049f9231712359258e /src/build-remote
parente6150de90d8db101209fc6363f5f7696ee8192c4 (diff)
Fix the remote build of CA derivations
Make sure that the derivation we send to the remote builder is exactly the one that we want to build locally so that the output ids are exactly the same Fix #4845
Diffstat (limited to 'src/build-remote')
-rw-r--r--src/build-remote/build-remote.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 57f2cd32d..0904f2ce9 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -277,7 +277,16 @@ connected:
auto drv = store->readDerivation(*drvPath);
auto outputHashes = staticOutputHashes(*store, drv);
- drv.inputSrcs = store->parseStorePathSet(inputs);
+
+ // 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
+ // because
+ // 1. It’s not needed
+ // 2. Changing the `inputSrcs` set changes the associated output ids,
+ // which break CA derivations
+ if (!drv.inputDrvs.empty())
+ drv.inputSrcs = store->parseStorePathSet(inputs);
auto result = sshStore->buildDerivation(*drvPath, drv);