1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
This commit is contained in:
tomberek 2025-05-18 13:44:12 +08:00 committed by GitHub
commit 855f9ef25e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -414,8 +414,13 @@ void LocalStore::findRuntimeRoots(Roots & roots, bool censor)
if (getEnv("_NIX_TEST_NO_LSOF") != "1") {
try {
std::regex lsofRegex(R"(^n(/.*)$)");
// Despite installations of Nix explicitly setting the `nobrowse` mount
// option on the store, `mdworker` processes continue to run on newly
// created files within it, which can result in spurious GC/path deletion
// failures if the stars are aligned right.
auto lsofLines =
tokenizeString<std::vector<std::string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n");
tokenizeString<std::vector<std::string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n", "-u", "^89", "-g", "^89" }), "\n");
for (const auto & line : lsofLines) {
std::smatch match;
if (std::regex_match(line, match, lsofRegex))