From 7010d4dc8641b350d33cf2634638b7cba6c93ae2 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 18 Jul 2020 21:30:28 +0000 Subject: fix(3p/nix): nix-build: don't accept --(im)pure 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 --- third_party/nix/src/nix-build/nix-build.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'third_party/nix') 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") { -- cgit 1.4.1