From 3c4c30eadd879f512ac2075a7ba39c37ff77bf5c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 19 Jan 2018 14:53:34 +0100 Subject: Rewrite builtin derivation environment Also add a test. Fixes #1803. Closes #1805. --- src/libstore/build.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 523d737d9..55066205d 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2933,8 +2933,13 @@ void DerivationGoal::runChild() if (drv->isBuiltin()) { try { logger = makeJSONLogger(*logger); + + BasicDerivation drv2(*drv); + for (auto & e : drv2.env) + e.second = rewriteStrings(e.second, inputRewrites); + if (drv->builder == "builtin:fetchurl") - builtinFetchurl(*drv, netrcData); + builtinFetchurl(drv2, netrcData); else throw Error(format("unsupported builtin function '%1%'") % string(drv->builder, 8)); _exit(0); -- cgit v1.2.3