Skip to content

Conversation

@larskanis
Copy link
Member

What problem is this PR intended to solve?

I would like to add a precompiled binary gem for Windows on ARM64 platform.

This PR requires the latest rake-compiler-dock from main branch, since current version 1.9.1 doesn't provide aarch64-mingw-ucrt target platform.

Have you included adequate test coverage?

Yes, a dedicated CI ob.

Does this change affect the behavior of either the C or the Java implementations?

Only C.

@larskanis larskanis force-pushed the aarch64-mingw-ucrt branch 2 times, most recently from ec6e590 to 992c64a Compare July 29, 2025 06:43
@larskanis
Copy link
Member Author

Commit 2b4d25c also fixes native build on Windows on ARM64.

Fixes #3469
Fixes #3470

@flavorjones
Copy link
Member

I've rebased this onto current main.

@YOU54F
Copy link

YOU54F commented Oct 29, 2025

👋🏾

I've been testing this out, as I have been trying to get the pact_broker working on windows 11 arm, and I can confirm I can build this with the latest rake-compiler-dock

https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.10.0

I've prebuilt the gems, and installing them manually, and then running bundle leaves me with a green ci run ( the rack app, uses sqlite and nokogiri native exts)

https://github.com/YOU54F/pact-broker-in-a-box/blob/01e1b94df385c61e9773e14e9ceb93738dc64c05/action.yml#L44-L73

If I try and install from this branch directly in windows 11 arm, I get the same error we see in CI

https://github.com/YOU54F/nokogiri/actions/runs/18859786182/job/53815924597

Using mini_portile version 2.8.9
---------- IMPORTANT NOTICE ----------
Building Nokogiri with a packaged version of libgumbo-1.0.0-nokogiri.
Configuration options: --enable-shared --disable-static
Copying gumbo-parser files into tmp/aarch64-w64-mingw32/ports/libgumbo/1.0.0-nokogiri/gumbo-parser...
Running 'compile' for libgumbo 1.0.0-nokogiri... OK
checking for whether -IC:/hostedtoolcache/windows/Ruby/3.4.7/arm64/lib/ruby/gems/3.4.0/gems/nokogiri-1.20.test.2025.1028.0017/ext/nokogiri/ports/aarch64-mingw-ucrt/libgumbo/1.0.0-nokogiri/include is accepted as CPPFLAGS... no
checking for gumbo_parse_with_options() in nokogiri_gumbo.h... no
-----
extconf.rb:309:in 'Object#ensure_func'
extconf.rb:1117:in '<main>'
gumbo_parse_with_options is missing. Please locate mkmf.log to investigate how it is failing

Looking forward to a precompiled gem :) thanks for your work @larskanis

@larskanis
Copy link
Member Author

The failing extconf tests

checking for whether -IC:/hostedtoolcache/windows/Ruby/3.4.7/arm64/lib/ruby/gems/3.4.0/gems/nokogiri-1.20.test.2025.1028.0017/ext/nokogiri/ports/aarch64-mingw-ucrt/libgumbo/1.0.0-nokogiri/include is accepted as CPPFLAGS... no
checking for gumbo_parse_with_options() in nokogiri_gumbo.h... no

are due to the use of clang-21 in RubyInstaller-3.4.7 for ARM64. It raises a warning there, which lets the check fail:

 C:/hostedtoolcache/windows/Ruby/3.4.7/arm64/include/ruby-3.4.0/ruby/internal/core/rstring.h:398:24: warning: default initialization of an object of type 'struct RString' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe]

It is already fixed for ruby-3.4.8 per ruby/ruby@18e1766 , scheduled for Dec-2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants