From 6c0d67769d99800cbbc294abba722d9ba3b19fcc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 6 Oct 2025 11:29:15 +0200 Subject: [PATCH] ExternalDerivationBuilder: Pass inputPaths --- src/libstore/include/nix/store/globals.hh | 45 +++---------------- .../unix/build/external-derivation-builder.cc | 6 +++ 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/src/libstore/include/nix/store/globals.hh b/src/libstore/include/nix/store/globals.hh index ae8990eab..f97b261f8 100644 --- a/src/libstore/include/nix/store/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -1401,48 +1401,15 @@ public: "builder": "/nix/store/s1qkj0ph…-bash-5.2p37/bin/bash", "env": { "HOME": "/homeless-shelter", - "NIX_BUILD_CORES": "14", - "NIX_BUILD_TOP": "/build", - "NIX_LOG_FD": "2", - "NIX_STORE": "/nix/store", - "PATH": "/path-not-set", - "PWD": "/build", - "TEMP": "/build", - "TEMPDIR": "/build", - "TERM": "xterm-256color", - "TMP": "/build", - "TMPDIR": "/build", - "__structuredAttrs": "", - "buildInputs": "", "builder": "/nix/store/s1qkj0ph…-bash-5.2p37/bin/bash", - "cmakeFlags": "", - "configureFlags": "", - "depsBuildBuild": "", - "depsBuildBuildPropagated": "", - "depsBuildTarget": "", - "depsBuildTargetPropagated": "", - "depsHostHost": "", - "depsHostHostPropagated": "", - "depsTargetTarget": "", - "depsTargetTargetPropagated": "", - "doCheck": "1", - "doInstallCheck": "1", - "mesonFlags": "", - "name": "hello-2.12.2", "nativeBuildInputs": "/nix/store/l31j72f1…-version-check-hook", - "out": "/nix/store/2yx2prgx…-hello-2.12.2", - "outputs": "out", - "patches": "", - "pname": "hello", - "postInstallCheck": "stat \"${!outputBin}/bin/hello\"\n", - "propagatedBuildInputs": "", - "propagatedNativeBuildInputs": "", - "src": "/nix/store/dw402azx…-hello-2.12.2.tar.gz", - "stdenv": "/nix/store/i8bw5nqg…-stdenv-linux", - "strictDeps": "", - "system": "aarch64-linux", - "version": "2.12.2" + … }, + "inputPaths": [ + "/nix/store/14dciax3mm8j70hjy4c0d68mds9ppx2s-glibc-2.32-54-dev", + "/nix/store/1azs5s8zc0z7m6sssvq1np0m7z873zml-gettext-0.21", + … + ], "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 4d3eba6db..e30a92db7 100644 --- a/src/libstore/unix/build/external-derivation-builder.cc +++ b/src/libstore/unix/build/external-derivation-builder.cc @@ -68,6 +68,12 @@ struct ExternalDerivationBuilder : DerivationBuilderImpl json.emplace("storeDir", store.storeDir); json.emplace("realStoreDir", store.config->realStoreDir.get()); json.emplace("system", drv.platform); + { + auto l = nlohmann::json::array(); + for (auto & i : inputPaths) + l.push_back(store.printStorePath(i)); + json.emplace("inputPaths", 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: