From 0314f3ed8e6b0560fa67d2d6cf48133161334575 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 1 May 2022 12:51:40 +0200 Subject: [PATCH] GNU testsuite: no need to rerun the GNU build At least, two use cases: * when hacking on test update * when we want to rebuild only Rust coreutils with the right option Indeed, the GNU code should not cache often in this case --- util/build-gnu.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 6f0ec32f7..83993fde9 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -62,14 +62,23 @@ for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs); do } done -./bootstrap -./configure --quiet --disable-gcc-warnings -#Add timeout to to protect against hangs -sed -i 's|^"\$@|/usr/bin/timeout 600 "\$@|' build-aux/test-driver -# Change the PATH in the Makefile to test the uutils coreutils instead of the GNU coreutils -sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${UU_BUILD_DIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" Makefile -sed -i 's| tr | /usr/bin/tr |' tests/init.sh -make -j "$(nproc)" +if test -f gnu-built; then + echo "GNU build already found. Skip" + echo "'rm -f $(pwd)/gnu-built' to force the build" + echo "Note: the customization of the tests will still happen" + exit 0 +else + ./bootstrap + ./configure --quiet --disable-gcc-warnings + #Add timeout to to protect against hangs + sed -i 's|^"\$@|/usr/bin/timeout 600 "\$@|' build-aux/test-driver + # Change the PATH in the Makefile to test the uutils coreutils instead of the GNU coreutils + sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${UU_BUILD_DIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" Makefile + sed -i 's| tr | /usr/bin/tr |' tests/init.sh + make -j "$(nproc)" + touch gnu-built +fi + # Handle generated factor tests t_first=00 t_max=36