about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-01-19T13·53+0100
committerEelco Dolstra <edolstra@gmail.com>2018-01-19T14·00+0100
commit3c4c30eadd879f512ac2075a7ba39c37ff77bf5c (patch)
treef6588bf8f0c0ab2d117ae27a09ed7cd7c4dd4a8c /src
parent2896bb682691e8ce2be055a386bdeef93ae05586 (diff)
Rewrite builtin derivation environment
Also add a test.

Fixes #1803.
Closes #1805.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 523d737d9bf8..55066205db3a 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);