Merge pull request #12794 from obsidiansystems/fix-windows-build

Fix windows build
This commit is contained in:
John Ericson 2025-03-28 21:04:14 -04:00 committed by GitHub
commit 3f13cc0f87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 10 deletions

View File

@ -115,7 +115,7 @@ LocalStore::LocalStore(
state->stmts = std::make_unique<State::Stmts>();
/* Create missing state directories if they don't already exist. */
createDirs(realStoreDir);
createDirs(realStoreDir.get());
if (readOnly) {
experimentalFeatureSettings.require(Xp::ReadOnlyLocalStore);
} else {

View File

@ -477,12 +477,12 @@ void createDir(const Path & path, mode_t mode)
throw SysError("creating directory '%1%'", path);
}
void createDirs(const Path & path)
void createDirs(const fs::path & path)
{
try {
fs::create_directories(path);
} catch (fs::filesystem_error & e) {
throw SysError("creating directory '%1%'", path);
throw SysError("creating directory '%1%'", path.string());
}
}

View File

@ -231,14 +231,9 @@ void deletePath(const std::filesystem::path & path, uint64_t & bytesFreed);
/**
* Create a directory and all its parents, if necessary.
*
* In the process of being deprecated for
* `std::filesystem::create_directories`.
* Wrapper around `std::filesystem::create_directories` to handle exceptions.
*/
void createDirs(const Path & path);
inline void createDirs(PathView path)
{
return createDirs(Path(path));
}
void createDirs(const std::filesystem::path & path);
/**
* Create a single directory.