From 29660ac032ffe98121e104222be62d30260aabfa Mon Sep 17 00:00:00 2001 From: Michael Nightingale <9887246+mnightingale@users.noreply.github.com> Date: Tue, 4 Aug 2026 18:36:31 +0100 Subject: [PATCH 1/5] Fix optimised macOS builds --- .github/workflows/build-release.yml | 40 ++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 02d4a0b6..706ea08b 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -117,11 +117,8 @@ jobs: include: - arch: amd64 xcxxflags: -arch x86_64 -mmacosx-version-min=10.13 - configure_host: --host=x86_64-apple-darwin - arch: arm64 - xcxxflags: -mmacosx-version-min=11.0 - - arch: universal - xcxxflags: -arch x86_64 -arch arm64 -mmacosx-version-min=10.13 + xcxxflags: -arch arm64 -mmacosx-version-min=11.0 runs-on: macos-latest @@ -131,12 +128,15 @@ jobs: - name: prepare run: brew install automake + # NOTE: setting CFLAGS/CXXFLAGS suppresses autoconf's default "-g -O2", + # so -O2 must be passed explicitly or the build ends up unoptimised. - name: Build env: - CXXFLAGS: ${{ matrix.xcxxflags }} + CFLAGS: -O2 ${{ matrix.xcxxflags }} + CXXFLAGS: -O2 ${{ matrix.xcxxflags }} run: | ./automake.sh - ./configure ${{ matrix.configure_host }} + ./configure make strip par2 @@ -148,6 +148,34 @@ jobs: par2 retention-days: 5 + build-macos-universal: + needs: + - build-macos + + runs-on: macos-latest + + steps: + - name: Download slices + uses: actions/download-artifact@v7 + with: + pattern: par2cmdline-macos-* + + - name: Create universal binary + run: | + lipo -create \ + par2cmdline-macos-amd64/par2 \ + par2cmdline-macos-arm64/par2 \ + -output par2 + lipo -info par2 + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: par2cmdline-macos-universal + path: | + par2 + retention-days: 5 + build-freebsd: needs: - build-check-freebsd From 6450d6e3150a124175e1fe43ac012364b7707da4 Mon Sep 17 00:00:00 2001 From: Michael Nightingale <9887246+mnightingale@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:12:27 +0100 Subject: [PATCH 2/5] windows-latest does not have v143 --- libpar2.vcxproj | 2 +- par2cmdline.vcxproj | 2 +- tests/commandline_test.vcxproj | 2 +- tests/crc_test.vcxproj | 2 +- tests/criticalpacket_test.vcxproj | 2 +- tests/descriptionpacket_test.vcxproj | 2 +- tests/diskfile_test.vcxproj | 2 +- tests/galois_test.vcxproj | 2 +- tests/letype_test.vcxproj | 2 +- tests/libpar2_test.vcxproj | 2 +- tests/md5_test.vcxproj | 2 +- tests/reedsolomon_test.vcxproj | 2 +- tests/utf8_test.vcxproj | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libpar2.vcxproj b/libpar2.vcxproj index 5e201779..3ee84908 100644 --- a/libpar2.vcxproj +++ b/libpar2.vcxproj @@ -35,7 +35,7 @@ StaticLibrary Unicode - v143 + v145 diff --git a/par2cmdline.vcxproj b/par2cmdline.vcxproj index 77795e32..85e0247f 100644 --- a/par2cmdline.vcxproj +++ b/par2cmdline.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/commandline_test.vcxproj b/tests/commandline_test.vcxproj index 16b2642c..43b34c09 100644 --- a/tests/commandline_test.vcxproj +++ b/tests/commandline_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/crc_test.vcxproj b/tests/crc_test.vcxproj index a32dcac5..475f2012 100644 --- a/tests/crc_test.vcxproj +++ b/tests/crc_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/criticalpacket_test.vcxproj b/tests/criticalpacket_test.vcxproj index 285beb50..59f80729 100644 --- a/tests/criticalpacket_test.vcxproj +++ b/tests/criticalpacket_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/descriptionpacket_test.vcxproj b/tests/descriptionpacket_test.vcxproj index bdc6df70..ae3e4f53 100644 --- a/tests/descriptionpacket_test.vcxproj +++ b/tests/descriptionpacket_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/diskfile_test.vcxproj b/tests/diskfile_test.vcxproj index 4ad53f2b..aa487ce4 100644 --- a/tests/diskfile_test.vcxproj +++ b/tests/diskfile_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/galois_test.vcxproj b/tests/galois_test.vcxproj index 8238f95f..18bbae7b 100644 --- a/tests/galois_test.vcxproj +++ b/tests/galois_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/letype_test.vcxproj b/tests/letype_test.vcxproj index ba9f1c99..90bd5306 100644 --- a/tests/letype_test.vcxproj +++ b/tests/letype_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/libpar2_test.vcxproj b/tests/libpar2_test.vcxproj index 00dd4f76..db3c26bd 100644 --- a/tests/libpar2_test.vcxproj +++ b/tests/libpar2_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/md5_test.vcxproj b/tests/md5_test.vcxproj index 5ef80c28..1eb48d05 100644 --- a/tests/md5_test.vcxproj +++ b/tests/md5_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/reedsolomon_test.vcxproj b/tests/reedsolomon_test.vcxproj index 6aa5194e..ebd8e1f7 100644 --- a/tests/reedsolomon_test.vcxproj +++ b/tests/reedsolomon_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 diff --git a/tests/utf8_test.vcxproj b/tests/utf8_test.vcxproj index 2364fab1..66ad72a4 100644 --- a/tests/utf8_test.vcxproj +++ b/tests/utf8_test.vcxproj @@ -35,7 +35,7 @@ Application Unicode - v143 + v145 From e077ef5556f2899439ee7ad3cd42d6310656030c Mon Sep 17 00:00:00 2001 From: Michael Nightingale <9887246+mnightingale@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:21:52 +0100 Subject: [PATCH 3/5] Use the cores --- .github/workflows/build-check-freebsd.yml | 2 +- .github/workflows/build-check-linux.yml | 2 +- .github/workflows/build-check-macos.yml | 2 +- .github/workflows/build-release.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-check-freebsd.yml b/.github/workflows/build-check-freebsd.yml index 44b4ccc7..e50d7ce2 100644 --- a/.github/workflows/build-check-freebsd.yml +++ b/.github/workflows/build-check-freebsd.yml @@ -21,6 +21,6 @@ jobs: sudo pkg install -y autoconf automake libtool ./automake.sh ./configure - make + make -j"$(nproc)" make check make distcheck \ No newline at end of file diff --git a/.github/workflows/build-check-linux.yml b/.github/workflows/build-check-linux.yml index 75f53b3c..6aec8d09 100644 --- a/.github/workflows/build-check-linux.yml +++ b/.github/workflows/build-check-linux.yml @@ -15,6 +15,6 @@ jobs: run: | ./automake.sh ./configure - make + make -j"$(nproc)" make check make distcheck diff --git a/.github/workflows/build-check-macos.yml b/.github/workflows/build-check-macos.yml index 4046fcf6..c9e5c305 100644 --- a/.github/workflows/build-check-macos.yml +++ b/.github/workflows/build-check-macos.yml @@ -18,6 +18,6 @@ jobs: run: | ./automake.sh ./configure - make + make -j"$(sysctl -n hw.ncpu)" make check make distcheck diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 706ea08b..bb7a6c4f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -63,7 +63,7 @@ jobs: run: | ./automake.sh ./configure ${{ matrix.configure_host }} - make + make -j"$(nproc)" - name: Upload binary artifact uses: actions/upload-artifact@v7 @@ -137,7 +137,7 @@ jobs: run: | ./automake.sh ./configure - make + make -j"$(sysctl -n hw.ncpu)" strip par2 - name: Upload binary artifact From c65439a3eff33804985a616db51db4b4219e0ceb Mon Sep 17 00:00:00 2001 From: Michael Nightingale <9887246+mnightingale@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:59:16 +0100 Subject: [PATCH 4/5] O3 --- .github/workflows/build-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index bb7a6c4f..c4a87b24 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -132,8 +132,8 @@ jobs: # so -O2 must be passed explicitly or the build ends up unoptimised. - name: Build env: - CFLAGS: -O2 ${{ matrix.xcxxflags }} - CXXFLAGS: -O2 ${{ matrix.xcxxflags }} + CFLAGS: -O3 ${{ matrix.xcxxflags }} + CXXFLAGS: -O3 ${{ matrix.xcxxflags }} run: | ./automake.sh ./configure From c9fc3fc133e12dc6d23e0a4d223f624e0cc09de2 Mon Sep 17 00:00:00 2001 From: Michael Nightingale <9887246+mnightingale@users.noreply.github.com> Date: Sat, 8 Aug 2026 10:40:32 +0100 Subject: [PATCH 5/5] Faster builds for freebsd also --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c4a87b24..dc6436ac 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -209,7 +209,7 @@ jobs: sudo pkg install -y autoconf automake libtool ./automake.sh ./configure - make + make -j"$(nproc)" strip par2 - name: Upload binary artifact