From 9cb41f3085924770e59afddb39d5f8e7d7f8b628 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 10 Jun 2025 19:03:05 +0200 Subject: [PATCH 1/5] ci: add arm64 windows runner + MSYS2 clang + clangarm64 --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 905e7326..063f7e0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,22 +31,50 @@ jobs: static: true fatal_warnings: false # TODO: enable fatal warnings, once cpp-httplib is patched either by ourselves or by the maintainers - - name: Windows MingGW + - name: Windows MSVC (ARM64, static) + os: windows + os-version: 11-arm + environment: msvc + shell: pwsh + static: true + fatal_warnings: false # TODO: enable fatal warnings, once cpp-httplib is patched either by ourselves or by the maintainers + + - name: Windows MSYS2 (MingGW) os: windows os-version: 2025 - environment: mingw + environment: msys2 + msystem: MINGW64 architecture: x86_64 shell: 'msys2 {0}' fatal_warnings: true - - name: Windows UCRT + - name: Windows MSYS2 (UCRT) os: windows os-version: 2025 - environment: ucrt + environment: msys2 + msystem: UCRT64 architecture: ucrt-x86_64 shell: 'msys2 {0}' fatal_warnings: true + - name: Windows MSYS2 (CLANG) + os: windows + os-version: 2025 + environment: msys2 + msystem: CLANG64 + architecture: clang-x86_64 + shell: 'msys2 {0}' + fatal_warnings: true + + - name: Windows MSYS2 (ARM64, CLANG) + os: windows + os-version: 11-arm + environment: msys2 + msystem: CLANGARM64 + architecture: clang-x86_64 + shell: 'msys2 {0}' + fatal_warnings: true + - name: Linux (ARM64) os: ubuntu os-version: 24.04-arm @@ -112,10 +140,10 @@ jobs: toolset: '14.43' - name: Setup MSYS2 (Windows) - if: matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' ) + if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' uses: msys2/setup-msys2@v2 with: - msystem: ${{matrix.config.environment == 'mingw' && 'MINGW64' || 'UCRT64'}} + msystem: ${{matrix.config.msystem}} update: true install: >- mingw-w64-${{matrix.config.architecture}}-ninja @@ -131,11 +159,11 @@ jobs: git - name: Setup GCC (MSYS2) - if: matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' ) + if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' uses: Totto16/msys2-install-packages-pinned@v1 with: - msystem: ${{matrix.config.environment == 'mingw' && 'MINGW64' || 'UCRT64'}} - # gcc-libs 14 don't provbide the virtual package cc-libs, only gcc-libs 15 (see https://github.com/msys2/MINGW-packages/commit/9fa882f7eb6f639780a13df016497a93e45544ac) provide it, so until we use gcc 15, nghttp3 < 1.10.1 needs to be used (see https://github.com/msys2/MINGW-packages/commit/16b7f94772f29f1c207764701d863d266a5de64c) since 1.10.1 needs cc-libs and not gcc-libs. The newest version matching that constraint is 1.9.0 + msystem: ${{matrix.config.msystem}} + # gcc-libs 14 don't provide the virtual package cc-libs, only gcc-libs 15 (see https://github.com/msys2/MINGW-packages/commit/9fa882f7eb6f639780a13df016497a93e45544ac) provide it, so until we use gcc 15, nghttp3 < 1.10.1 needs to be used (see https://github.com/msys2/MINGW-packages/commit/16b7f94772f29f1c207764701d863d266a5de64c) since 1.10.1 needs cc-libs and not gcc-libs. The newest version matching that constraint is 1.9.0 # for the other pavckages see https://github.com/msys2/MINGW-packages/commit/62308009e77d772a126313626b194e503b0e5135 install: | nghttp3=1.9 From e5ffc6cbd0ff07018f515e0c1c74ac10b8537079 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 10 Jun 2025 19:14:26 +0200 Subject: [PATCH 2/5] ci: fix, improve arm support in if cases and in actions, remove unused config option --- .github/workflows/build.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 063f7e0b..39930499 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,6 @@ jobs: os: ubuntu os-version: 24.04-arm use-clang: false - arm: true shell: bash fatal_warnings: true @@ -87,7 +86,6 @@ jobs: os: ubuntu os-version: 24.04 use-clang: false - arm: false shell: bash fatal_warnings: true @@ -96,7 +94,6 @@ jobs: os-version: 24.04 use-clang: true use-clang_stdlib: false - arm: false shell: bash fatal_warnings: true @@ -105,21 +102,18 @@ jobs: os-version: 24.04 use-clang: true use-clang_stdlib: true - arm: false shell: bash fatal_warnings: true - name: MacOS os: macos os-version: 13 - arm: false shell: bash fatal_warnings: true - name: MacOS (Arm64) os: macos os-version: 15 - arm: true shell: bash fatal_warnings: true @@ -136,7 +130,7 @@ jobs: if: matrix.config.os == 'windows' && matrix.config.environment == 'msvc' uses: TheMrMilchmann/setup-msvc-dev@v3 with: - arch: x64 + arch: ${{matrix.config.os-version == '11-arm' && 'x64' || 'x64'}} # note this action doesn't really support arm64 yet, but it works like this already (by accident) toolset: '14.43' - name: Setup MSYS2 (Windows) @@ -203,7 +197,7 @@ jobs: uses: egor-tensin/setup-gcc@v1 with: version: 14 - platform: x64 + platform: ${{matrix.config.os-version == '24.04-arm' && 'x64' || 'x64'}} # note this action doesn't really support arm64 yet, but it works like this already (by accident) - name: Unbreak Python in GHA (MacOS 13 image) if: matrix.config.os == 'macos' && matrix.config.os-version == 13 From c0785dfcef9b69396fbf494ca1cfc3c8eaa60591 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 10 Jun 2025 19:15:02 +0200 Subject: [PATCH 3/5] ci: add arm64 clang job --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39930499..a187a59a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,6 +105,14 @@ jobs: shell: bash fatal_warnings: true + - name: Linux Clang (libc++, ARM64) + os: ubuntu + os-version: 24.04-arm + use-clang: true + use-clang_stdlib: true + shell: bash + fatal_warnings: true + - name: MacOS os: macos os-version: 13 From 93dc3f6cebfe446e75b9aaee450379c11cf2ad5c Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 10 Jun 2025 20:12:42 +0200 Subject: [PATCH 4/5] ci: correctly use clang in msys2 clang based environments --- .github/workflows/build.yml | 21 +++++++++++++++++---- tools/options/meson.build | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a187a59a..90c7e715 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,7 @@ jobs: environment: msys2 msystem: MINGW64 architecture: x86_64 + use-clang: false shell: 'msys2 {0}' fatal_warnings: true @@ -54,6 +55,7 @@ jobs: environment: msys2 msystem: UCRT64 architecture: ucrt-x86_64 + use-clang: false shell: 'msys2 {0}' fatal_warnings: true @@ -63,6 +65,7 @@ jobs: environment: msys2 msystem: CLANG64 architecture: clang-x86_64 + use-clang: true shell: 'msys2 {0}' fatal_warnings: true @@ -72,6 +75,7 @@ jobs: environment: msys2 msystem: CLANGARM64 architecture: clang-x86_64 + use-clang: true shell: 'msys2 {0}' fatal_warnings: true @@ -161,7 +165,7 @@ jobs: git - name: Setup GCC (MSYS2) - if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' + if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == false uses: Totto16/msys2-install-packages-pinned@v1 with: msystem: ${{matrix.config.msystem}} @@ -179,7 +183,16 @@ jobs: python=3.12.9-4 gcc=14 gcc-libs=! - - name: Setup Clang (Linux) (libc++) + - name: Setup Clang (MSYS2, libc++) + if: matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == true + uses: Totto16/msys2-install-packages-pinned@v1 + with: + msystem: ${{matrix.config.msystem}} + install: | + clang=20 + libc++=20 + + - name: Setup Clang (Linux, libc++) if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib run: | wget https://apt.llvm.org/llvm.sh @@ -190,7 +203,7 @@ jobs: echo "CXX=clang++-20" >> "$GITHUB_ENV" echo "OBJC=clang-20" >> "$GITHUB_ENV" - - name: Setup Clang (Linux) (libstdc++) + - name: Setup Clang (Linux, libstdc++) if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && (! matrix.config.use-clang_stdlib) run: | wget https://apt.llvm.org/llvm.sh @@ -257,7 +270,7 @@ jobs: brew install sdl2 sdl2_ttf sdl2_mixer sdl2_image - name: Configure - run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Drun_in_ci=true ${{( matrix.config.fatal_warnings ) && '--fatal-meson-warnings' || '' }} + run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' || ( matrix.config.os == 'windows' && matrix.config.environment == 'msys2' && matrix.config.use-clang == true ) ) && 'enabled' || 'disabled' }} -Drun_in_ci=true ${{( matrix.config.fatal_warnings ) && '--fatal-meson-warnings' || '' }} - name: Build run: meson compile -C build diff --git a/tools/options/meson.build b/tools/options/meson.build index b8a580aa..cbba1b85 100644 --- a/tools/options/meson.build +++ b/tools/options/meson.build @@ -78,7 +78,7 @@ if get_option('run_in_ci') 'compilers': [msvc_compiler_current], }, 'msys2': { - 'compilers': [gcc_14_compiler], + 'compilers': [clang_20_compiler, gcc_14_compiler], }, 'linux': { 'compilers': [clang_20_compiler, gcc_14_compiler], From 9d2a1d17db0b00a9afc2dcbe32167260b1cbcdb5 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 10 Jun 2025 22:56:52 +0200 Subject: [PATCH 5/5] ci: add todo for arm64 ation support --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90c7e715..47c6b933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,7 +142,7 @@ jobs: if: matrix.config.os == 'windows' && matrix.config.environment == 'msvc' uses: TheMrMilchmann/setup-msvc-dev@v3 with: - arch: ${{matrix.config.os-version == '11-arm' && 'x64' || 'x64'}} # note this action doesn't really support arm64 yet, but it works like this already (by accident) + arch: ${{matrix.config.os-version == '11-arm' && 'x64' || 'x64'}} # TODO:fix this action: note this action doesn't really support arm64 yet, but it works like this already (by accident) toolset: '14.43' - name: Setup MSYS2 (Windows) @@ -218,7 +218,7 @@ jobs: uses: egor-tensin/setup-gcc@v1 with: version: 14 - platform: ${{matrix.config.os-version == '24.04-arm' && 'x64' || 'x64'}} # note this action doesn't really support arm64 yet, but it works like this already (by accident) + platform: ${{matrix.config.os-version == '24.04-arm' && 'x64' || 'x64'}} # TODO:fix this action: note this action doesn't really support arm64 yet, but it works like this already (by accident) - name: Unbreak Python in GHA (MacOS 13 image) if: matrix.config.os == 'macos' && matrix.config.os-version == 13