buildEnv: relax constraints about readdir contents #463456
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were wondering why nix builds were failing, where the nix store is located on a virtual filesystem / fuse. In our case it is a store located on a lazy pulling enabled OCI image. We use estargz / zstd:chunked images, where fuse is used to start the container right away (and pulling the rest of the image in the background)
This boils down to the POSIX standard, where "." and ".." are optional and SHALL get displayed (not MUST).
see https://pubs.opengroup.org/onlinepubs/9799919799/functions/readdir.html
The nixpkgs code has an assumption that empty directories at least have the result "." and "..", but this is not valid for all FS.
https://perldoc.perl.org/functions/readdir
The nixpkgs code should work in a more relaxed mode, since opendir already checks that the directory is valid and readable. We would appreciate a backport to 25.11. staging as well (I can not set the tags)
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.