From bfd7f40340439ae021ecb82c6b5e493cc04df85d Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Mon, 29 Dec 2025 15:17:36 +0000 Subject: [PATCH] gnu: patch inotify-race tests to use Rust gdb breakpoints --- util/build-gnu.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index c4bfac5600f..2eac75b2438 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -220,6 +220,17 @@ grep -rlE '/usr/local/bin/\s?/usr/local/bin' init.cfg tests/* | xargs -r "${SED} # however there's a bug because `---dis` is an alias for: `---disable-inotify` sed -i -e "s|---dis ||g" tests/tail/overlay-headers.sh +# Patch inotify-race tests to use Rust source lines for gdb breakpoints. +# GNU test checks for race between initial read and watch setup. Rust sets up +# watchers before initial read, so no exact equivalent exists. We break at +# watch_with_parent as the closest semantic match. -iex suppresses Rust debug +# script auto-load warnings that would cause the test to skip. +"${SED}" -i \ + -e "s|break_src=\"\$abs_top_srcdir/src/tail.c\"|break_src=\"${path_UUTILS}/src/uu/tail/src/follow/watch.rs\"|" \ + -e 's|break_line=$(grep -n ^tail_forever_inotify "$break_src")|break_line=$(grep -n "watcher_rx.watch_with_parent" "$break_src")|' \ + -e 's|gdb -nx --batch-silent|gdb -nx --batch-silent -iex "set auto-load no"|g' \ + tests/tail/inotify-race.sh tests/tail/inotify-race2.sh + # Do not FAIL, just do a regular ERROR "${SED}" -i -e "s|framework_failure_ 'no inotify_add_watch';|fail=1;|" tests/tail/inotify-rotate-resources.sh