diff options
author | Ben Burdette <bburdette@gmail.com> | 2022-01-03 16:08:28 -0700 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2022-01-03 16:08:28 -0700 |
commit | a47de1ac37841c29e1a4a7d3a9c50e96390ebaf6 (patch) | |
tree | 54819b34b9e090cf32c1ba6865ab9a0af60a9182 /src/nix-build | |
parent | 5954cbf3e9dca0e3b84e4bf2def74abb3d6f80cd (diff) | |
parent | 96d08fcd66e2c38598bab4f39a37a98d58347467 (diff) |
Merge branch 'master' into debug-exploratory-PR
Diffstat (limited to 'src/nix-build')
-rwxr-xr-x | src/nix-build/nix-build.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index 75576ef8a..d3d6ce1ce 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -14,7 +14,6 @@ #include "local-fs-store.hh" #include "globals.hh" #include "derivations.hh" -#include "affinity.hh" #include "util.hh" #include "shared.hh" #include "path-with-outputs.hh" @@ -359,6 +358,7 @@ static void main_nix_build(int argc, char * * argv) is not set, then build bashInteractive from <nixpkgs>. */ auto shell = getEnv("NIX_BUILD_SHELL"); + std::optional<StorePath> shellDrv; if (!shell) { @@ -375,8 +375,7 @@ static void main_nix_build(int argc, char * * argv) auto bashDrv = store->parseStorePath(drv->queryDrvPath()); pathsToBuild.push_back({bashDrv}); pathsToCopy.insert(bashDrv); - - shell = drv->queryOutPath() + "/bin/bash"; + shellDrv = bashDrv; } catch (Error & e) { logError(e.info()); @@ -402,6 +401,11 @@ static void main_nix_build(int argc, char * * argv) if (dryRun) return; + if (shellDrv) { + auto shellDrvOutputs = store->queryPartialDerivationOutputMap(shellDrv.value()); + shell = store->printStorePath(shellDrvOutputs.at("out").value()) + "/bin/bash"; + } + if (settings.isExperimentalFeatureEnabled(Xp::CaDerivations)) { auto resolvedDrv = drv.tryResolve(*store); assert(resolvedDrv && "Successfully resolved the derivation"); |