diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-06-27 22:47:21 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-06-27 22:53:36 -0700 |
commit | d85309f7ca154c014cf53777c76df5af44b50500 (patch) | |
tree | ac169128f69a90fd4a3fd22b80aa063b1f13fedc /src/libstore/gc.cc | |
parent | d92712673ba8d169606a1db83224969952f8ac07 (diff) |
store: delete obsolete lsof-disabling code
Since Ifa0adda7984e, we don't use this code anymore on macOS, so we have
no reason to have a knob to disable it anymore.
Change-Id: Ie29a8a8978d9aefd4551895f4f9b3cc0827496df
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index d58e3c8eb..02234d404 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -321,22 +321,20 @@ Roots LocalStore::findRoots(bool censor) void LocalStore::findPlatformRoots(UncheckedRoots & unchecked) { - // lsof is really slow on OS X. This actually causes the gc-concurrent.sh test to fail. - // See: https://github.com/NixOS/nix/issues/3011 - // Because of this we disable lsof when running the tests. - if (getEnv("_NIX_TEST_NO_LSOF") != "1") { - try { - std::regex lsofRegex(R"(^n(/.*)$)"); - auto lsofLines = - tokenizeString<std::vector<std::string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n"); - for (const auto & line : lsofLines) { - std::smatch match; - if (std::regex_match(line, match, lsofRegex)) - unchecked[match[1]].emplace("{lsof}"); - } - } catch (ExecError & e) { - /* lsof not installed, lsof failed */ + // N.B. This is (read: undertested!) fallback code only used for + // non-Darwin, non-Linux platforms. Both major platforms have + // platform-specific code in src/libstore/platform/ + try { + std::regex lsofRegex(R"(^n(/.*)$)"); + auto lsofLines = + tokenizeString<std::vector<std::string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n"); + for (const auto & line : lsofLines) { + std::smatch match; + if (std::regex_match(line, match, lsofRegex)) + unchecked[match[1]].emplace("{lsof}"); } + } catch (ExecError & e) { + /* lsof not installed, lsof failed */ } } |