From 92b10cf3f5061553b4f0400a64c661d57c6ef674 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 18 Aug 2025 15:26:54 -0400 Subject: [PATCH] `DerivationBuilderImpl::writeStructuredAttrs` remove a rewrite As much as I prefer rewriting the parsed rather than unparsed JSON for elegance, this gets in the way of the separation of concerns that I am trying to do. As a practical matter, any rewriting that this did will also be done by the second round of rewriting that remains below, so removing this code should have no effect. --- src/libstore/unix/build/derivation-builder.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libstore/unix/build/derivation-builder.cc b/src/libstore/unix/build/derivation-builder.cc index 76468cca0..0b6dbe670 100644 --- a/src/libstore/unix/build/derivation-builder.cc +++ b/src/libstore/unix/build/derivation-builder.cc @@ -1106,14 +1106,6 @@ void DerivationBuilderImpl::writeStructuredAttrs() { if (drv.structuredAttrs) { auto json = drv.structuredAttrs->prepareStructuredAttrs(store, drvOptions, inputPaths, drv.outputs); - nlohmann::json rewritten; - for (auto & [i, v] : json["outputs"].get()) { - /* 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((std::string) v, inputRewrites); - } - - json["outputs"] = rewritten; auto jsonSh = StructuredAttrs::writeShell(json);