From c7f02bd96ae22ff9ea7cb3f50196adb5c3bd67f2 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 15 Sep 2026 01:16:18 +0900 Subject: [PATCH 1/3] GnuTests: bump GNU to 9.12 --- util/fetch-gnu.sh | 12 ++++-------- util/gnu-patches/series | 26 +++++++++++++------------- util/run-gnu-test.sh | 1 + 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/util/fetch-gnu.sh b/util/fetch-gnu.sh index 41b9a49b4be..e6adeb76035 100755 --- a/util/fetch-gnu.sh +++ b/util/fetch-gnu.sh @@ -1,17 +1,13 @@ #!/bin/bash -e -ver="9.11" +ver="9.12" repo=https://github.com/coreutils/coreutils curl -L "${repo}/releases/download/v${ver}/coreutils-${ver}.tar.xz" | tar --strip-components=1 -xJf - # TODO stop backporting tests from master at GNU coreutils > $ver backport=( - cat/splice.sh # split tests - dd/fail-ftruncate-fstat.sh # remove LD_PRELOAD - dd/stderr.sh # replace GNU/test binary by uutils/test - misc/close-stdout.sh # fix hardcoded pathes to GNU executables - misc/uname-labeled.sh # uname -A/--all-labeled, added after $ver - nproc/nproc-quota.sh # remove LD_PRELOAD - misc/empty-backup-suffix.sh + # https://github.com/coreutils/coreutils/issues/355 + env/env.sh + env/printenv.sh ) for f in "${backport[@]}" do curl -L ${repo}/raw/refs/heads/master/tests/$f > tests/$f diff --git a/util/gnu-patches/series b/util/gnu-patches/series index f9b7fd8262e..f16a9a0d6cc 100644 --- a/util/gnu-patches/series +++ b/util/gnu-patches/series @@ -1,14 +1,14 @@ -tests_factor_factor.pl.patch -tests_cksum_base64.patch -tests_comm.pl.patch +#tests_factor_factor.pl.patch +#tests_cksum_base64.patch +# FIXME: tests_comm.pl.patch # FIXME: tests_cut_error_msg.patch -tests_dup_source.patch -tests_env_env-S.pl.patch -tests_invalid_opt.patch -tests_ls_no_cap.patch -tests_sort_merge.pl.patch -tests_du_move_dir_while_traversing.patch -test_mkdir_restorecon.patch -error_msg_uniq.diff -tests_numfmt.patch -tests_pwd-long.patch +#tests_dup_source.patch +# FIXME: tests_env_env-S.pl.patch +#tests_invalid_opt.patch +# FIXME: tests_ls_no_cap.patch +#tests_sort_merge.pl.patch +#tests_du_move_dir_while_traversing.patch +#test_mkdir_restorecon.patch +# FIXME: error_msg_uniq.diff +#tests_numfmt.patch +# FIXME: tests_pwd-long.patch diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 0480442e116..26766bc7fd2 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -29,6 +29,7 @@ echo "path_GNU='${path_GNU}'" # Use GNU nproc for *BSD NPROC=$(command -v ${path_GNU}/src/nproc||command -v nproc) +NPROC=$("${NPROC}") MAKEFLAGS="${MAKEFLAGS} -j ${NPROC}" export MAKEFLAGS ### From 4b53ae60bdc68a1414aa42d72924955881f94aad Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 18 Sep 2026 08:14:50 +0200 Subject: [PATCH 2/3] GnuTests: keep the quilt patches enabled with 9.12 The patches encode the uutils-vs-GNU diagnostic differences, so disabling them makes the suite fail (e.g. tests/mkdir/restorecon.sh in the SELinux job). Nine of the fourteen apply to 9.12 unchanged; refresh the five that do not: - tests_comm.pl.patch: comm.pl moved from tests/misc/ to tests/comm/ - tests_ls_no_cap.patch / tests_pwd-long.patch: strace switched from '-e SYSCALL' to '-e trace=SYSCALL' - tests_env_env-S.pl.patch: env-S.pl now escapes the tab in the expected 'invalid option' diagnostic - error_msg_uniq.diff: uniq.pl gained test 146 after the patched hunk Also make the nproc lookup in run-gnu-test.sh survive a missing/failing nproc, which would otherwise abort the script under 'set -e'. --- util/gnu-patches/error_msg_uniq.diff | 6 +++--- util/gnu-patches/series | 26 +++++++++++------------ util/gnu-patches/tests_comm.pl.patch | 6 +++--- util/gnu-patches/tests_env_env-S.pl.patch | 2 +- util/gnu-patches/tests_ls_no_cap.patch | 8 +++---- util/gnu-patches/tests_pwd-long.patch | 14 ++++++------ util/run-gnu-test.sh | 6 ++++-- 7 files changed, 35 insertions(+), 33 deletions(-) diff --git a/util/gnu-patches/error_msg_uniq.diff b/util/gnu-patches/error_msg_uniq.diff index 1c9e32fcb22..cfac53c5c90 100644 --- a/util/gnu-patches/error_msg_uniq.diff +++ b/util/gnu-patches/error_msg_uniq.diff @@ -53,6 +53,6 @@ Index: gnu/tests/uniq/uniq.pl + {ERR=>"error: invalid value 'badoption' for '--group[=]'\n\n" . + " [possible values: separate, prepend, append, both]\n\n" . + "For more information, try '--help'.\n"}], - ); - - # Locale related tests + # Test for read buffer overrun. + do { my $longline = "\360\237\230\200" . "A" x 255 . "\n"; + ['146', '-w256', {IN => $longline x 2}, {OUT => $longline}] }, diff --git a/util/gnu-patches/series b/util/gnu-patches/series index f16a9a0d6cc..f9b7fd8262e 100644 --- a/util/gnu-patches/series +++ b/util/gnu-patches/series @@ -1,14 +1,14 @@ -#tests_factor_factor.pl.patch -#tests_cksum_base64.patch -# FIXME: tests_comm.pl.patch +tests_factor_factor.pl.patch +tests_cksum_base64.patch +tests_comm.pl.patch # FIXME: tests_cut_error_msg.patch -#tests_dup_source.patch -# FIXME: tests_env_env-S.pl.patch -#tests_invalid_opt.patch -# FIXME: tests_ls_no_cap.patch -#tests_sort_merge.pl.patch -#tests_du_move_dir_while_traversing.patch -#test_mkdir_restorecon.patch -# FIXME: error_msg_uniq.diff -#tests_numfmt.patch -# FIXME: tests_pwd-long.patch +tests_dup_source.patch +tests_env_env-S.pl.patch +tests_invalid_opt.patch +tests_ls_no_cap.patch +tests_sort_merge.pl.patch +tests_du_move_dir_while_traversing.patch +test_mkdir_restorecon.patch +error_msg_uniq.diff +tests_numfmt.patch +tests_pwd-long.patch diff --git a/util/gnu-patches/tests_comm.pl.patch b/util/gnu-patches/tests_comm.pl.patch index 4b683cc893a..989ac441a50 100644 --- a/util/gnu-patches/tests_comm.pl.patch +++ b/util/gnu-patches/tests_comm.pl.patch @@ -1,7 +1,7 @@ -Index: gnu/tests/misc/comm.pl +Index: gnu/tests/comm/comm.pl =================================================================== ---- gnu.orig/tests/misc/comm.pl -+++ gnu/tests/misc/comm.pl +--- gnu.orig/tests/comm/comm.pl ++++ gnu/tests/comm/comm.pl @@ -73,18 +73,24 @@ my @Tests = # invalid missing command line argument (1) diff --git a/util/gnu-patches/tests_env_env-S.pl.patch b/util/gnu-patches/tests_env_env-S.pl.patch index 955ed2c1c3f..2ff931bc38a 100644 --- a/util/gnu-patches/tests_env_env-S.pl.patch +++ b/util/gnu-patches/tests_env_env-S.pl.patch @@ -36,7 +36,7 @@ Index: gnu/tests/env/env-S.pl + "For more information, try '--help'.\n" . + "$prog: use -[v]S to pass options in shebang lines\n"}], ['err_sp3', q['-v -S cat -n'], {EXIT=>125}, # embedded tab after -v -- {ERR=>"env: invalid option -- '\t'\n" . +- {ERR=>"env: invalid option -- '\\t'\n" . - "env: use -[v]S to pass options in shebang lines\n" . - "Try 'env --help' for more information.\n"}], + {ERR=>"error: unexpected argument '-\t' found\n\n" . diff --git a/util/gnu-patches/tests_ls_no_cap.patch b/util/gnu-patches/tests_ls_no_cap.patch index 62b836f7962..a8db18930c7 100644 --- a/util/gnu-patches/tests_ls_no_cap.patch +++ b/util/gnu-patches/tests_ls_no_cap.patch @@ -6,15 +6,15 @@ index 99f0563bc..f7b9e7885 100755 skip_ "setcap doesn't work" LS_COLORS=ca=1; export LS_COLORS --strace -e capget ls --color=always > /dev/null 2> out || fail=1 +-strace -e trace=capget ls --color=always > /dev/null 2> out || fail=1 -$EGREP 'capget\(' out || skip_ "your ls doesn't call capget" -+strace -e listxattr ls --color=always > /dev/null 2> out || fail=1 ++strace -e trace=listxattr ls --color=always > /dev/null 2> out || fail=1 +$EGREP 'listxattr\(' out || skip_ "your ls doesn't call listxattr" LS_COLORS=ca=:; export LS_COLORS --strace -e capget ls --color=always > /dev/null 2> out || fail=1 +-strace -e trace=capget ls --color=always > /dev/null 2> out || fail=1 -$EGREP 'capget\(' out && fail=1 -+strace -e listxattr ls --color=always > /dev/null 2> out || fail=1 ++strace -e trace=listxattr ls --color=always > /dev/null 2> out || fail=1 +$EGREP 'listxattr\(' out && fail=1 Exit $fail diff --git a/util/gnu-patches/tests_pwd-long.patch b/util/gnu-patches/tests_pwd-long.patch index a26847e26f7..e9573ba4532 100644 --- a/util/gnu-patches/tests_pwd-long.patch +++ b/util/gnu-patches/tests_pwd-long.patch @@ -3,26 +3,26 @@ Index: gnu/tests/pwd/pwd-long.sh --- gnu.orig/tests/pwd/pwd-long.sh +++ gnu/tests/pwd/pwd-long.sh @@ -19,7 +19,6 @@ - - . "${srcdir=.}/tests/init.sh"; + + . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ pwd -uses_strace_ - + require_readable_root_ require_perl_ -@@ -27,11 +26,10 @@ +@@ -27,11 +26,10 @@ require_perl_ ARGV_0=$0 export ARGV_0 - + -# Disable the getcwd syscall if possible, so more of our code is exercised. -no_sys_getcwd() { -- strace -f -o /dev/null -e 'getcwd' -e fault=all:error=ENOSYS "$@" +- strace -f -o /dev/null -e trace=getcwd -e fault=all:error=ENOSYS "$@" -} -no_sys_getcwd true || no_sys_getcwd() { "$@"; } +# uutils: our pwd has no userspace getcwd reimplementation like GNU's; it +# relies on the kernel getcwd(), which already handles paths longer than +# PATH_MAX. So run pwd directly instead of disabling the getcwd syscall. +no_sys_getcwd() { "$@"; } - + # Don't use CuTmpdir here, since File::Temp's use of rmtree can't # remove the deep tree we create. diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 26766bc7fd2..013119527b0 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -28,8 +28,10 @@ echo "path_UUTILS='${path_UUTILS}'" echo "path_GNU='${path_GNU}'" # Use GNU nproc for *BSD -NPROC=$(command -v ${path_GNU}/src/nproc||command -v nproc) -NPROC=$("${NPROC}") +NPROC_BIN=$(command -v "${path_GNU}"/src/nproc||command -v nproc) +# `-j` wants a job count: handing it the path to nproc made make read it as a +# (bogus) goal and run with unlimited parallelism, which starves the CI runner. +NPROC=$("${NPROC_BIN}" 2>/dev/null) || NPROC=1 MAKEFLAGS="${MAKEFLAGS} -j ${NPROC}" export MAKEFLAGS ### From 8f2b7d64d3e659ff63ef25eb2bb5ca6e934d7bf5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 06:15:02 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- util/gnu-patches/tests_pwd-long.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/gnu-patches/tests_pwd-long.patch b/util/gnu-patches/tests_pwd-long.patch index e9573ba4532..d5291137c27 100644 --- a/util/gnu-patches/tests_pwd-long.patch +++ b/util/gnu-patches/tests_pwd-long.patch @@ -3,17 +3,17 @@ Index: gnu/tests/pwd/pwd-long.sh --- gnu.orig/tests/pwd/pwd-long.sh +++ gnu/tests/pwd/pwd-long.sh @@ -19,7 +19,6 @@ - + . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ pwd -uses_strace_ - + require_readable_root_ require_perl_ @@ -27,11 +26,10 @@ require_perl_ ARGV_0=$0 export ARGV_0 - + -# Disable the getcwd syscall if possible, so more of our code is exercised. -no_sys_getcwd() { - strace -f -o /dev/null -e trace=getcwd -e fault=all:error=ENOSYS "$@" @@ -23,6 +23,6 @@ Index: gnu/tests/pwd/pwd-long.sh +# relies on the kernel getcwd(), which already handles paths longer than +# PATH_MAX. So run pwd directly instead of disabling the getcwd syscall. +no_sys_getcwd() { "$@"; } - + # Don't use CuTmpdir here, since File::Temp's use of rmtree can't # remove the deep tree we create.