about summary refs log tree commit diff
path: root/third_party/nix/CMakeLists.txt
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-08-04T00·20-0400
committerglittershark <grfn@gws.fyi>2020-08-04T02·15+0000
commit09cb41b7ac6ff436fc7554cfc59745276c4515ed (patch)
treecbbfc535d9566ae3dddfa3db004eda3505822ab9 /third_party/nix/CMakeLists.txt
parent26a59482d2427f640893517f1b24dd650a5bd5da (diff)
fix(3p/nix): Properly configure SANDBOX_SHELL r/1575
point the SANDBOX_SHELL macro at the actual path to busybox on the build
machine, or allow it to be configured at build-time with a cmake option.

Change-Id: I044a1315ba9baa3bc9ceddf29f36d14f9f9ccd96
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1632
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/nix/CMakeLists.txt')
-rw-r--r--third_party/nix/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/third_party/nix/CMakeLists.txt b/third_party/nix/CMakeLists.txt
index 6a9ab6bf8a8f..e37bef9383b3 100644
--- a/third_party/nix/CMakeLists.txt
+++ b/third_party/nix/CMakeLists.txt
@@ -40,6 +40,15 @@ if (CLANG_TIDY_PATH)
   endif()
 endif()
 
+if (NOT SANDBOX_SHELL)
+  find_program(BUSYBOX busybox)
+  if (BUSYBOX)
+    set(SANDBOX_SHELL "${BUSYBOX}")
+  else()
+    message(FATAL_ERROR "Could not find busybox and SANDBOX_SHELL is not set")
+  endif()
+endif()
+
 # generate a configuration file (autoheader-style) to configure
 # certain symbols that Nix depends on.
 configure_file(config.h.in nix_config.h @ONLY)