oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
645 stars 248 forks source link

Enable yjit support #327

Closed dsisnero closed 1 year ago

dsisnero commented 1 year ago

What problems are you experiencing?

Trying to test yjit but it is not built with yjit support

Steps to reproduce

f:\programming\source\repos\git\edr_db>ruby --yjit -v ruby: warning: Ruby was built without YJIT support. You may need to install rustc to build Ruby with YJIT. ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]

What's the output from ridk version?

f:\programming\source\repos\git\edr_db>ridk version

ruby: path: f:/windows/tools/ruby/Ruby3.2 version: 3.2.0 platform: x64-mingw-ucrt ruby_installer: package_version: 3.2.0-1 git_commit: 5507d7c msys2: path: c:\msys64 cc: gcc (Rev7, Built by MSYS2 project) 12.2.0 sh: GNU bash, version 5.2.9(1)-release (x86_64-pc-msys) os: Microsoft Windows [Version 10.0.19044.2251]

Largo commented 1 year ago

Hello! At the moment it seems like that Windows is not supported yet by the people who made the yjit. So, I'd assume it would not work even if you compile with it? They did however recently rewrite it in rust, which could mean better portability. Has anybody tried it yet?

OT: Happy New Year to everyone on the team and thank you so much for all the work you do! RubyInstaller is a fantastic project and really important for the community. I'd donate, but I cannot find any donation link. I live in Japan and if there's anything I could do, to help this project, for instance try to get funding from the Ruby Association, let me know!

larskanis commented 1 year ago

YJIT is not supported on Windows. I actually did some contributions to ruby-2.6 to get MJIT working on Windows, but it turned out that it hasn't any practical use. See here: https://github.com/oneclick/rubyinstaller2/wiki/FAQ#q-how-can-i-use-the-ruby-jit

Porting YJIT is more difficult. Windows has a very different ABI. In particular different call conventions, very different exception handling (called SEH) and different memory management. In MJIT the compiler knows about these differences, but in YJIT they have to be implemented in ruby, making it more difficult.

On the other hand there is much more potential for performance improvements in other parts of ruby in particular in file IO. So I'll not invest any time in getting YJIT to work on Windows in the near future.

@Largo Thank you for the kind words!

dsisnero commented 1 year ago

I know it is not your issue, but I feel more effort needs to be put in making windows a first class ruby os. I will add a bug report to ruby.

tamusjroyce commented 7 months ago

I assume https://www.ruby-lang.org/en/news/2023/11/12/ruby-3-3-0-preview3-released/ with RJIT will fit this need. Since it uses Ruby instead of YJIT Rust or MJIT C? once a windows installer exists?