From 465cf64dece7464fb3d35cc2a96dc61496e9090b Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Fri, 5 Dec 2025 19:34:03 +0900 Subject: [PATCH 1/2] build-gnu.sh: Use MULTICALL=y and skip not used utils for faster build --- util/build-gnu.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 532e905929d..ba8b2e488dd 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -94,29 +94,30 @@ else fi cd - -# Pass the feature flags to make, which will pass them to cargo -"${MAKE}" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" -# min test for SELinux -[ "${SELINUX_ENABLED}" = 1 ] && touch g && "${PROFILE}"/stat -c%C g && rm g - -cp "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests rename this script before running, to avoid confusion with the make target -# Create *sum binaries -for sum in b2sum b3sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do - sum_path="${UU_BUILD_DIR}/${sum}" - test -f "${sum_path}" || (cd ${UU_BUILD_DIR} && ln -s "hashsum" "${sum}") -done -test -f "${UU_BUILD_DIR}/[" || (cd ${UU_BUILD_DIR} && ln -s "test" "[") +"${MAKE}" UTILS=install PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" +ln -vf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use renamed install to ginstall +if [ "${SELINUX_ENABLED}" = 1 ];then + # Needs few utils for SELinux tests. Cannot use MULTICALL=y + "${MAKE}" UTILS="runcon chcon cat cp id ls mkdir mkfifo mknod touch stat" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" + # min test for SELinux + touch g && "${PROFILE}"/stat -c%C g && rm g +else + # Use MULTICALL=y for faster build time. + "${MAKE}" MULTICALL=y SKIP_UTILS="install more" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" + for binary in $("${UU_BUILD_DIR}"/coreutils --list) + do ln -vf "${UU_BUILD_DIR}/coreutils" "${UU_BUILD_DIR}/${binary}" + done +fi ## cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]" -# Any binaries that aren't built become `false` so their tests fail +echo "Symlinking binaries that aren't built become `false` so their tests fail" for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs); do bin_path="${UU_BUILD_DIR}/${binary}" test -f "${bin_path}" || { - echo "'${binary}' was not built with uutils, using the 'false' program" - cp "${UU_BUILD_DIR}/false" "${bin_path}" + ln -svf /usr/bin/false "${bin_path}" } done From 4b0ef7abb4f663fe555380ecb985b1559469f62f Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:56:40 +0900 Subject: [PATCH 2/2] build-gnu.sh: Use SKIP_UTILS for SELinux tests --- util/build-gnu.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index f38a88a6e4d..abe1130aae3 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -97,9 +97,9 @@ cd - "${MAKE}" UTILS=install PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" ln -vf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use renamed install to ginstall if [ "${SELINUX_ENABLED}" = 1 ];then - # Needs few utils for SELinux tests. Cannot use MULTICALL=y even it is faster to build... - "${MAKE}" UTILS="basename cat chcon cp du echo env id ln ls mkdir mkfifo mknod mktemp mv printf rm rmdir runcon stat test touch tr uname whoami" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" - ln -vf "${UU_BUILD_DIR}/test" "${UU_BUILD_DIR}/[" + # Building few utils for SELinux tests should save 4 min. But difficult to list the. Also MULTICALL=y fails even it is faster to build... + # "${MAKE}" UTILS="basename cat chcon cp du echo env id ln ls mkdir mkfifo mknod mktemp mv printf rm rmdir runcon stat test touch tr uname whoami" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" + "${MAKE}" SKIP_UTILS="factor hashsum shuf shred install more" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" # min test for SELinux touch g && "${PROFILE}"/stat -c%C g && rm g else