diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 2a5368d36c1..54036ddecc7 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -621,7 +621,7 @@ DerivedPathsWithInfo InstallableFlake::toDerivedPaths() std::string_view s = state->forceString(v, noPos, fmt("while evaluating the flake output attribute '%s'", attrPath)); if (context.size() != 1) throw Error( - "flake output attribute '%s' evaluates to the string '%s' which does not denote exactly one store", + "flake output attribute '%s' evaluates a string '%s' which which has multiple entries in its context. It should only have one entry", attrPath, s); return {{ .path = std::visit(overloaded { @@ -629,7 +629,7 @@ DerivedPathsWithInfo InstallableFlake::toDerivedPaths() auto sExpected = state->store->printStorePath(o.path); if (s != sExpected) throw Error( - "flake output attribute '%s' evaluates to the string '%s' which should be '%s' but is not", + "flake output attribute '%s' evaluates to the path string '%s', but its context has the different path '%s'", attrPath, s, sExpected); return DerivedPath::Opaque { .path = std::move(o.path), @@ -637,7 +637,7 @@ DerivedPathsWithInfo InstallableFlake::toDerivedPaths() }, [&](NixStringContextElem::DrvDeep & o) -> DerivedPath { throw Error( - "flake output attribute '%s' evaluates to the string '%s' which unsupported String Context", + "flake output attribute '%s' evaluates to the string '%s' whose context context refers to a complete source and binary closure. This is not supported at this time", attrPath, s); }, [&](NixStringContextElem::Built & o) -> DerivedPath { @@ -646,13 +646,14 @@ DerivedPathsWithInfo InstallableFlake::toDerivedPaths() if (i == drv.outputs.end()) throw Error("derivation '%s' does not have output '%s'", state->store->printStorePath(o.drvPath), o.output); auto optOutputPath = i->second.path(*state->store, drv.name, o.output); + // This is testing for the case of CA derivations auto sExpected = optOutputPath ? state->store->printStorePath(*optOutputPath) : downstreamPlaceholder(*state->store, o.drvPath, o.output); if (s != sExpected) throw Error( - "flake output attribute '%s' evaluates to the string '%s' which should be '%s' but is not", - attrPath, s, sExpected); + "flake output attribute '%s' evaluates to a string '%s' whose context has '%s', but the string is not the right placeholder for this derivation output. It should be '%s'", + attrPath, s, o.to_string(*state.store), sExpected); return DerivedPath::Built { .drvPath = std::move(o.drvPath), .outputs = OutputsSpec::Names { std::move(o.output) },