1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 10:21:47 +02:00

Try to fix macOS Nixpkgs lib test failure

Sometimes we read a directory with children we cannot stat. It's a pitty
we even try to stat at all (wasteful) in the `DT_UNKNOWN` case, but at
least this should get rid of the failure.
This commit is contained in:
John Ericson 2024-05-07 13:57:39 -04:00
parent a3c573950b
commit 72a0d4b022
2 changed files with 30 additions and 9 deletions

View file

@ -256,6 +256,14 @@ void LocalStore::findRoots(const Path & path, std::filesystem::file_type type, R
}
catch (std::filesystem::filesystem_error & e) {
/* We only ignore permanent failures. */
if (e.code() == std::errc::permission_denied || e.code() == std::errc::no_such_file_or_directory || e.code() == std::errc::not_a_directory)
printInfo("cannot read potential root '%1%'", path);
else
throw;
}
catch (SysError & e) {
/* We only ignore permanent failures. */
if (e.errNo == EACCES || e.errNo == ENOENT || e.errNo == ENOTDIR)