aboutsummaryrefslogtreecommitdiff
path: root/src/nix-build/nix-build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-build/nix-build.cc')
-rw-r--r--src/nix-build/nix-build.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index bc7e7eb18..6510df8f0 100644
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -84,7 +84,6 @@ static void main_nix_build(int argc, char * * argv)
auto interactive = isatty(STDIN_FILENO) && isatty(STDERR_FILENO);
Strings attrPaths;
Strings left;
- RepairFlag repair = NoRepair;
BuildMode buildMode = bmNormal;
bool readStdin = false;
@@ -169,11 +168,6 @@ static void main_nix_build(int argc, char * * argv)
else if (*arg == "--dry-run")
dryRun = true;
- else if (*arg == "--repair") {
- repair = Repair;
- buildMode = bmRepair;
- }
-
else if (*arg == "--run-env") // obsolete
runEnv = true;
@@ -249,7 +243,8 @@ static void main_nix_build(int argc, char * * argv)
auto evalStore = myArgs.evalStoreUrl ? openStore(*myArgs.evalStoreUrl) : store;
auto state = std::make_unique<EvalState>(myArgs.searchPath, evalStore, store);
- state->repair = repair;
+ state->repair = myArgs.repair;
+ if (myArgs.repair) buildMode = bmRepair;
auto autoArgs = myArgs.getAutoArgs(*state);
@@ -289,7 +284,7 @@ static void main_nix_build(int argc, char * * argv)
else
for (auto i : left) {
if (fromArgs)
- exprs.push_back(state->parseExprFromString(std::move(i), absPath(".")));
+ exprs.push_back(state->parseExprFromString(std::move(i), state->rootPath(CanonPath::fromCwd())));
else {
auto absolute = i;
try {
@@ -385,7 +380,9 @@ static void main_nix_build(int argc, char * * argv)
if (!shell) {
try {
- auto expr = state->parseExprFromString("(import <nixpkgs> {}).bashInteractive", absPath("."));
+ auto expr = state->parseExprFromString(
+ "(import <nixpkgs> {}).bashInteractive",
+ state->rootPath(CanonPath::fromCwd()));
Value v;
state->eval(expr, v);