From 3f923b2aa0d976fb18e7038d4e2701e878c6784b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 4 Aug 2020 22:02:51 +0100 Subject: refactor(tvix): Use SANDBOX_SHELL from environment in CMake This makes the configuration work out-of-the-box using CMake in a Nix shell, rather than having to pass the additional variable to CMake on the command line. Change-Id: I04d3cc4f2e5ecf47bf2ee459d5e48588b84ae4dd Reviewed-on: https://cl.tvl.fyi/c/depot/+/1643 Tested-by: BuildkiteCI Reviewed-by: kanepyork Reviewed-by: glittershark --- third_party/nix/CMakeLists.txt | 4 +++- third_party/nix/default.nix | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'third_party') diff --git a/third_party/nix/CMakeLists.txt b/third_party/nix/CMakeLists.txt index e37bef9383..200b604c22 100644 --- a/third_party/nix/CMakeLists.txt +++ b/third_party/nix/CMakeLists.txt @@ -40,7 +40,9 @@ if (CLANG_TIDY_PATH) endif() endif() -if (NOT SANDBOX_SHELL) +if (DEFINED ENV{SANDBOX_SHELL}) + set(SANDBOX_SHELL ENV{SANDBOX_SHELL}) +else() find_program(BUSYBOX busybox) if (BUSYBOX) set(SANDBOX_SHELL "${BUSYBOX}") diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix index 1056a3cbb4..f9ed4749e6 100644 --- a/third_party/nix/default.nix +++ b/third_party/nix/default.nix @@ -95,8 +95,7 @@ in lib.fix (self: pkgs.llvmPackages.libcxxStdenv.mkDerivation { -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF \ -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF \ - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \ - -DSANDBOX_SHELL=${pkgs.busybox}/bin/busybox + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON ''; installCheckPhase = '' -- cgit 1.4.1