Merge pull request #13636 from NixOS/mergify/bp/2.28-maintenance/pr-13368

libstore: fix race condition when creating state directories (backport #13368)
This commit is contained in:
mergify[bot]
2025-07-31 03:10:04 +00:00
committed by GitHub

View File

@@ -126,7 +126,7 @@ LocalStore::LocalStore(std::string_view scheme, PathView path, const Params & pa
Path gcRootsDir = stateDir + "/gcroots";
if (!pathExists(gcRootsDir)) {
createDirs(gcRootsDir);
createSymlink(profilesDir, gcRootsDir + "/profiles");
replaceSymlink(profilesDir, gcRootsDir + "/profiles");
}
for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) {