Skip to content

Commit

Permalink
Merge pull request #12356 from Artturin/illegalpathrefprint
Browse files Browse the repository at this point in the history
Improve "illegal path references in fixed output derivation" error
  • Loading branch information
Ericson2314 authored Jan 26, 2025
2 parents 85a3071 + 4e5d1b2 commit 06de255
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 06de255

Please sign in to comment.