Forward-port win32/resolv fixes from ruby/ruby#19030 - #149
Merged
Merged
Conversation
GCC 15 in C23 mode reads `ANYARGS` as `(void)`, so the bare function pointers are rejected against Ruby headers that do not add the cast themselves, as happened with Ruby 3.1 on Windows. #92 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Win32::Resolve` is never defined, so these tests were not run anywhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JRuby on Windows loads its bundled `win32/resolv`, which has no `tcpip_params`, so two of these tests raised NoMethodError there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This brings over the two commits of ruby/ruby#19030.
The first casts the five method registrations in
InitVM_resolvwithRUBY_METHOD_FUNC. GCC 15 in C23 mode rejects the bare function pointers against the Ruby 3.1 headers, which do not cast them themselves, as reported in #92. The Windows 3.1 job currently uses GCC 14, so CI does not show that error.The second fixes the
defined?(Win32::Resolve)typo intest/resolv/test_win32_config.rb, which keptTestWin32Configfrom running anywhere. I built the extension without warnings and ran the full suite with mswin Ruby 4.1.0dev and 3.3.12, and the three tests now run and pass.Once the tests ran, two of them raised
NoMethodErroron JRuby on Windows, which loads its bundledwin32/resolvwithouttcpip_params. The JRuby step iscontinue-on-error, so the jobs still showed success. A third commit runs the tests only when the extension is loaded.Generated with Claude Code