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 <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2020-08-04 22:02:51 +01:00 committed by tazjin
parent ffa8e7a998
commit 3f923b2aa0
2 changed files with 4 additions and 3 deletions

View file

@ -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}")

View file

@ -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 = ''