aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjade <lix@jade.fyi>2024-07-01 16:11:32 +0000
committerGerrit Code Review <gerrit@localhost>2024-07-01 16:11:32 +0000
commitd3286d0990da111c536c2f879d8f9cbbd650ebae (patch)
tree41cc3c6e9c5d4ab90f0ae87080cddef6cd6ce792 /src
parent010ff57ebb40f1a9aaff99867d2886f0e59f774a (diff)
parentd85309f7ca154c014cf53777c76df5af44b50500 (diff)
Merge changes Ie29a8a89,I873eedcf into main
* changes: store: delete obsolete lsof-disabling code store: guess the URL of failing fixed-output derivations
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build/local-derivation-goal.cc5
-rw-r--r--src/libstore/gc.cc28
2 files changed, 17 insertions, 16 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 968f669ec..1dd2ad8aa 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -2546,9 +2546,12 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
/* Throw an error after registering the path as
valid. */
worker.hashMismatch = true;
+ // XXX: shameless layering violation hack that makes the hash mismatch error at least not utterly worthless
+ auto guessedUrl = getOr(drv->env, "urls", getOr(drv->env, "url", "(unknown)"));
delayedException = std::make_exception_ptr(
- BuildError("hash mismatch in fixed-output derivation '%s':\n specified: %s\n got: %s",
+ BuildError("hash mismatch in fixed-output derivation '%s':\n likely URL: %s\n specified: %s\n got: %s",
worker.store.printStorePath(drvPath),
+ guessedUrl,
wanted.to_string(SRI, true),
got.to_string(SRI, true)));
}
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 */
}
}