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/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/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..d5291137c27 100644 --- a/util/gnu-patches/tests_pwd-long.patch +++ b/util/gnu-patches/tests_pwd-long.patch @@ -4,19 +4,19 @@ Index: gnu/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 diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 0480442e116..013119527b0 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -28,7 +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_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 ###