diff --git a/rust/nci.nix b/rust/nci.nix index 25c7dfc..79202c3 100644 --- a/rust/nci.nix +++ b/rust/nci.nix @@ -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"; diff --git a/rust/nix-expr/src/eval_state.rs b/rust/nix-expr/src/eval_state.rs index db7c97e..b631595 100644 --- a/rust/nix-expr/src/eval_state.rs +++ b/rust/nix-expr/src/eval_state.rs @@ -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