Merge pull request #12357 from NixOS/mergify/bp/2.24-maintenance/pr-12356

Improve "illegal path references in fixed output derivation" error (backport #12356)
This commit is contained in:
mergify[bot] 2025-01-28 09:37:45 +00:00 committed by GitHub
commit b9e6e00fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2614,10 +2614,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;
},