mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00:00
unitests: fix tmpdir when running with meson on macOS
This commit is contained in:
parent
98db531df2
commit
a20659f4fa
@ -3,6 +3,7 @@
|
|||||||
#include "tests/nix_api_util.hh"
|
#include "tests/nix_api_util.hh"
|
||||||
|
|
||||||
#include "file-system.hh"
|
#include "file-system.hh"
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
#include "nix_api_store.h"
|
#include "nix_api_store.h"
|
||||||
#include "nix_api_store_internal.h"
|
#include "nix_api_store_internal.h"
|
||||||
@ -47,7 +48,9 @@ protected:
|
|||||||
if (fs::create_directory(nixDir)) break;
|
if (fs::create_directory(nixDir)) break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
auto tmpl = nix::defaultTempDir() + "/tests_nix-store.XXXXXX";
|
// resolve any symlinks in i.e. on macOS /tmp -> /private/tmp
|
||||||
|
// because this is not allowed for a nix store.
|
||||||
|
auto tmpl = nix::absPath(std::filesystem::path(nix::defaultTempDir()) / "tests_nix-store.XXXXXX", true);
|
||||||
nixDir = mkdtemp((char *) tmpl.c_str());
|
nixDir = mkdtemp((char *) tmpl.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user