aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-05 15:41:57 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-05 15:41:57 +0000
commitd89472a912c28ec3d47378bb3a6822cd733778f5 (patch)
tree830f556289f4ecaed27e45fed670e8cc1e02edea /src/nix/build.cc
parente1de1fe0d82d8ba702947dcad3b678cbb9ce9333 (diff)
parentb3e73547a03f068ae4dd9cca4bc865cde85c8dec (diff)
Merge remote-tracking branch 'upstream/master' into buildable-variant
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 927301314..13d14a7fb 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -9,6 +9,7 @@ using namespace nix;
struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
{
Path outLink = "result";
+ BuildMode buildMode = bmNormal;
CmdBuild()
{
@@ -26,6 +27,12 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
.description = "do not create a symlink to the build result",
.handler = {&outLink, Path("")},
});
+
+ addFlag({
+ .longName = "rebuild",
+ .description = "rebuild an already built package and compare the result to the existing store paths",
+ .handler = {&buildMode, bmCheck},
+ });
}
std::string description() override
@@ -53,7 +60,7 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
void run(ref<Store> store) override
{
- auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables);
+ auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables, buildMode);
if (dryRun) return;