Skip to content

Commit 38fa27f

Browse files
committed
Ruby 4: Enable YJIT/ZJIT
1 parent 877ffce commit 38fa27f

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

configs/components/ruby-4.0.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,32 @@
168168
pkg.configure { ['bash autogen.sh'] }
169169
end
170170

171+
# we want to provide the different just in time compilers where possible
172+
# they require a modern rust version
173+
# https://docs.ruby-lang.org/en/master/jit/zjit_md.html zjit: Rust 1.85.0
174+
# https://docs.ruby-lang.org/en/master/jit/yjit_md.html yjit: Rust 1.58.0
175+
platforms_without_rust = [
176+
'debian-11-aarch64',
177+
'debian-11-amd64',
178+
'macos-all-arm64',
179+
'macos-all-x86_64',
180+
'windows-all-x64',
181+
]
182+
if platforms_without_rust.include? platform.name
183+
configure_flags = ''
184+
else
185+
pkg.build_requires 'rustc'
186+
configure_flags = '--enable-yjit --enable-zjit'
187+
end
171188
pkg.configure do
172189
[
173190
"bash configure \
174191
--enable-shared \
175192
--disable-install-doc \
176193
--disable-install-rdoc \
177194
#{settings[:host]} \
178-
#{special_flags}"
195+
#{special_flags} \
196+
#{configure_flags}"
179197
]
180198
end
181199

0 commit comments

Comments
 (0)