Repository navigation
Conversation
sylvestre
reviewed
Dec 1, 2026
| return Ok(()); | ||
| } | ||
| // Some BSD filesystems allow directory reads. WASI Preview 1 reports EBADF. | ||
| #[cfg(any( |
Contributor
There was a problem hiding this comment.
how was this list picked? was it checked on the freebsd CI job?
Contributor
Author
There was a problem hiding this comment.
Yes, the FreeBSD Tests job passed on 6c81de6: https://github.com/uutils/coreutils/actions/runs/46557164454/job/142335034390
DragonFlyBSD and NetBSD are on the list because their UFS implementations can allow directory reads. FreeBSD also allows them on supported filesystems when running as root with security.bsd.allow_read_dir enabled. The CI job runs as a regular user, so it covers the normal FreeBSD case. WASI Preview 1 is included because Wasmtime can return EBADF when reading a directory. In each case, the check lets fmt report “Is a directory.”
limadog9
force-pushed
the
fmt-read-without-metadata
branch
from
December 1, 2026 15:47
6c81de6 to
e9a77aa
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fmt could open a readable file and discard its contents when a metadata lookup failed. Read the file and report errors from the read itself. Preserve directory diagnostics on affected BSD and WASI targets.
Addresses the fmt case in #10890 and compatibility tracker #14705.
With an injected metadata overflow, upstream main exited 1 with empty output. The fix formats the file and exits 0. The fmt case in GNU 9.12 misc/read-errors.sh now passes; other utilities still fail. All five GNU fmt tests pass. Linux integration tests went from 53 passed and 1 failed to 54 passed, with 2 ignored in both runs.