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.
This commit is contained in:
Maximilian Bosch 2021-01-08 22:09:35 +01:00
parent 525015be7f
commit 3550a32b25
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -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;