summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2022-04-11 13:28:07 -0400
committerGitHub <noreply@github.com>2022-04-11 13:28:07 -0400
commit5f1f8c244da69a69ff62475be4c022f2c7e850d4 (patch)
treefefaecb1b4c3edd97439d8d96983c04d11e5855e
parent492349ab5c6ca7af1d8e9d26647139f476aae2d1 (diff)
Fix fake.rb RUBY_DESCRIPTION faking for JITs
Previously, `make test-spec` was not printing the description with +YJIT even when YJIT was indeed enabled. It was confusing on CI. `fake.rb` was changing the `RUBY_DESCRIPTION` constant incorrectly. I suppose `make test-spec` mostly needs the `mkmf` faking and not the faking of `RUBY_.*` constants, so maybe there is an opportunity to simplify in the future.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5782 Merged-By: XrXr
-rw-r--r--template/fake.rb.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/template/fake.rb.in b/template/fake.rb.in
index 7af17fa344..aead377ed8 100644
--- a/template/fake.rb.in
+++ b/template/fake.rb.in
@@ -18,6 +18,7 @@ if inc = arg['i']
version[n] = src.value(v)
end
arg['RUBY_DESCRIPTION_WITH_MJIT'] = src.value('description_with_mjit')
+ arg['RUBY_DESCRIPTION_WITH_YJIT'] = src.value('description_with_yjit')
end
%>baseruby="<%=arg['BASERUBY']%>"
_\
@@ -34,9 +35,14 @@ class Object
CROSS_COMPILING = RUBY_PLATFORM
constants.grep(/^RUBY_/) {|n| remove_const n}
% arg['versions'].each {|n, v|
- <%=n%> = <%if n=='RUBY_DESCRIPTION' %>RubyVM.const_defined?(:JIT) && RubyVM::MJIT.enabled? ?
- <%=arg['RUBY_DESCRIPTION_WITH_JIT'].inspect%> :
- <%end%><%=v.inspect%>
+ <%=n%> = <%if n=='RUBY_DESCRIPTION' %>case
+ when RubyVM.const_defined?(:MJIT) && RubyVM::MJIT.enabled?
+ <%=arg['RUBY_DESCRIPTION_WITH_MJIT'].inspect%>
+ when RubyVM.const_defined?(:YJIT) && RubyVM::YJIT.enabled?
+ <%=arg['RUBY_DESCRIPTION_WITH_YJIT'].inspect%>
+ else
+ <%=v.inspect%>
+ end<%else%><%=v.inspect%><%end%>
% }
end
builddir = File.dirname(File.expand_path(__FILE__))