mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
unitests: fix tmpdir when running with meson on macOS
This commit is contained in:
parent
98db531df2
commit
a20659f4fa
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "tests/nix_api_util.hh"
|
||||
|
||||
#include "file-system.hh"
|
||||
#include <filesystem>
|
||||
|
||||
#include "nix_api_store.h"
|
||||
#include "nix_api_store_internal.h"
|
||||
|
@ -47,7 +48,9 @@ protected:
|
|||
if (fs::create_directory(nixDir)) break;
|
||||
}
|
||||
#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());
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue