From 3550a32b25068aa8b1670ef7fd2af2b821f35dc1 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 8 Jan 2021 22:09:35 +0100 Subject: [PATCH] primops/derivation: use position of currently evaluated attribute * The position of the `name`-attribute appears in the trace. * If e.g. `meta` has no `outPath`-attribute, a `cannot coerce set to string` error will be thrown where `pos` points to `name =` which is highly misleading. --- src/libexpr/primops.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 428adf4c2..f9eefddd0 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -953,7 +953,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * * } } else { - auto s = state.coerceToString(posDrvName, *i->value, context, true); + auto s = state.coerceToString(*i->pos, *i->value, context, true); drv.env.emplace(key, s); if (i->name == state.sBuilder) drv.builder = s; else if (i->name == state.sSystem) drv.platform = s;