Skip to content

Point mkmf at the vcpkg packages on mswin - #977

Merged
hsbt merged 2 commits into
masterfrom
claude/mswin-vcpkg-include-aee3df
Nov 18, 2026
Merged

hsbt merged 2 commits into
masterfrom
claude/mswin-vcpkg-include-aee3df

Conversation

@hsbt

@hsbt hsbt commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Since #971, ruby-version: mswin installs the master build from cache.ruby-lang.org, and native extensions that need vcpkg libraries fail in extconf.rb. openssl cannot find openssl/ssl.h, and fiddle and psych cannot find ffi.h and yaml.h.

ruby-loco configured Ruby with --with-opt-dir set to the runner's vcpkg directory, so mkmf found them through configure_args. The new build keeps build-machine paths out of configure_args and has an empty PKG_CONFIG, so mkmf also falls back to the MSYS2 pkg-config on PATH, which returns MinGW flags.

This prepends the vcpkg include and lib directories to INCLUDE and LIB, and points PKG_CONFIG and PKG_CONFIG_PATH at the pkgconf and .pc files shipped in the vcpkg packages.

Fixes #976

Generated with Claude Code

@ntkme ntkme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread windows.js Resolved
Comment thread windows.js Resolved
hsbt and others added 2 commits November 18, 2026 08:47
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. Their RbConfig also has an empty PKG_CONFIG, 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 the vcpkg pkgconf, but its path missed a variable and pointed nowhere.

#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>
@hsbt
hsbt force-pushed the claude/mswin-vcpkg-include-aee3df branch from 47c121c to 30b77fb Compare November 17, 2026 23:47
@hsbt
hsbt merged commit 341b6d4 into master Nov 18, 2026
474 checks passed
@hsbt
hsbt deleted the claude/mswin-vcpkg-include-aee3df branch November 18, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants