fix: Darwin compat

(cherry picked from commit 711d95877a039bcd5b162604a22d1c051b59a49d)
This commit is contained in:
Robert Hensing 2025-01-02 07:53:55 +01:00
parent c7278d429f
commit 122ee75ce3
2 changed files with 8 additions and 5 deletions

View file

@ -47,10 +47,10 @@
# NOTE: duplicated in flake.nix devShell
env = {
LIBCLANG_PATH =
if pkgs.stdenv.cc.isClang then
null # don't set the variable
else
lib.makeLibraryPath [ pkgs.buildPackages.llvmPackages.clang-unwrapped ];
lib.makeLibraryPath [ pkgs.buildPackages.llvmPackages.clang-unwrapped ];
BINDGEN_EXTRA_CLANG_ARGS =
# Work around missing [[deprecated]] in clang
"-x c++ -std=c++2a";
} // lib.optionalAttrs pkgs.stdenv.cc.isGNU {
# Avoid cc wrapper, because we only need to add the compiler/"system" dirs
NIX_CC_UNWRAPPED = "${pkgs.stdenv.cc.cc}/bin/gcc";

View file

@ -632,7 +632,10 @@ pub fn test_init() {
// When testing in the sandbox, the default build dir would be a parent of the storeDir,
// which causes an error. So we set a custom build dir here.
nix_util::settings::set("sandbox-build-dir", "/custom-build-dir-for-test").unwrap();
// Only available on linux
if cfg!(target_os = "linux") {
nix_util::settings::set("sandbox-build-dir", "/custom-build-dir-for-test").unwrap();
}
std::env::set_var("_NIX_TEST_NO_SANDBOX", "1");
// The tests run offline