diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc index 769935efa..4de335dd5 100644 --- a/src/libcmd/repl-interacter.cc +++ b/src/libcmd/repl-interacter.cc @@ -2,6 +2,8 @@ #include +#include + #if USE_READLINE #include #include diff --git a/src/libexpr/eval-profiler.cc b/src/libexpr/eval-profiler.cc index c72737f73..7053e4ec7 100644 --- a/src/libexpr/eval-profiler.cc +++ b/src/libexpr/eval-profiler.cc @@ -137,7 +137,7 @@ public: : state(state) , sampleInterval(period) , profileFd([&]() { - AutoCloseFD fd = toDescriptor(open(profileFile.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0660)); + AutoCloseFD fd = toDescriptor(open(profileFile.string().c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0660)); if (!fd) throw SysError("opening file %s", profileFile); return fd; diff --git a/src/libutil/include/nix/util/unix-domain-socket.hh b/src/libutil/include/nix/util/unix-domain-socket.hh index 6885d740b..3aaaddf82 100644 --- a/src/libutil/include/nix/util/unix-domain-socket.hh +++ b/src/libutil/include/nix/util/unix-domain-socket.hh @@ -80,7 +80,7 @@ void bind(Socket fd, const std::string & path); /** * Connect to a Unix domain socket. */ -void connect(Socket fd, const std::string & path); +void connect(Socket fd, const std::filesystem::path & path); /** * Connect to a Unix domain socket. diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index a328a5c73..9b4ecbda8 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -324,7 +324,7 @@ std::unique_ptr makeJSONLogger(const std::filesystem::path & path, bool AutoCloseFD fd = std::filesystem::is_socket(path) ? connect(path) - : toDescriptor(open(path.c_str(), O_CREAT | O_APPEND | O_WRONLY, 0644)); + : toDescriptor(open(path.string().c_str(), O_CREAT | O_APPEND | O_WRONLY, 0644)); if (!fd) throw SysError("opening log file %1%", path); diff --git a/src/libutil/unix-domain-socket.cc b/src/libutil/unix-domain-socket.cc index 0e8c21d66..2422caf14 100644 --- a/src/libutil/unix-domain-socket.cc +++ b/src/libutil/unix-domain-socket.cc @@ -29,7 +29,6 @@ AutoCloseFD createUnixDomainSocket() return fdSocket; } - AutoCloseFD createUnixDomainSocket(const Path & path, mode_t mode) { auto fdSocket = nix::createUnixDomainSocket(); @@ -100,7 +99,6 @@ static void bindConnectProcHelper( } } - void bind(Socket fd, const std::string & path) { unlink(path.c_str()); @@ -108,10 +106,9 @@ void bind(Socket fd, const std::string & path) bindConnectProcHelper("bind", ::bind, fd, path); } - -void connect(Socket fd, const std::string & path) +void connect(Socket fd, const std::filesystem::path & path) { - bindConnectProcHelper("connect", ::connect, fd, path); + bindConnectProcHelper("connect", ::connect, fd, path.string()); } AutoCloseFD connect(const std::filesystem::path & path) diff --git a/src/libutil/windows/file-system.cc b/src/libutil/windows/file-system.cc index a73fa223a..f31c913f1 100644 --- a/src/libutil/windows/file-system.cc +++ b/src/libutil/windows/file-system.cc @@ -1,4 +1,5 @@ #include "nix/util/file-system.hh" +#include "nix/util/logging.hh" #ifdef _WIN32 namespace nix { diff --git a/src/nix/formatter.cc b/src/nix/formatter.cc index 627fb362c..212bb8d70 100644 --- a/src/nix/formatter.cc +++ b/src/nix/formatter.cc @@ -92,7 +92,7 @@ struct CmdFormatterRun : MixFormatter, MixJSON // Add the path to the flake as an environment variable. This enables formatters to format the entire flake even // if run from a subdirectory. StringMap env = getEnv(); - env["PRJ_ROOT"] = flakeDir; + env["PRJ_ROOT"] = flakeDir.string(); // Release our references to eval caches to ensure they are persisted to disk, because // we are about to exec out of this process without running C++ destructors.