mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Improve error message for fixed-outputs with references.
This codepath is possible, e.g. with a dockerTools.pullImage of an image with a Nix store.
This commit is contained in:
parent
e23983db82
commit
eeb2f083c5
3 changed files with 16 additions and 1 deletions
|
@ -194,7 +194,10 @@ StorePath StoreDirConfig::makeFixedOutputPath(std::string_view name, const Fixed
|
|||
if (info.hash.algo == HashAlgorithm::SHA256 && info.method == FileIngestionMethod::Recursive) {
|
||||
return makeStorePath(makeType(*this, "source", info.references), info.hash, name);
|
||||
} else {
|
||||
assert(info.references.size() == 0);
|
||||
if (!info.references.empty()) {
|
||||
throw Error("fixed output derivation '%s' is not allowed to refer to other store paths.\nYou may need to use the 'unsafeDiscardReferences' derivation attribute, see the manual for more details.",
|
||||
name);
|
||||
}
|
||||
return makeStorePath("output:out",
|
||||
hashString(HashAlgorithm::SHA256,
|
||||
"fixed:out:"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue