about summary refs log tree commit diff
path: root/third_party/nix/src/nix-build/nix-build.cc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-07-18T21·30+0000
committerAlyssa Ross <hi@alyssa.is>2020-07-18T21·40+0000
commit7010d4dc8641b350d33cf2634638b7cba6c93ae2 (patch)
treef54fe4cc476fda7a79555c90236523c88b5654aa /third_party/nix/src/nix-build/nix-build.cc
parent3c9ee249299955c415f536a81ea7b4c218b3a36b (diff)
fix(3p/nix): nix-build: don't accept --(im)pure r/1386
These options only apply to nix-shell.  The fact that nix-build
previously accepted them was an accident that resulted from the two
programs sharing an implementation.

Change-Id: I0047c98e2096010797316bff3ea4faf722fab86a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1273
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/nix/src/nix-build/nix-build.cc')
-rw-r--r--third_party/nix/src/nix-build/nix-build.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/nix/src/nix-build/nix-build.cc b/third_party/nix/src/nix-build/nix-build.cc
index b00062de0ea0..7e3ee11d68f0 100644
--- a/third_party/nix/src/nix-build/nix-build.cc
+++ b/third_party/nix/src/nix-build/nix-build.cc
@@ -196,9 +196,9 @@ static void _main(int argc, char** argv) {
         } else if (*arg == "--expr" || *arg == "-E") {
           fromArgs = true;
 
-        } else if (*arg == "--pure") {
+        } else if (runEnv && *arg == "--pure") {
           pure = true;
-        } else if (*arg == "--impure") {
+        } else if (runEnv && *arg == "--impure") {
           pure = false;
 
         } else if (*arg == "--packages" || *arg == "-p") {