From 68bd2e40f4629f760886e2934f1506c54c795415 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 6 Oct 2025 11:33:29 +0200 Subject: [PATCH] ExternalDerivationBuilder: Pass the (scratch) outputs --- src/libstore/include/nix/store/globals.hh | 8 ++++++-- src/libstore/unix/build/external-derivation-builder.cc | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libstore/include/nix/store/globals.hh b/src/libstore/include/nix/store/globals.hh index f97b261f8..385f8cd7a 100644 --- a/src/libstore/include/nix/store/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -1403,13 +1403,17 @@ public: "HOME": "/homeless-shelter", "builder": "/nix/store/s1qkj0ph…-bash-5.2p37/bin/bash", "nativeBuildInputs": "/nix/store/l31j72f1…-version-check-hook", + "out": "/nix/store/2yx2prgx…-hello-2.12.2" … }, "inputPaths": [ - "/nix/store/14dciax3mm8j70hjy4c0d68mds9ppx2s-glibc-2.32-54-dev", - "/nix/store/1azs5s8zc0z7m6sssvq1np0m7z873zml-gettext-0.21", + "/nix/store/14dciax3…-glibc-2.32-54-dev", + "/nix/store/1azs5s8z…-gettext-0.21", … ], + "outputs": { + "out": "/nix/store/2yx2prgx…-hello-2.12.2" + }, "realStoreDir": "/nix/store", "storeDir": "/nix/store", "system": "aarch64-linux", diff --git a/src/libstore/unix/build/external-derivation-builder.cc b/src/libstore/unix/build/external-derivation-builder.cc index e30a92db7..12ac77542 100644 --- a/src/libstore/unix/build/external-derivation-builder.cc +++ b/src/libstore/unix/build/external-derivation-builder.cc @@ -74,6 +74,12 @@ struct ExternalDerivationBuilder : DerivationBuilderImpl l.push_back(store.printStorePath(i)); json.emplace("inputPaths", std::move(l)); } + { + auto l = nlohmann::json::object(); + for (auto & i : scratchOutputs) + l.emplace(i.first, store.printStorePath(i.second)); + json.emplace("outputs", std::move(l)); + } // TODO(cole-h): writing this to stdin is too much effort right now, if we want to revisit // that, see this comment by Eelco about how to make it not suck: