1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

Merge pull request #7136 from sylvestre/gnu-build

Improve gnu build script
This commit is contained in:
Daniel Hofstetter 2025-01-15 10:10:56 +01:00 committed by GitHub
commit 3812cbce8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@
# `build-gnu.bash` ~ builds GNU coreutils (from supplied sources) # `build-gnu.bash` ~ builds GNU coreutils (from supplied sources)
# #
# spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW baddecode submodules xstrtol ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) gnproc greadlink gsed multihardlink # spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW baddecode submodules xstrtol ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) gnproc greadlink gsed multihardlink texinfo
set -e set -e
@ -122,6 +122,8 @@ if test -f gnu-built; then
echo "'rm -f $(pwd)/gnu-built' to force the build" echo "'rm -f $(pwd)/gnu-built' to force the build"
echo "Note: the customization of the tests will still happen" echo "Note: the customization of the tests will still happen"
else else
# Disable useless checks
sed -i 's|check-texinfo: $(syntax_checks)|check-texinfo:|' doc/local.mk
./bootstrap --skip-po ./bootstrap --skip-po
./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references ./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references
#Add timeout to to protect against hangs #Add timeout to to protect against hangs
@ -132,51 +134,51 @@ else
# Use a better diff # Use a better diff
sed -i 's|diff -c|diff -u|g' tests/Coreutils.pm sed -i 's|diff -c|diff -u|g' tests/Coreutils.pm
"${MAKE}" -j "$("${NPROC}")" "${MAKE}" -j "$("${NPROC}")"
touch gnu-built
fi
# Handle generated factor tests # Handle generated factor tests
t_first=00 t_first=00
t_max=36 t_max=36
# t_max_release=20 # t_max_release=20
# if test "${UU_MAKE_PROFILE}" != "debug"; then # if test "${UU_MAKE_PROFILE}" != "debug"; then
# # Generate the factor tests, so they can be fixed # # Generate the factor tests, so they can be fixed
# # * reduced to 20 to decrease log size (down from 36 expected by GNU) # # * reduced to 20 to decrease log size (down from 36 expected by GNU)
# # * only for 'release', skipped for 'debug' as redundant and too time consuming (causing timeout errors) # # * only for 'release', skipped for 'debug' as redundant and too time consuming (causing timeout errors)
# seq=$( # seq=$(
# i=${t_first} # i=${t_first}
# while test "${i}" -le "${t_max_release}"; do # while test "${i}" -le "${t_max_release}"; do
# printf '%02d ' $i # printf '%02d ' $i
# i=$((i + 1)) # i=$((i + 1))
# done # done
# ) # )
# for i in ${seq}; do # for i in ${seq}; do
# "${MAKE}" "tests/factor/t${i}.sh" # "${MAKE}" "tests/factor/t${i}.sh"
# done # done
# cat # cat
# sed -i -e 's|^seq |/usr/bin/seq |' -e 's|sha1sum |/usr/bin/sha1sum |' tests/factor/t*.sh # sed -i -e 's|^seq |/usr/bin/seq |' -e 's|sha1sum |/usr/bin/sha1sum |' tests/factor/t*.sh
# t_first=$((t_max_release + 1)) # t_first=$((t_max_release + 1))
# fi # fi
# strip all (debug) or just the longer (release) factor tests from Makefile # strip all (debug) or just the longer (release) factor tests from Makefile
seq=$( seq=$(
i=${t_first} i=${t_first}
while test "${i}" -le "${t_max}"; do while test "${i}" -le "${t_max}"; do
printf '%02d ' ${i} printf '%02d ' ${i}
i=$((i + 1)) i=$((i + 1))
done done
) )
for i in ${seq}; do for i in ${seq}; do
echo "strip t${i}.sh from Makefile" echo "strip t${i}.sh from Makefile"
sed -i -e "s/\$(tf)\/t${i}.sh//g" Makefile sed -i -e "s/\$(tf)\/t${i}.sh//g" Makefile
done done
grep -rl 'path_prepend_' tests/* | xargs sed -i 's| path_prepend_ ./src||' # Remove tests checking for --version & --help
# Not really interesting for us and logs are too big
# Remove tests checking for --version & --help sed -i -e '/tests\/help\/help-version.sh/ D' \
# Not really interesting for us and logs are too big
sed -i -e '/tests\/help\/help-version.sh/ D' \
-e '/tests\/help\/help-version-getopt.sh/ D' \ -e '/tests\/help\/help-version-getopt.sh/ D' \
Makefile Makefile
touch gnu-built
fi
grep -rl 'path_prepend_' tests/* | xargs sed -i 's| path_prepend_ ./src||'
# printf doesn't limit the values used in its arg, so this produced ~2GB of output # printf doesn't limit the values used in its arg, so this produced ~2GB of output
sed -i '/INT_OFLOW/ D' tests/printf/printf.sh sed -i '/INT_OFLOW/ D' tests/printf/printf.sh