Skip to content

Commit 67c85a1

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

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

configs/components/ruby-4.0.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,35 @@
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+
'sles-15-x86_64',
181+
'sles-16-aarch64',
182+
'sles-16-x86_64',
183+
'windows-all-x64',
184+
]
185+
if platforms_without_rust.include? platform.name
186+
configure_flags = ''
187+
else
188+
pkg.build_requires 'rustc'
189+
configure_flags = '--enable-yjit --enable-zjit'
190+
end
171191
pkg.configure do
172192
[
173193
"bash configure \
174194
--enable-shared \
175195
--disable-install-doc \
176196
--disable-install-rdoc \
177197
#{settings[:host]} \
178-
#{special_flags}"
198+
#{special_flags} \
199+
#{configure_flags}"
179200
]
180201
end
181202

0 commit comments

Comments
 (0)