print which derivation failed to evaluate

This commit is contained in:
Jörg Thalheim 2023-12-10 09:17:51 +01:00 committed by mergify[bot]
parent 0f8e80f292
commit fad244725f

View file

@ -203,7 +203,7 @@ struct Drv {
std::map<std::string, std::set<std::string>> inputDrvs;
std::optional<nlohmann::json> meta;
Drv(EvalState &state, DrvInfo &drvInfo) {
Drv(std::string &attrPath, EvalState &state, DrvInfo &drvInfo) {
auto localStore = state.store.dynamic_pointer_cast<LocalFSStore>();
@ -214,7 +214,8 @@ struct Drv {
localStore->printStorePath(*out.second);
}
} catch (const std::exception &e) {
throw EvalError("derivation must have valid outputs: %s", e.what());
throw EvalError("derivation '%s' does not have valid outputs: %s",
attrPath, e.what());
}
if (myArgs.meta) {
@ -326,7 +327,7 @@ static void worker(ref<EvalState> state, Bindings &autoArgs, AutoCloseFD &to,
if (v->type() == nAttrs) {
if (auto drvInfo = getDerivation(*state, *v, false)) {
auto drv = Drv(*state, *drvInfo);
auto drv = Drv(attrPathS, *state, *drvInfo);
reply.update(drv);
/* Register the derivation as a GC root. !!! This