Add libffi build support for Windows C loader - #844
Open
shaheeramjad wants to merge 15 commits into
Open
Conversation
shaheeramjad
force-pushed
the
feature/c-loader-windows-libffi
branch
from
July 15, 2026 05:32
3d0e5b2 to
f35b24d
Compare
…oid MinGW header conflicts with MSVC
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.
Description
This PR adds libffi build support for the Windows C loader by implementing a
Set-Cfunction intools/metacall-environment.ps1.The C loader requires libffi as a dependency on Windows. Previously, PR #458 attempted to build libffi using an unofficial third-party fork (
newlawrence/Libffi) with hardcoded local paths, which was fragile and not suitable for CI. This PR replaces that approach by building libffi from the official upstream source using themsvcc.shwrapper script the same method documented in libffi's own README and used internally by vcpkg without introducing vcpkg or any additional tool dependency.Git Bash (
C:\Program Files\Git\bin\bash.exe) is already available on all Windows GitHub Actions runners, so no extra setup is required.Fixes #458
Type of change
Checklist:
OPTION_BUILD_ADDRESS_SANITIZER.OPTION_BUILD_THREAD_SANITIZER.Helgrind.make clang-format.