Skip to content

Commit

Permalink
Merge pull request #12358 from NixOS/mergify/bp/2.25-maintenance/pr-1…
Browse files Browse the repository at this point in the history
…2356

Improve "illegal path references in fixed output derivation" error (backport #12356)
  • Loading branch information
mergify[bot] authored Jan 26, 2025
2 parents 79a2993 + 3fd1316 commit 95253b1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/libstore/unix/build/local-derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2657,10 +2657,14 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
wanted.to_string(HashFormat::SRI, true),
got.to_string(HashFormat::SRI, true)));
}
if (!newInfo0.references.empty())
if (!newInfo0.references.empty()) {
auto numViolations = newInfo.references.size();
delayedException = std::make_exception_ptr(
BuildError("illegal path references in fixed-output derivation '%s'",
worker.store.printStorePath(drvPath)));
BuildError("fixed-output derivations must not reference store paths: '%s' references %d distinct paths, e.g. '%s'",
worker.store.printStorePath(drvPath),
numViolations,
worker.store.printStorePath(*newInfo.references.begin())));
}

return newInfo0;
},
Expand Down

0 comments on commit 95253b1

Please sign in to comment.