Repository navigation
Conversation
mini_portile takes the --host triple from `$CC -v`. llvm-mingw (the
aarch64-mingw-ucrt cross toolchain, and the clang toolchain RubyInstaller
uses on Windows ARM64) reports aarch64-w64-windows-gnu, which sqlite's
config.sub rejects ("Kernel 'windows' not known to work with OS 'gnu'").
Rewrite *-w64-windows-gnu to the equivalent *-w64-mingw32. GCC mingw
toolchains already report *-mingw32, so other platforms are unchanged.
This is a stopgap until a mini_portile2 release normalizes the triple in
detect_host; no released version does yet.
ci: compile from source (packaged sqlite) on windows-11-arm with Ruby
3.4 and 4.0, in both the test and source-gem install jobs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rake-compiler-dock 1.12.0 provides an aarch64-mingw-ucrt image with Ruby 3.4 and 4.0. Add it to the cross platforms and the build matrix. rake-compiler skips 3.2/3.3 for that platform and sets the gem's required_ruby_version to >= 3.4. - bin/test-gem-file-contents: per-platform supported ruby versions, and assert the gem does not claim rubies it has no binary for - ci: install-test the gem on windows-11-arm with Ruby 3.4 and 4.0 - docs: INSTALLATION platform list and CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ship a precompiled
sqlite3gem for Windows on ARM64 (aarch64-mingw-ucrt). Today Windows ARM64 users get the source gem and must compile SQLite.The pinned rake-compiler-dock (1.12.0) already provides an
aarch64-mingw-ucrtimage. It is the same approach Nokogiri used for itsaarch64-mingw-ucrtgem in sparklemotion/nokogiri#3530.Prior work: #650 and flavorjones/mini_portile#167
This continues #650 by YOU54F, which proposed the same platform with a
recipe.hostoverride inextconf.rb. On that PR flavorjones asked whether an upstream fix was pending, and whether it was in a release that could be pinned instead. YOU54F then opened flavorjones/mini_portile#167, which normalizes*-windows-gnutriples insidedetect_host. They closed #650 and planned a platform-only PR once a mini_portile release shipped the fix.The answer to the pin question: no released mini_portile2 has the fix. flavorjones/mini_portile#167 is still open, and the latest release is 2.8.9 (May 2025). So this PR brings back a narrow override as a stopgap:
*-w64-windows-gnuto*-w64-mingw32. Every other triple passes through unchanged.$CC -vwill already yield*-mingw32and the line becomes a no-op. The code comment says to remove it then and require that mini_portile2 version.recipe.hostafterMiniPortile.newmakes mini_portile treat the build as cross-compiling (host != original_host). As a resultactivateprepends-L<lib>toENV["LDFLAGS"], which normalizing indetect_hostwould not do. In sqlite3 this has no effect today:activateis the last mini_portile step, and mkmf never readsENV["LDFLAGS"]afterwards. It is one more reason to treat the override as temporary.Whether to take the stopgap now or wait for a mini_portile release is the maintainers' call. Credit to YOU54F for the original work, in the CHANGELOG too.
Changes
Commit 1,
fix(extconf):ext/sqlite3/extconf.rb: mini_portile takes--hostfrom$CC -v. llvm-mingw (the RCD aarch64-mingw-ucrt toolchain, and the clang toolchain RubyInstaller uses on Windows ARM64) reportsaarch64-w64-windows-gnu, and sqlite'sconfig.subrejects it with "Kernel 'windows' not known to work with OS 'gnu'". The fix rewrites*-w64-windows-gnuto*-w64-mingw32. Using RbConfig'shostinstead broke x64-mingw-ucrt, which reportsx64-w64-mingw32, so the rewrite is deliberately limited to the llvm-mingw triple..github/workflows/ci.yml: thetestjob and the source-gem install job ("test source") now also compile from source onwindows-11-arm, with the packaged sqlite, on Ruby 3.4 and 4.0. Both jobs usedruns-on: ${{ matrix.os }}-latest, so they now take an optionalmatrix.runnerand fall back to that.CHANGELOG.md: a Fixed entry for the source build.Commit 2,
feat:rakelib/native.rake: addaarch64-mingw-ucrttocross_platforms. The RCD image only has Ruby 3.4 and 4.0, because there is no RubyInstaller for Windows ARM64 before 3.4. rake-compiler warns, skips 3.2 and 3.3 for this platform, and derivesrequired_ruby_version(>= 3.4, < 4.1.dev) from the versions it built..github/workflows/build-gems.yml: add the platform to the native build matrix. The release workflow uses this file, so the release flow picks it up as well.bin/test-gem-file-contents: per-platform supported Ruby versions. It also asserts the gem does not claim a Ruby it has no binary for..github/workflows/ci.yml: newtest_aarch64_mingw_ucrtjob onwindows-11-arm, which installs the native gem and runs the suite on Ruby 3.4 and 4.0. It is separate fromtest_the_restso it doesn't cross with 3.2 and 3.3.INSTALLATION.md,CHANGELOG.md: list the platform.Commit 3,
doc: add the PR references to the CHANGELOG entries.The extconf fix comes first, so every commit builds.
Verification
Full CI on this branch passed (on
9d18781, before the CHANGELOG-only commit), 141/141 jobs. That includes:build native (aarch64-mingw-ucrt), which runsbin/test-gem-file-contentsand the per-platform Ruby version checks;windows-11-armwith Ruby 3.4 and 4.0;windows-11-armwith Ruby 3.4 and 4.0, in bothtestandtest source, which confirm the extconf fix for RubyInstaller's clang toolchain;x64-mingw-ucrtand every other existing platform, all still passing.The host-triple fix, tested with and without it on the real toolchain. MahtraDR ran a separate probe on
windows-11-arm(run 43757252259). It used this PR's9d18781plus a single commit that adds only the probe workflow, and built from source on Ruby 3.4.12 and 4.0.9, each with theextconf.rbrewrite line kept and with it removed:CCis clang 23.1.5 from msys2/MINGW-packages.clang -vprintsTarget: aarch64-w64-windows-gnu, and mini_portile2 2.8.9 detectsaarch64-w64-windows-gnuas the host.--host=aarch64-w64-windows-gnuand fails withInvalid configuration 'aarch64-w64-windows-gnu': Kernel 'windows' not known to work with OS 'gnu'.--host=aarch64-w64-mingw32, the compile succeeds, and the extension loads with the packaged SQLite 3.54.1.ext/is the same at the current head (the later commit only changesCHANGELOG.md), so this still applies.Nothing was built locally (no Docker). The Linux compile and test suite were run locally after the extconf change.
Note: the ARM64 DLLs keep about 190 KB of debug sections each, because rake-compiler-dock leaves out
-sforaarch64-mingw(x64 gets it). That is RCD's choice, not something this PR controls.🤖 Generated with Claude Code