From 2fb21d205139cf65a2ef8f395a1e033ca185d2a9 Mon Sep 17 00:00:00 2001 From: oech3 <> Date: Wed, 10 Dec 2025 19:55:54 +0900 Subject: [PATCH 1/2] GnuTests: Cache configure --- .github/workflows/GnuTests.yml | 16 ++++++++++++++++ util/build-gnu.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index f55ead26ae1..04699fc49ec 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -74,6 +74,15 @@ jobs: git config submodule.gnulib.url https://github.com/coreutils/gnulib.git git submodule update --init --recursive --depth 1 working-directory: gnu + - name: Restore config.cache + uses: actions/cache@v4 + id: cache-config-gnu + with: + path: gnu/config.cache + key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} + restore-keys: | + ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}- + ${{ runner.os }}-gnu-config- #### Build environment setup - name: Install dependencies @@ -115,6 +124,13 @@ jobs: ## Build binaries cd 'uutils' env PROFILE=release-small bash util/build-gnu.sh + + - name: Save config.cache + uses: actions/cache/save@v4 + if: always() && steps.cache-config-gnu.outputs.cache-hit != 'true' + with: + path: gnu/config.cache + key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} ### Run tests as user - name: Run GNU tests diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 626400d6a57..f6202195cd0 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -134,7 +134,7 @@ else "${SED}" -i '/^wget.*/d' bootstrap.conf # wget is used to DL po. Remove the dep. ./bootstrap --skip-po # Use CFLAGS for best build time since we discard GNU coreutils - CFLAGS="${CFLAGS} -pipe -O0 -s" ./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references \ + CFLAGS="${CFLAGS} -pipe -O0 -s" ./configure -C --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references \ --enable-single-binary=symlinks \ "$([ "${SELINUX_ENABLED}" = 1 ] && echo --with-selinux || echo --without-selinux)" #Add timeout to to protect against hangs From 102ffd684d78868a1c1fad3836ad1062a9a556c0 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:15:35 +0900 Subject: [PATCH 2/2] GnuTests: Cache getlimits to skip make --- .github/workflows/GnuTests.yml | 14 +++++++++----- util/build-gnu.sh | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 04699fc49ec..1a5a7c942f1 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -2,7 +2,7 @@ name: GnuTests # spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem # spell-checker:ignore (jargon) submodules devel -# spell-checker:ignore (libs/utils) autopoint chksum getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e +# spell-checker:ignore (libs/utils) autopoint chksum getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e # spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic # spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay # spell-checker:ignore (vars) FILESET SUBDIRS XPASS @@ -74,11 +74,13 @@ jobs: git config submodule.gnulib.url https://github.com/coreutils/gnulib.git git submodule update --init --recursive --depth 1 working-directory: gnu - - name: Restore config.cache + - name: Restore files for faster configure and skipping make uses: actions/cache@v4 id: cache-config-gnu with: - path: gnu/config.cache + path: | + gnu/config.cache + gnu/src/getlimits key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} restore-keys: | ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}- @@ -125,11 +127,13 @@ jobs: cd 'uutils' env PROFILE=release-small bash util/build-gnu.sh - - name: Save config.cache + - name: Save files for faster configure and skipping make uses: actions/cache/save@v4 if: always() && steps.cache-config-gnu.outputs.cache-hit != 'true' with: - path: gnu/config.cache + path: | + gnu/config.cache + gnu/src/getlimits key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} ### Run tests as user diff --git a/util/build-gnu.sh b/util/build-gnu.sh index f6202195cd0..05109814d28 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -141,7 +141,9 @@ else "${SED}" -i 's|^"\$@|'"${SYSTEM_TIMEOUT}"' 600 "\$@|' build-aux/test-driver # Use a better diff "${SED}" -i 's|diff -c|diff -u|g' tests/Coreutils.pm - "${MAKE}" -j "$("${NPROC}")" + # Allow to omit make by reusing getlimits + test -f src/getlimits || "${MAKE}" -j "$("${NPROC}")" + cp -f src/getlimits "${UU_BUILD_DIR}" # Handle generated factor tests t_first=00 @@ -223,8 +225,6 @@ sed -i -e "s|---dis ||g" tests/tail/overlay-headers.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 -test -f "${UU_BUILD_DIR}/getlimits" || cp src/getlimits "${UU_BUILD_DIR}" - # pr produces very long log and this command isn't super interesting # SKIP for now "${SED}" -i -e "s|my \$prog = 'pr';$|my \$prog = 'pr';CuSkip::skip \"\$prog: SKIP for producing too long logs\";|" tests/pr/pr-tests.pl