Skip to content

Support windows-11-arm #750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support windows-11-arm #750

wants to merge 1 commit into from

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Apr 18, 2025

@ntkme
Copy link
Contributor Author

ntkme commented Apr 18, 2025

Please note that this PR is still working in progress. It's currently at a point that installing ruby and jruby would work, but installing native extensions will fail because additional msys2 related updates are needed.

@ntkme
Copy link
Contributor Author

ntkme commented Apr 18, 2025

The RubyInstaller-Devkit package consists of the LLVM based C and C++ compilers which run natively on ARM. This makes the package almost twice as big than the x64/x86 versions. In contrast the MSYS2 toolset, which provides Unix tools like make and bash, is not yet ported to ARM. It is delivered as x64 code, running on the Prism emulator of Windows-11. That’s why only the RubyInstaller version without Devkit will work on Windows-10.

setup-ruby does not use devkit from rubyinstaller so we will have to replicate a similar setup with https://github.com/ruby/setup-msys2-gcc.

@MSP-Greg @larskanis I can start working on a PR for that, but I'd like to hear your thoughts.

@ntkme ntkme force-pushed the windows-11-arm branch 2 times, most recently from 665568a to b3570f7 Compare April 18, 2025 18:36
@larskanis
Copy link
Contributor

Thanks to notify me about the new Windows on ARM64 runners!

setup-ruby does not use devkit from rubyinstaller so we will have to replicate a similar setup with https://github.com/ruby/setup-msys2-gcc.

This shouldn't be too difficult. Since the same MSYS2 x64 executables are used on arm64 as on x64, the msys2.7z file should be reusable. Only the clangarm64 environment needs to be packaged into a 7z file equal to the mingw64 and ucrt64 environments. I think packaging these clangarm64 files should even work on a x64 host. See https://www.msys2.org/wiki/arm64/

There is no need to select distinct packages regarding gcc on x64 and clang on arm64. The gcc packages are wrappers for the corresponding clang packages on arm64, so that the same package list can be installed per pacman. Only the different prefix mingw-w64-clang-aarch64 vs. mingw-w64-ucrt-x86_64 has to be respected. That's why the rubyinstaller package list didn't change with the introduction of WoA.

@ntkme
Copy link
Contributor Author

ntkme commented Apr 18, 2025

I think packaging these clangarm64 files should even work on a x64 host.

Not that easy. The way setup-msys2-gcc works today is that it uses the C:/msys64 preinstalled on the x64 windows runner, and only pack the "difference" to create a minimal package for these runner. However, the windows-11-arm runner does not have C:/msys64 preinstalled, so an "incremental" package simply won't work because all the base files are missing. We will have to provide two different packages, the existing "incremental" package for x64 and a new "complete" package for arm64. Currently testing that in my own fork.

@ntkme ntkme changed the title [DRAFT] Support windows-11-arm Support windows-11-arm Apr 19, 2025
@ntkme ntkme marked this pull request as ready for review April 19, 2025 06:24
@ntkme
Copy link
Contributor Author

ntkme commented Apr 21, 2025

This PR is ready for review. The tests are failing because other linked PRs are required. Also there is a chicken-and-egg problem with this PR and ruby/setup-msys2-gcc#21, which has a few ways to get worked around.

The ways I get it solved in my own forks is that:

  1. Use setup-ruby and setup-msys2-gcc changes as is to first generate the msys2 package for windows-11-arm. At this stage the clangarm64 gcc package will fail.
  2. Use the setup-ruby change, but slightly modify it to skip the gcc setup only on windows-11-arm. - This allows us to build clangarm64 gcc package.
  3. Now we have a working state.

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

Successfully merging this pull request may close these issues.

2 participants