.gitlab-ci/build.sh | 64 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 16 deletions(-) New commits: commit 759f1b0d33cc8591af627948539cc9e74c1271cb Merge: 276a9e2 437d9f1 Author: Akira TAGOH <akira@xxxxxxxxx> Date: Mon Apr 7 10:52:07 2025 +0000 Merge branch 'ci-fix-buildscript' into 'main' CI: fix build script See merge request fontconfig/fontconfig!377 commit 437d9f13575f692ad5d8b465f95ad0feba0bb999 Author: Akira TAGOH <akira@xxxxxxxxx> Date: Mon Apr 7 17:43:39 2025 +0900 ci: default to clean-build diff --git a/.gitlab-ci/build.sh b/.gitlab-ci/build.sh index d08052d..2de7a23 100755 --- a/.gitlab-ci/build.sh +++ b/.gitlab-ci/build.sh @@ -16,6 +16,7 @@ disable=() distcheck=0 enable_install=1 disable_check=0 +clean_build=1 cross=0 buildsys="meson" type="shared" @@ -27,7 +28,7 @@ export BUILD_ID=${BUILD_ID:-fontconfig-$$} export PREFIX=${PREFIX:-$MyPWD/prefix} export BUILDDIR=${BUILDDIR:-$MyPWD/build} -while getopts a:cCe:d:hIs:t:X: OPT +while getopts a:cCe:d:hINs:t:X: OPT do case $OPT in 'a') arch=$OPTARG ;; @@ -36,6 +37,7 @@ do 'e') enable+=($OPTARG) ;; 'd') disable+=($OPTARG) ;; 'I') enable_install=0 ;; + 'N') clean_build=0 ;; 's') buildsys=$OPTARG ;; 't') type=$OPTARG ;; 'X') backend=$OPTARG ;; @@ -103,8 +105,10 @@ if [ x"$buildsys" == "xautotools" ]; then fi . .gitlab-ci/${FC_DISTRO_NAME}-cross.sh fi - rm -rf "$BUILDDIR" "$PREFIX" || : - mkdir "$BUILDDIR" "$PREFIX" + if [ $clean_build -eq 1 ]; then + rm -rf "$BUILDDIR" "$PREFIX" || : + mkdir "$BUILDDIR" "$PREFIX" + fi cd "$BUILDDIR" TASK="autogen.sh" ../autogen.sh --prefix="$PREFIX" --disable-cache-build ${buildopt[*]} 2>&1 | tee /tmp/fc-build.log @@ -165,6 +169,9 @@ elif [ x"$buildsys" == "xmeson" ]; then . .gitlab-ci/$FC_DISTRO_NAME-cross.sh fi buildopt+=(--default-library=$type) + if [ $clean_build -eq 1 ]; then + rm -rf $BUILDDIR || : + fi TASK="meson setup" meson setup --prefix="$PREFIX" -Dnls=enabled -Dcache-build=disabled -Diconv=enabled ${buildopt[*]} "$BUILDDIR" 2>&1 | tee /tmp/fc-build.log TASK="meson compile" @@ -183,5 +190,4 @@ elif [ x"$buildsys" == "xmeson" ]; then fi fi TASK= -mv /tmp/fc-build.log . || : exit $r commit 3829ca4684c998936a7b7cfc416e82a07e9939ef Author: Akira TAGOH <akira@xxxxxxxxx> Date: Mon Apr 7 16:57:23 2025 +0900 ci: Stop on fail anyway diff --git a/.gitlab-ci/build.sh b/.gitlab-ci/build.sh index 965c2aa..d08052d 100755 --- a/.gitlab-ci/build.sh +++ b/.gitlab-ci/build.sh @@ -54,6 +54,18 @@ esac env r=0 +clean_exit() { + rc=$? + trap - INT TERM ABRT EXIT + if [ "x$TASK" != "x" ]; then + echo "Aborting from \"$TASK\" with the exit code $rc" + fi + mv /tmp/fc-build.log . || : + exit $rc +} + +trap clean_exit INT TERM ABRT EXIT + if [ x"$buildsys" == "xautotools" ]; then for i in "${enable[@]}"; do buildopt+=(--enable-$i) @@ -94,18 +106,24 @@ if [ x"$buildsys" == "xautotools" ]; then rm -rf "$BUILDDIR" "$PREFIX" || : mkdir "$BUILDDIR" "$PREFIX" cd "$BUILDDIR" - ../autogen.sh --prefix="$PREFIX" --disable-cache-build ${buildopt[*]} 2>&1 | tee /tmp/fc-build.log || r=$? - $MAKE V=1 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="autogen.sh" + ../autogen.sh --prefix="$PREFIX" --disable-cache-build ${buildopt[*]} 2>&1 | tee /tmp/fc-build.log + TASK="make" + $MAKE V=1 2>&1 | tee -a /tmp/fc-build.log if [ $disable_check -eq 0 ]; then - $MAKE check V=1 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="make check" + $MAKE check V=1 2>&1 | tee -a /tmp/fc-build.log fi if [ $enable_install -eq 1 ]; then - $MAKE install V=1 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="make install" + $MAKE install V=1 2>&1 | tee -a /tmp/fc-build.log fi if [ $distcheck -eq 1 ]; then - $MAKE distcheck V=1 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="make distcheck" + $MAKE distcheck V=1 2>&1 | tee -a /tmp/fc-build.log fi elif [ x"$buildsys" == "xmeson" ]; then + TASK="pip install" pip install meson # tomli not required for Python >= 3.11 pip install tomli @@ -114,6 +132,7 @@ elif [ x"$buildsys" == "xmeson" ]; then # Update bindgen on Fontations builds to improve support for constants in fcint.h if [[ "$i" == "fontations" ]]; then + TASK="cargo install" cargo install bindgen-cli # Prepend the cargo bin directory to PATH if [[ -d "$HOME/.cargo/bin" ]]; then @@ -124,6 +143,7 @@ elif [ x"$buildsys" == "xmeson" ]; then fi fi done + TASK= for i in "${disable[@]}"; do buildopt+=(-D$i=disabled) done @@ -145,17 +165,23 @@ elif [ x"$buildsys" == "xmeson" ]; then . .gitlab-ci/$FC_DISTRO_NAME-cross.sh fi buildopt+=(--default-library=$type) - meson setup --prefix="$PREFIX" -Dnls=enabled -Dcache-build=disabled -Diconv=enabled ${buildopt[*]} "$BUILDDIR" 2>&1 | tee /tmp/fc-build.log || r=$? - meson compile -v -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="meson setup" + meson setup --prefix="$PREFIX" -Dnls=enabled -Dcache-build=disabled -Diconv=enabled ${buildopt[*]} "$BUILDDIR" 2>&1 | tee /tmp/fc-build.log + TASK="meson compile" + meson compile -v -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log if [ $disable_check -eq 0 ]; then - meson test -v -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="meson test" + meson test -v -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log fi if [ $enable_install -eq 1 ]; then - meson install -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="meson install" + meson install -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log fi if [ $distcheck -eq 1 ]; then - meson dist -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log || r=$? + TASK="meson dist" + meson dist -C "$BUILDDIR" 2>&1 | tee -a /tmp/fc-build.log fi fi +TASK= mv /tmp/fc-build.log . || : exit $r commit 63a20ab39201ea2d98c956688c24a062cb436b8f Author: Akira TAGOH <akira@xxxxxxxxx> Date: Mon Apr 7 16:32:22 2025 +0900 ci: Change the default build system to meson diff --git a/.gitlab-ci/build.sh b/.gitlab-ci/build.sh index db4accc..965c2aa 100755 --- a/.gitlab-ci/build.sh +++ b/.gitlab-ci/build.sh @@ -17,8 +17,8 @@ distcheck=0 enable_install=1 disable_check=0 cross=0 -buildsys="autotools" -type="both" +buildsys="meson" +type="shared" arch="" buildopt=() SRCDIR=$MyPWD