aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/local-derivation-goal.cc
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-06-24 15:06:07 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2021-06-24 15:25:21 +0200
commit644415d3912633773d2c8f219572fbfa452f4b56 (patch)
treee2a3fe59fdefd876cec6f8ff0fbb393dca2d04be /src/libstore/build/local-derivation-goal.cc
parent6f206549ba02c6f9bdbf9707bba9193a1d82e822 (diff)
Perform input rewrites only in LocalDerivationGoal
Diffstat (limited to 'src/libstore/build/local-derivation-goal.cc')
-rw-r--r--src/libstore/build/local-derivation-goal.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 15a7cb4ac..259134eba 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -1086,8 +1086,17 @@ void LocalDerivationGoal::initEnv()
void LocalDerivationGoal::writeStructuredAttrs()
{
- if (auto structAttrsJson = parsedDrv->prepareStructuredAttrs(inputRewrites, worker.store, inputPaths)) {
+ if (auto structAttrsJson = parsedDrv->prepareStructuredAttrs(worker.store, inputPaths)) {
auto json = structAttrsJson.value();
+ nlohmann::json rewritten;
+ for (auto & [i, v] : json["outputs"].get<nlohmann::json::object_t>()) {
+ /* The placeholder must have a rewrite, so we use it to cover both the
+ cases where we know or don't know the output path ahead of time. */
+ rewritten[i] = rewriteStrings(v, inputRewrites);
+ }
+
+ json["outputs"] = rewritten;
+
auto jsonSh = writeStructuredAttrsShell(json);
writeFile(tmpDir + "/.attrs.sh", rewriteStrings(jsonSh, inputRewrites));