From bfaa35998e2f0d6821ec70c64e76804ee2f07827 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Wed, 29 Oct 2025 00:48:52 +0000 Subject: [PATCH] feat: aarch64-mingw-ucrt support --- .github/workflows/ci.yml | 3 +++ Gemfile | 2 +- INSTALLATION.md | 1 + ext/sqlite3/extconf.rb | 8 ++++++++ rakelib/native.rake | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f545bfca..e9f8e093 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -256,6 +256,7 @@ jobs: platform: - aarch64-linux-gnu - aarch64-linux-musl + - aarch64-mingw-ucrt - arm-linux-gnu - arm-linux-musl - arm64-darwin @@ -342,6 +343,8 @@ jobs: platform: arm64-darwin - os: windows-latest platform: x64-mingw-ucrt + - os: windows-11-arm + platform: aarch64-mingw-ucrt runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 diff --git a/Gemfile b/Gemfile index a24431d5..523a778a 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ group :test do gem "ruby_memcheck", "3.0.1" if Gem::Platform.local.os == "linux" gem "rake-compiler", "1.3.0" - gem "rake-compiler-dock", "1.9.1" + gem "rake-compiler-dock", "1.10.0" end group :development do diff --git a/INSTALLATION.md b/INSTALLATION.md index e3dd5f3f..816296be 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -11,6 +11,7 @@ In v2.0.0 and later, native (precompiled) gems are available for recent Ruby ver - `aarch64-linux-gnu` (requires: glibc >= 2.29) - `aarch64-linux-musl` +- `aarch64-mingw-ucrt` - `arm-linux-gnu` (requires: glibc >= 2.29) - `arm-linux-musl` - `arm64-darwin` diff --git a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb index d6acea6f..0759d25f 100644 --- a/ext/sqlite3/extconf.rb +++ b/ext/sqlite3/extconf.rb @@ -155,6 +155,14 @@ def minimal_recipe recipe.target = File.join(package_root_dir, "ports") recipe.patch_files = Dir[File.join(package_root_dir, "patches", "*.patch")].sort end + + # Fix host triplet for Windows ARM64 cross-compilation + if cross_build? && RbConfig::CONFIG["target_os"].match?(/mingw/) + case RbConfig::CONFIG["arch"] + when /aarch64/ + recipe.host = "aarch64-w64-mingw32" + end + end end end diff --git a/rakelib/native.rake b/rakelib/native.rake index a42795f8..67e952d2 100644 --- a/rakelib/native.rake +++ b/rakelib/native.rake @@ -9,6 +9,7 @@ require "yaml" cross_platforms = [ "aarch64-linux-gnu", "aarch64-linux-musl", + "aarch64-mingw-ucrt", "arm-linux-gnu", "arm-linux-musl", "x86-linux-gnu",