Skip to content

Commit 5c917c3

Browse files
authored
Merge pull request #9587 from amjoseph-nixpkgs/pr/wopBuildDerivation/explain
libstore/daemon.cc: note trust model difference in readDerivation()s
2 parents b7e016a + e43bb65 commit 5c917c3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libstore/daemon.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,15 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
574574
case WorkerProto::Op::BuildDerivation: {
575575
auto drvPath = store->parseStorePath(readString(from));
576576
BasicDerivation drv;
577+
/*
578+
* Note: unlike wopEnsurePath, this operation reads a
579+
* derivation-to-be-realized from the client with
580+
* readDerivation(Source,Store) rather than reading it from
581+
* the local store with Store::readDerivation(). Since the
582+
* derivation-to-be-realized is not registered in the store
583+
* it cannot be trusted that its outPath was calculated
584+
* correctly.
585+
*/
577586
readDerivation(from, *store, drv, Derivation::nameFromPath(drvPath));
578587
BuildMode buildMode = (BuildMode) readInt(from);
579588
logger->startWork();

0 commit comments

Comments
 (0)