From f9cac1a9afb680f0d065547ce5302cbfb415cc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Thu, 29 Aug 2024 12:55:32 +0200 Subject: [PATCH] Add workflow for mingw-w64-gcc package testing --- .github/scripts/build-package.sh | 35 ++-- .github/scripts/check-package.sh | 30 ++++ .github/scripts/patch-dejagnu.sh | 18 ++ .github/scripts/patch-makepkg.sh | 21 +++ .../build-and-test-mingw-w64-gcc.yml | 78 +++++++++ .github/workflows/build-package.yml | 67 +++++++- .github/workflows/mingw-native-toolchain.yml | 18 ++ patches/dejagnu/0001-local-exec.patch | 159 ++++++++++++++++++ patches/makepkg/0004-add-recheck-option.patch | 56 ++++++ 9 files changed, 459 insertions(+), 23 deletions(-) create mode 100644 .github/scripts/check-package.sh create mode 100755 .github/scripts/patch-dejagnu.sh create mode 100755 .github/scripts/patch-makepkg.sh create mode 100644 .github/workflows/build-and-test-mingw-w64-gcc.yml create mode 100644 patches/dejagnu/0001-local-exec.patch create mode 100644 patches/makepkg/0004-add-recheck-option.patch diff --git a/.github/scripts/build-package.sh b/.github/scripts/build-package.sh index 73101d3..ed43e11 100755 --- a/.github/scripts/build-package.sh +++ b/.github/scripts/build-package.sh @@ -9,30 +9,33 @@ PACKAGE_REPOSITORY=$1 CLEAN_BUILD=${CLEAN_BUILD:-0} INSTALL_PACKAGE=${INSTALL_PACKAGE:-0} NO_EXTRACT=${NO_EXTRACT:-0} +NO_CHECK=${NO_CHECK:-1} +NO_ARCHIVE=${NO_ARCHIVE:-0} ARGUMENTS="--syncdeps \ - --rmdeps \ - --noconfirm \ - --noprogressbar \ - --nocheck \ - --skippgpcheck \ - --force \ - $([ "$NO_EXTRACT" = 1 ] && echo "--noextract" || echo "") \ - $([ "$CLEAN_BUILD" = 1 ] && echo "--cleanbuild" || echo "") \ - $([ "$INSTALL_PACKAGE" = 1 ] && echo "--install" || echo "")" + --rmdeps \ + --noconfirm \ + --noprogressbar \ + --skippgpcheck \ + --force \ + $([ "$NO_EXTRACT" = 1 ] && echo "--noextract" || echo "") \ + $([ "$NO_CHECK" = 1 ] && echo "--nocheck " || echo "") \ + $([ "$NO_ARCHIVE" = 1 ] && echo "--noarchive" || echo "") \ + $([ "$CLEAN_BUILD" = 1 ] && echo "--cleanbuild" || echo "") \ + $([ "$INSTALL_PACKAGE" = 1 ] && echo "--install" || echo "")" echo "::group::Ccache statistics before build" - ccache -svv || true + ccache -svv || true echo "::endgroup::" echo "::group::Build package" - if [[ "$PACKAGE_REPOSITORY" == *MINGW* ]]; then - makepkg-mingw $ARGUMENTS - else - makepkg $ARGUMENTS - fi + if [[ "$PACKAGE_REPOSITORY" == *MINGW* ]]; then + makepkg-mingw $ARGUMENTS + else + makepkg $ARGUMENTS + fi echo "::endgroup::" echo "::group::Ccache statistics after build" - ccache -svv || true + ccache -svv || true echo "::endgroup::" diff --git a/.github/scripts/check-package.sh b/.github/scripts/check-package.sh new file mode 100644 index 0000000..c2212bc --- /dev/null +++ b/.github/scripts/check-package.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e # exit on error +set -x # echo on +set -o pipefail # fail of any command in pipeline is an error + +PACKAGE_REPOSITORY=$1 + +INSTALL_PACKAGE=${INSTALL_PACKAGE:-0} +NO_EXTRACT=${NO_EXTRACT:-1} +NO_ARCHIVE=${NO_ARCHIVE:-1} + +ARGUMENTS="--syncdeps \ + --rmdeps \ + --noconfirm \ + --noprogressbar \ + --skippgpcheck \ + --recheck \ + --force \ + $([ "$NO_EXTRACT" = 1 ] && echo "--noextract" || echo "") \ + $([ "$NO_ARCHIVE" = 1 ] && echo "--noarchive" || echo "") \ + $([ "$INSTALL_PACKAGE" = 1 ] && echo "--install" || echo "")" + +echo "::group::Check package" + if [[ "$PACKAGE_REPOSITORY" == *MINGW* ]]; then + makepkg-mingw $ARGUMENTS + else + makepkg $ARGUMENTS + fi +echo "::endgroup::" diff --git a/.github/scripts/patch-dejagnu.sh b/.github/scripts/patch-dejagnu.sh new file mode 100755 index 0000000..a9af8dc --- /dev/null +++ b/.github/scripts/patch-dejagnu.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e # exit on error +set -x # echo on +set -o pipefail # fail of any command in pipeline is an error + +DIR="`dirname ${BASH_SOURCE[0]}`/../.." +DIR=`realpath $DIR` + +echo "::group::Install patch" + pacman -S --noconfirm patch +echo "::endgroup::" + +pushd / + echo "::group::Patch Dejagnu" + patch -p1 -b -i "$DIR/patches/dejagnu/0001-local-exec.patch" + echo "::endgroup::" +popd diff --git a/.github/scripts/patch-makepkg.sh b/.github/scripts/patch-makepkg.sh new file mode 100755 index 0000000..c02b844 --- /dev/null +++ b/.github/scripts/patch-makepkg.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e # exit on error +set -x # echo on +set -o pipefail # fail of any command in pipeline is an error + +if [ -z "$GITHUB_WORKSPACE" ]; then + DIR=`pwd` +else + DIR=`cygpath "$GITHUB_WORKSPACE"` +fi + +echo "::group::Install patch" + pacman -S --noconfirm patch +echo "::endgroup::" + +pushd / + echo "::group::Patch MSYS2 environment" + patch -p1 -b -i "$DIR/patches/makepkg/0004-add-recheck-option.patch" + echo "::endgroup::" +popd diff --git a/.github/workflows/build-and-test-mingw-w64-gcc.yml b/.github/workflows/build-and-test-mingw-w64-gcc.yml new file mode 100644 index 0000000..bb89ba1 --- /dev/null +++ b/.github/workflows/build-and-test-mingw-w64-gcc.yml @@ -0,0 +1,78 @@ +name: Build and test mingw-w64-gcc + +on: + pull_request: + workflow_dispatch: + inputs: + packages_repository: + description: "MSYS2 packages repository to build from" + type: string + default: "Windows-on-ARM-Experiments/MINGW-packages" + packages_branch: + description: "MSYS2 packages branch to build from" + type: string + default: "woarm64" + arch: + description: 'Architecture that should be built and tested' + required: false + default: 'aarch64' + tag: + description: 'Tag to use for the artifact' + required: true + gcc_module: + description: 'GCC module to test' + required: false + default: 'gcc-c' + gcc_test_filter: + description: 'GCC test filter' + required: false + default: 'compile.exp=103818.c' + workflow_call: + inputs: + packages_repository: + type: string + packages_branch: + type: string + arch: + type: string + tag: + type: string + gcc_module: + type: string + gcc_test_filter: + type: string + +jobs: + build-and-test-mingw-w64-gcc: + name: Build and test mingw-w64-gcc + uses: ./.github/workflows/build-package.yml + with: + package_name: mingw-w64-gcc + packages_repository: ${{ inputs.packages_repository || 'Windows-on-ARM-Experiments/MINGW-packages' }} + packages_branch: ${{ inputs.packages_branch || 'woarm64' }} + runner_arch: ${{ inputs.arch || 'aarch64' }} + cross_build: false + check: true + check_module: ${{ inputs.gcc_module || 'gcc-c' }} + check_filter: ${{ inputs.gcc_test_filter || 'compile.exp=103818.c' }} + + create-summary: + needs: build-and-test-mingw-w64-gcc + name: Create summary + runs-on: ubuntu-latest + + steps: + - name: Checkout mingw-woarm64-build repository + uses: actions/checkout@v4 + with: + repository: Windows-on-ARM-Experiments/mingw-woarm64-build + + - name: Download test results artifacts + uses: actions/download-artifact@v4 + with: + name: mingw-w64-gcc-test-results + path: ${{ github.workspace }}/test-results + + - name: Create summary + run: | + .github/scripts/toolchain/create-gcc-summary.sh ${{ github.workspace }}/test-results >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index 97c09ce..78ac48b 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -18,6 +18,10 @@ on: description: "Architecture to build on" type: string default: "x86_64" + cross_build: + description: "Use MSYS2 -> MINGW cross-compiler" + type: boolean + default: false needs: description: "Parent workflow job dependencies" type: string @@ -25,6 +29,18 @@ on: description: "Install additional dependencies" type: string default: "" + check: + description: "Enable check step after the package is built" + type: boolean + default: false + check_module: + description: "Module to test" + type: string + default: "" + check_filter: + description: "Test filter" + type: string + default: "" defaults: run: @@ -32,8 +48,9 @@ defaults: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROSS_BUILD: ${{ inputs.runner_arch == 'aarch64' && '1' || '0' }} - CLEAN_BUILD: 1 + CROSS_BUILD: ${{ inputs.cross_build && '1' || '0' }} + MODULE: ${{ inputs.check_module }} + FILTER: ${{ inputs.check_filter }} jobs: build: @@ -41,11 +58,13 @@ jobs: runs-on: >- ${{ fromJson(inputs.runner_arch == 'aarch64' && '["Windows", "ARM64", "Blackhex"]' - || '["windows-latest"]') }} + || (inputs.check && '["Windows", "X64", "GCC"]' || '["windows-latest"]') + ) }} + timeout-minutes: ${{ inputs.check && 720 || 180 }} steps: - name: Kill hanging processes - if: ${{ inputs.runner_arch == 'aarch64' }} + if: ${{ inputs.runner_arch == 'aarch64' || inputs.check }} shell: powershell run: | tasklist @@ -62,7 +81,7 @@ jobs: git config --global core.longpaths true - name: Fix $PATH - if: ${{ inputs.runner_arch == 'aarch64' }} + if: ${{ inputs.runner_arch == 'aarch64' || inputs.check }} shell: powershell run: | Write-Output "GITHUB_PATH: $env:GITHUB_PATH" @@ -120,8 +139,11 @@ jobs: mingw-w64-x86_64-jq \ base-devel \ ${{ contains(inputs.packages_repository, 'MINGW') - && 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs' - || '' }} \ + && (inputs.cross_build + && 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs' + || 'mingw-w64-aarch64-gcc') + || '' }} \ + ${{ inputs.check && 'dejagnu' || ''}} \ ${{ inputs.dependencies }} - name: Download artifacts @@ -139,6 +161,16 @@ jobs: run: | `cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh + - name: Patch Dejagnu + if: ${{ inputs.check }} + run: | + `cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh + + - name: Patch makepkg + if: ${{ inputs.check }} + run: | + `cygpath "${{ github.workspace }}"`/.github/scripts/patch-makepkg.sh + - name: Setup MINGWARM64 environment if: ${{ inputs.runner_arch == 'aarch64' }} run: | @@ -158,9 +190,21 @@ jobs: - name: Build ${{ inputs.package_name }} working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }} + env: + CLEAN_BUILD: 1 + NO_ARCHIVE: ${{ inputs.check && '1' || '0' }} run: | `cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }} + - name: Check ${{ inputs.package_name }} + if: ${{ inputs.check }} + working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }} + env: + NO_EXTRACT: 1 + NO_ARCHIVE: 1 + run: | + `cygpath "${{ github.workspace }}"`/.github/scripts/check-package.sh ${{ inputs.packages_repository }} + - name: Save Ccache if: always() uses: actions/cache/save@v4 @@ -169,12 +213,21 @@ jobs: key: ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }} - name: Upload ${{ inputs.package_name }} + if: ${{ !inputs.check }} uses: actions/upload-artifact@v4 with: name: ${{ inputs.package_name }} retention-days: 7 path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst + - name: Upload ${{ inputs.package_name }} test results + if: ${{ inputs.check }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.package_name }}-test-results + retention-days: 14 + path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results + - name: Upload build folder if: failure() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/mingw-native-toolchain.yml b/.github/workflows/mingw-native-toolchain.yml index 91a133b..16b73fb 100644 --- a/.github/workflows/mingw-native-toolchain.yml +++ b/.github/workflows/mingw-native-toolchain.yml @@ -26,6 +26,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-libtre-git: uses: ./.github/workflows/build-package.yml @@ -34,6 +35,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-libsystre: needs: [ @@ -45,6 +47,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-ncurses: @@ -58,6 +61,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-gettext: @@ -73,6 +77,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-headers-git: @@ -82,6 +87,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-crt-git: needs: [ @@ -93,6 +99,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-winpthreads-git: @@ -106,6 +113,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-bzip2: @@ -115,6 +123,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-zlib: needs: [ @@ -126,6 +135,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-zstd: @@ -135,6 +145,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-gmp: uses: ./.github/workflows/build-package.yml @@ -143,6 +154,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-mpfr: uses: ./.github/workflows/build-package.yml @@ -154,6 +166,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-isl: @@ -166,6 +179,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-binutils: @@ -190,6 +204,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-mpc: @@ -203,6 +218,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true needs: ${{ toJson(needs) }} mingw-w64-windows-default-manifest: @@ -212,6 +228,7 @@ jobs: packages_repository: Windows-on-ARM-Experiments/MINGW-packages packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 + cross_build: true mingw-w64-gcc: needs: [ @@ -240,3 +257,4 @@ jobs: packages_branch: ${{ github.event.inputs.mingw_packages_branch || 'woarm64' }} runner_arch: aarch64 needs: ${{ toJson(needs) }} + cross_build: true diff --git a/patches/dejagnu/0001-local-exec.patch b/patches/dejagnu/0001-local-exec.patch new file mode 100644 index 0000000..86d664b --- /dev/null +++ b/patches/dejagnu/0001-local-exec.patch @@ -0,0 +1,159 @@ +--- a/usr/share/dejagnu/remote.exp ++++ b/usr/share/dejagnu/remote.exp +@@ -164,14 +164,7 @@ + # ignore SIGHUP. + global errorInfo + if { $inp eq "" && $outp eq "" } { +- set id -1 +- set result [catch "eval spawn -ignore SIGHUP \{${commandline}\}" pid] +- if { $result == 0 } { +- set result2 0 +- } else { +- set pid 0 +- set result2 5 +- } ++ set status [catch "exec timeout -k 5 10 $commandline" output] + } else { + # Use a command pipeline with open. + if { $inp ne "" } { +@@ -205,78 +198,80 @@ + } + set pid [pid $id] + set result [catch "spawn -ignore SIGHUP -leaveopen $id" result2] +- } +- # Prepend "-" to each pid, to generate the "process group IDs" needed by +- # kill. +- set pgid "-[join $pid { -}]" +- verbose "pid is $pid $pgid" +- if { $result != 0 || $result2 != 0 } { +- # This shouldn't happen. +- if {[info exists errorInfo]} { +- set foo $errorInfo +- } else { +- set foo "" ++ ++ # Prepend "-" to each pid, to generate the "process group IDs" needed by ++ # kill. ++ set pgid "-[join $pid { -}]" ++ verbose "pid is $pid $pgid" ++ if { $result != 0 || $result2 != 0 } { ++ # This shouldn't happen. ++ if {[info exists errorInfo]} { ++ set foo $errorInfo ++ } else { ++ set foo "" ++ } ++ verbose "spawn -open $id failed, $result $result2, $foo" ++ catch "close $id" ++ return [list -1 "spawn failed"] + } +- verbose "spawn -open $id failed, $result $result2, $foo" +- catch "close $id" +- return [list -1 "spawn failed"] +- } + +- set got_eof 0 +- set output "" ++ set got_eof 0 ++ set output "" + +- # Wait for either $timeout seconds to elapse, or for the program to +- # exit. +- expect { +- -i $spawn_id -timeout $timeout -re ".+" { +- append output $expect_out(buffer) +- exp_continue -continue_timer +- } +- timeout { +- warning "program timed out" +- } +- eof { +- set got_eof 1 ++ # Wait for either $timeout seconds to elapse, or for the program to ++ # exit. ++ expect { ++ -i $spawn_id -timeout $timeout -re ".+" { ++ append output $expect_out(buffer) ++ exp_continue -continue_timer ++ } ++ timeout { ++ warning "program timed out" ++ } ++ eof { ++ set got_eof 1 ++ } + } +- } + +- # If we didn't get EOF, we have to kill the poor defenseless program. +- if { $got_eof } { +- set pid -1 +- } +- set r2 [close_wait_program $spawn_id $pid wres] +- if { $id > 0 } { +- if { $pid > 0 } { +- # If timed-out, don't wait for all the processes associated +- # with the pipeline to terminate as a stuck one would cause +- # us to hang. +- catch {fconfigure $id -blocking false} ++ # If we didn't get EOF, we have to kill the poor defenseless program. ++ if { $got_eof } { ++ set pid -1 + } +- set r2 [catch "close $id" res] +- } else { +- verbose "waitres is $wres" 2 +- if { $r2 == 0 } { +- set r2 [lindex $wres 3] +- if { [llength $wres] > 4 } { +- if { [lindex $wres 4] eq "CHILDKILLED" } { +- set r2 1 +- } ++ set r2 [close_wait_program $spawn_id $pid wres] ++ if { $id > 0 } { ++ if { $pid > 0 } { ++ # If timed-out, don't wait for all the processes associated ++ # with the pipeline to terminate as a stuck one would cause ++ # us to hang. ++ catch {fconfigure $id -blocking false} + } +- if { $r2 != 0 } { +- set res $wres ++ set r2 [catch "close $id" res] ++ } else { ++ verbose "waitres is $wres" 2 ++ if { $r2 == 0 } { ++ set r2 [lindex $wres 3] ++ if { [llength $wres] > 4 } { ++ if { [lindex $wres 4] eq "CHILDKILLED" } { ++ set r2 1 ++ } ++ } ++ if { $r2 != 0 } { ++ set res $wres ++ } else { ++ set res "" ++ } + } else { +- set res "" ++ set res "wait failed" + } ++ } ++ if { $r2 != 0 || $res ne "" || ! $got_eof } { ++ verbose "close result is $res" ++ set status 1 + } else { +- set res "wait failed" ++ set status 0 + } + } +- if { $r2 != 0 || $res ne "" || ! $got_eof } { +- verbose "close result is $res" +- set status 1 +- } else { +- set status 0 +- } ++ + verbose "output is $output status $status" + if { $outp eq "" || $outp eq "|& cat" } { + return [list $status $output] diff --git a/patches/makepkg/0004-add-recheck-option.patch b/patches/makepkg/0004-add-recheck-option.patch new file mode 100644 index 0000000..b7a7b5c --- /dev/null +++ b/patches/makepkg/0004-add-recheck-option.patch @@ -0,0 +1,56 @@ +--- a/usr/bin/makepkg ++++ b/usr/bin/makepkg +@@ -70,6 +70,7 @@ + PKGVERFUNC=0 + PREPAREFUNC=0 + REPKG=0 ++RECHECK=0 + REPRODUCIBLE=0 + RMDEPS=0 + SKIPCHECKSUMS=0 +@@ -879,6 +880,7 @@ + printf -- "$(gettext " -p Use an alternate build script (instead of '%s')")\n" "$BUILDSCRIPT" + printf -- "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")\n" + printf -- "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")\n" ++ printf -- "$(gettext " --recheck Run only the %s function in the %s without rebuilding")\n" "check()" "$BUILDSCRIPT" + printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman" + printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n" + printf -- "$(gettext " -V, --version Show version information and exit")\n" +@@ -943,7 +945,7 @@ + OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'dir:' 'force' 'geninteg' + 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild' + 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist' +- 'printsrcinfo' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' ++ 'printsrcinfo' 'repackage' 'recheck' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' + 'skippgpcheck' 'source' 'syncdeps' 'verifysource' 'version') + + # Pacman Options +@@ -992,6 +994,7 @@ + --printsrcinfo) BUILDPKG=0 PRINTSRCINFO=1 IGNOREARCH=1;; + -r|--rmdeps) RMDEPS=1 ;; + -R|--repackage) REPKG=1 ;; ++ --recheck) RECHECK=1 RUN_CHECK='y' ;; + --sign) SIGNPKG='y' ;; + --skipchecksums) SKIPCHECKSUMS=1 ;; + --skipinteg) SKIPCHECKSUMS=1; SKIPPGPCHECK=1 ;; +@@ -1299,7 +1302,7 @@ + export MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX + export DXSDK_DIR ACLOCAL_PATH PKG_CONFIG_PATH + +-if (( !REPKG )); then ++if (( !REPKG && !RECHECK )); then + if (( NOEXTRACT && ! VERIFYSOURCE )); then + warning "$(gettext "Using existing %s tree")" "\$srcdir/" + else +@@ -1348,8 +1351,10 @@ + + prepare_buildenv + +- if (( ! REPKG )); then ++ if (( !REPKG && !RECHECK )); then + (( BUILDFUNC )) && run_build ++ fi ++ if (( !REPKG )); then + (( CHECKFUNC )) && run_check + cd_safe "$startdir" + fi