Merge pull request #12795 from NixOS/mergify/bp/2.24-maintenance/pr-12794

Fix windows build (backport #12794)
This commit is contained in:
John Ericson 2025-03-28 21:54:39 -04:00 committed by GitHub
commit e1dad7daa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 8 deletions

View File

@ -213,7 +213,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

@ -419,12 +419,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

@ -171,12 +171,10 @@ void deletePath(const std::filesystem::path & path, uint64_t & bytesFreed);
/**
* Create a directory and all its parents, if necessary.
*
* 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.