Repository navigation
Conversation
The mswin builds from cache.ruby-lang.org keep the build machine's paths out of configure_args, so extconf.rb no longer finds the vcpkg headers and libraries that ruby-loco located through --with-opt-dir. #976 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
json builds without any external library, so it did not catch mkmf losing track of vcpkg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mswin builds have an empty PKG_CONFIG in RbConfig, so mkmf ran the MSYS2 pkg-config on PATH, which pointed fiddle at the MinGW libffi headers and broke the MSVC build. ruby-loco meant to set PKG_CONFIG to this pkgconf, but its path missed a variable and pointed nowhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ntkme
approved these changes
Nov 17, 2026
ntkme
left a comment
Collaborator
There was a problem hiding this comment.
I think this is good enough for now.
The follow up question for later is that whether we should have a mechanism for mswin ruby to automatically detect $VCPKG_ROOT and enhance its search paths.
ntkme
reviewed
Nov 17, 2026
| // Without this mkmf runs the MSYS2 pkg-config on PATH, whose MinGW flags break MSVC builds | ||
| exportEnv({ | ||
| PKG_CONFIG: `${vcpkgDir}\\tools\\pkgconf\\pkgconf.exe`, | ||
| PKG_CONFIG_PATH: `${vcpkgDir}\\lib\\pkgconfig` |
Collaborator
There was a problem hiding this comment.
I tested and found that only INCLUDE, LIB, and PKG_CONFIG are required. It seems to work without setting PKG_CONFIG_PATH.
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.
Since #971,
ruby-version: mswininstalls the master build from cache.ruby-lang.org, and native extensions that need vcpkg libraries fail inextconf.rb. openssl cannot findopenssl/ssl.h, and fiddle and psych cannot findffi.handyaml.h.ruby-loco configured Ruby with
--with-opt-dirset to the runner's vcpkg directory, so mkmf found them throughconfigure_args. The new build keeps build-machine paths out ofconfigure_argsand has an emptyPKG_CONFIG, so mkmf also falls back to the MSYS2pkg-configonPATH, which returns MinGW flags.This prepends the vcpkg
includeandlibdirectories toINCLUDEandLIB, and pointsPKG_CONFIGandPKG_CONFIG_PATHat the pkgconf and.pcfiles shipped in the vcpkg packages.Fixes #976
Generated with Claude Code