Skip to content

Commit b0a7b13

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

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

configs/components/ruby-4.0.rb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,38 @@
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+
'debian-12-aarch64',
179+
'debian-12-amd64',
180+
'debian-13-armhf',
181+
'macos-all-arm64',
182+
'macos-all-x86_64',
183+
'sles-15-x86_64',
184+
'sles-16-aarch64',
185+
'sles-16-x86_64',
186+
'windows-all-x64',
187+
]
188+
if platforms_without_rust.include? platform.name
189+
configure_flags = ''
190+
else
191+
pkg.build_requires 'rustc'
192+
configure_flags = '--enable-yjit --enable-zjit'
193+
end
171194
pkg.configure do
172195
[
173196
"bash configure \
174197
--enable-shared \
175198
--disable-install-doc \
176199
--disable-install-rdoc \
177200
#{settings[:host]} \
178-
#{special_flags}"
201+
#{special_flags} \
202+
#{configure_flags}"
179203
]
180204
end
181205

0 commit comments

Comments
 (0)