1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

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.
This commit is contained in:
John Ericson 2025-08-18 15:26:54 -04:00
parent 2767ae35d9
commit 92b10cf3f5

View file

@ -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<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((std::string) v, inputRewrites);
}
json["outputs"] = rewritten;
auto jsonSh = StructuredAttrs::writeShell(json);