Skip to content
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

Add arm64 architecture #399

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add arm64 architecture #399

wants to merge 3 commits into from

Conversation

larskanis
Copy link
Member

@larskanis larskanis commented Dec 15, 2024

This add rake tasks for building RubyInstaller-head for arm64. They use the ruby-head version provided by oneclick/rubyinstaller2-packages#21

In general the installed Ruby+Devkit is already quite usable, but there are currently several issues with the build:

  • The side-by-side DLL loading doesn't work. CLANG doesn't include a XML manifest like GCC, so that moving the DLLs to ruby_builtin_dlls doesn't work. This also affects bin/etc directory with OpenSSL certificates. Workaround is to copy DLLs and etc one level up.
  • Switching fibers crashs sometimes. This is for instance in ruby core make btest here. Currently one and the same coroutine switcher arm64 is used on Linux and Windows and although ABI is very similar, it probably needs to be adjusted for Windows like on x86/x64. Fixed by Fix coroutine implementaion on Windows-Arm64 ruby/ruby#12363
  • gem "tzinfo-data", platforms: %i[ windows jruby ] doesn't install the gem, since Ruby on Windows-Arm64 isn't recognized as windows platform.
  • sqlite3 gem doesn't install. It fails to configure builtin sqlite3 library. Workaround is gem install sqlite3 -- --enable-system-libraries.
  • nokogiri gem doesn't install. It fails to configure builtin libxml2 library. Workaround is gem install sqlite3 -- --use-system-libraries.
  • The RubyInstaller-Devkit setup file is with 230 MByte twice as fat. Maybe because of LLVM. Needs to be investigated.

Rails already works:

grafik

Closes #362

…on.so file

So far ruby.exe and rubyw.exe contained a process-global manifest for side-by-side loading.
This way the DLLs bundled to RubyInstaller could be moved to a dedicated directory, so that they aren't loaded accidently by other apps because they are in the PATH.

It was introduced in b2bd630
The downside of a global manifest is that the dependent DLLs are always preferred over other DLL versions with the same name.
This caused for instance openssl.gem to fail, when the libssl DLL linked at build time was newer than the libssl bundled with RubyInstaller.

This patch introduces manifests per extension.so file with dedicated private dependencies.
This way the bundled openssl.so is directly linked to it's own libssl.dll by an embedded manifest.
It's similar to static linking libssl into openssl.so, but it allows to use unchanged libssl.dll from MINGW packages.

If a new openssl.gem version is installed per "gem install openssl", it links to MSYS2/MINGW packages at build time.
Since the resulting openssl.so doesn't contain the manifest, it also links to the MINGW packages at run time.

Patching extension.so files requires to add all single files recursively as file tasks.

Fixes #60
@johnnyshields
Copy link

johnnyshields commented Jan 2, 2025

@larskanis thanks for your great work on this!!

I've raised the PR for Rubygems/Bundler here: https://github.com/rubygems/rubygems/pull/8378/files to support ruby_arch = aarch64-mingw-ucrt (and mingw generically)

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

Successfully merging this pull request may close these issues.

Add installer for windows-arm64
2 participants