1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

libstore-tests: Fix impurity trying to access the Nix daemon

This failed on macOS:

  nix-store-tests-run> C++ exception with description "../nix_api_store.cc:33: nix_err_code(ctx) != NIX_OK, message: error: getting status of '/nix/var/nix/daemon-socket/socket': Operation not permitted" thrown in the test body.
This commit is contained in:
Eelco Dolstra 2025-07-07 11:26:06 +02:00
parent f29acd5bbc
commit 7781560724
2 changed files with 2 additions and 0 deletions

View file

@ -101,6 +101,7 @@ test(
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'HOME': meson.current_build_dir() / 'test-home',
'NIX_REMOTE': meson.current_build_dir() / 'test-home' / 'store',
},
protocol : 'gtest',
)

View file

@ -77,6 +77,7 @@ mkMesonExecutable (finalAttrs: {
}
(''
export _NIX_TEST_UNIT_DATA=${data + "/src/libstore-tests/data"}
export NIX_REMOTE=$HOME/store
${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
touch $out
'');