public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michel Lind <salimma@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-fd-find] rawhide: Fix test_follow_broken_symlink with ignore 0.4.28+
Date: Mon, 10 Aug 2026 13:49:05 GMT [thread overview]
Message-ID: <178636974539.1.7080611524019671033.rpms-rust-fd-find-e610fe78e0a9@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rust-fd-find
Branch : rawhide
Commit : e610fe78e0a9f4dd3faaf4cb5a4eaca10ad8e770
Author : Michel Lind <salimma@fedoraproject.org>
Date : 2026-08-10T14:43:56+01:00
Stats : +64/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rust-fd-find/c/e610fe78e0a9f4dd3faaf4cb5a4eaca10ad8e770?branch=rawhide
Log:
Fix test_follow_broken_symlink with ignore 0.4.28+
ignore 0.4.28 started attaching depth to walker IO errors, so the error
is now WithPath{WithDepth{Io}} rather than WithPath{Io}. The pattern
match in src/walk.rs only handled the flat shape, so under --follow a
broken symlink was reported as a walk error instead of being emitted as
an entry. Fedora currently ships rust-ignore 0.4.33.
Upstream switched to the recursive ignore::Error::io_error() accessor,
which unwraps any nesting. Merged after 10.4.2, so drop this on the next
release.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
---
diff --git a/fd-find-refactor-Get-io-error-from-method.patch b/fd-find-refactor-Get-io-error-from-method.patch
new file mode 100644
index 0000000..635215a
--- /dev/null
+++ b/fd-find-refactor-Get-io-error-from-method.patch
@@ -0,0 +1,59 @@
+From f898e95db5a90190fee6eb6e000e024615d2be85 Mon Sep 17 00:00:00 2001
+From: Thayne McCombs <astrothayne@gmail.com>
+Date: Wed, 1 Jul 2026 00:49:58 -0600
+Subject: [PATCH] refactor: Get io error from method
+
+use `ignore::Error::io_error()` to inspect the `std::io::Error` insted
+of pattern matching on `ignore::Error::Io`.
+
+This avoids relying on the implementation of ignore and how it organizes
+the error. In particular, this would allow us to handle if the IO error
+was wrapped in a `WithDepth`, as would be the case if
+BurntSushi/ripgrep#3458 was merged.
+
+This also allows us to remove some duplicate code.
+---
+ src/walk.rs | 30 ++++++++++--------------------
+ 1 file changed, 10 insertions(+), 20 deletions(-)
+
+diff --git a/src/walk.rs b/src/walk.rs
+index 73c03bd92..30128a0bc 100644
+--- a/src/walk.rs
++++ b/src/walk.rs
+@@ -487,26 +487,16 @@ impl WorkerState {
+ Err(ignore::Error::WithPath {
+ path,
+ err: inner_err,
+- }) => match inner_err.as_ref() {
+- ignore::Error::Io(io_error)
+- if io_error.kind() == io::ErrorKind::NotFound
+- && path
+- .symlink_metadata()
+- .ok()
+- .is_some_and(|m| m.file_type().is_symlink()) =>
+- {
+- DirEntry::broken_symlink(path)
+- }
+- _ => {
+- return match tx.send(WorkerResult::Error(ignore::Error::WithPath {
+- path,
+- err: inner_err,
+- })) {
+- Ok(_) => WalkState::Continue,
+- Err(_) => WalkState::Quit,
+- };
+- }
+- },
++ }) if inner_err
++ .io_error()
++ .is_some_and(|io_error| io_error.kind() == io::ErrorKind::NotFound)
++ && path
++ .symlink_metadata()
++ .ok()
++ .is_some_and(|m| m.file_type().is_symlink()) =>
++ {
++ DirEntry::broken_symlink(path)
++ }
+ Err(err) => {
+ return match tx.send(WorkerResult::Error(err)) {
+ Ok(_) => WalkState::Continue,
diff --git a/rust-fd-find.spec b/rust-fd-find.spec
index c97f3f1..db1d366 100644
--- a/rust-fd-find.spec
+++ b/rust-fd-find.spec
@@ -16,6 +16,11 @@ Source: %{crates_source}
# * Allow lscolors 0.20
# * Allow tikv-jemallocator 0.7: https://github.com/sharkdp/fd/pull/2027
Patch: fd-find-fix-metadata.diff
+# Fix test_follow_broken_symlink with ignore >= 0.4.28, which wraps the io::Error
+# in an extra Error::WithDepth layer that fd's pattern match did not expect, so
+# broken symlinks were reported as errors instead of entries. Merged upstream
+# after 10.4.2; drop on the next release.
+Patch: https://github.com/sharkdp/fd/commit/f898e95db5a90190fee6eb6e000e024615d2be85.patch#/fd-find-refactor-Get-io-error-from-method.patch
BuildRequires: cargo-rpm-macros >= 24
reply other threads:[~2026-08-10 13:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178636974539.1.7080611524019671033.rpms-rust-fd-find-e610fe78e0a9@fedoraproject.org \
--to=salimma@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox