aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-04-07 13:42:01 -0600
committerBen Burdette <bburdette@protonmail.com>2022-04-07 13:42:01 -0600
commit1a93ac8133381eb692416c4e46b1706faa5cd89f (patch)
tree9a559f977ad6213c055099f6f2ab6be96f0c551b /src/nix/build.cc
parentd2ec9b4e15718e42720787140d7825dcbfd73249 (diff)
parent8b1e328d5d0ae7d3a4a8f6012ec065b59674ed4a (diff)
Merge remote-tracking branch 'upstream/master' into upstream-merge
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 6e31757a2..840c7ca38 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -52,15 +52,26 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
void run(ref<Store> store) override
{
- auto buildables = build(
+ if (dryRun) {
+ std::vector<DerivedPath> pathsToBuild;
+
+ for (auto & i : installables) {
+ auto b = i->toDerivedPaths();
+ pathsToBuild.insert(pathsToBuild.end(), b.begin(), b.end());
+ }
+ printMissing(store, pathsToBuild, lvlError);
+ if (json)
+ logger->cout("%s", derivedPathsToJSON(pathsToBuild, store).dump());
+ return;
+ }
+
+ auto buildables = Installable::build(
getEvalStore(), store,
- dryRun ? Realise::Derivation : Realise::Outputs,
+ Realise::Outputs,
installables, buildMode);
if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
- if (dryRun) return;
-
if (outLink != "")
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
for (const auto & [_i, buildable] : enumerate(buildables)) {