Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d02c971
Stop bumping RUBY_PATCHLEVEL in release versions (#15502)
k0kubun Dec 11, 2025
1b7c8b7
[ruby/timeout] Skip signal test on windows
byroot Dec 11, 2025
832aac6
Tune AS_CASE indentation style and remove `[*]` for default case
XrXr Dec 11, 2025
c092c29
ZJIT: [DOC] Mention build prerequisites
XrXr Dec 11, 2025
eb889e4
ZJIT: s/checking possible to build ZJIT/checking prerequisites for ZJIT/
XrXr Dec 11, 2025
f8f8ff6
auto_request_review.yml: Update path for jit related docs
XrXr Dec 11, 2025
fb80587
[ruby/timeout] Add windows to CI matrix
byroot Dec 11, 2025
6406279
ZJIT: Check method visibility when optimizing sends (#15501)
tekknolagi Dec 11, 2025
dc58d58
[ruby/timeout] Fix failing timeout test
luke-gruber Dec 11, 2025
07b2356
Mutex: avoid repeated calls to `GET_EC`
byroot Dec 10, 2025
8210a11
test_ractor.rb: old object while calling _id2ref
byroot Dec 11, 2025
0564214
tool/merger.rb: Update the tag format for Ruby 4.0+
k0kubun Dec 11, 2025
a973526
tool/format-release: Fix the tag format for Ruby 4.0+
k0kubun Dec 11, 2025
04299ca
monitor.c: skip GET_EC() on exit
byroot Dec 11, 2025
aff0c6d
tool/merger.rb: Support the new format in remove_tag
k0kubun Dec 11, 2025
12bf3a9
update-www-meta.rb: Update the tag format for Ruby 4.0+
k0kubun Dec 12, 2025
58f9aca
make-snapshot: Drop X.Y.Z-pN support
k0kubun Dec 12, 2025
0ecf689
make-snapshot: Make preview/rc match stricter
k0kubun Dec 12, 2025
6601640
make-snapshot: Branch if it's X.Y.Z or X.Y using when
k0kubun Dec 12, 2025
06a6ad4
make-snapshot: Remove an unnecessary variable
k0kubun Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/auto_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ files:
'yjit*': [team:jit]
'yjit/**/*': [team:jit]
'yjit/src/cruby_bindings.inc.rs': []
'doc/yjit/*': [team:jit]
'bootstraptest/test_yjit*': [team:jit]
'test/ruby/test_yjit*': [team:jit]
'zjit*': [team:jit]
'zjit/**/*': [team:jit]
'zjit/src/cruby_bindings.inc.rs': []
'doc/zjit*': [team:jit]
'test/ruby/test_zjit*': [team:jit]
'defs/jit.mk': [team:jit]
'tool/zjit_bisect.rb': [team:jit]
'doc/jit/*': [team:jit]
# Skip github workflow files because the team don't necessarily need to review dependabot updates for GitHub Actions. It's noisy in notifications, and they're auto-merged anyway.
options:
ignore_draft: true
Expand Down
3 changes: 2 additions & 1 deletion bootstraptest/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,8 @@ class C
# Inserting into the id2ref table should be Ractor-safe
assert_equal 'ok', <<~'RUBY'
# Force all calls to Kernel#object_id to insert into the id2ref table
ObjectSpace._id2ref(Object.new.object_id)
obj = Object.new
ObjectSpace._id2ref(obj.object_id) rescue nil

10.times.map do
Ractor.new do
Expand Down
78 changes: 39 additions & 39 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3957,7 +3957,7 @@ AC_ARG_ENABLE(zjit,
[AS_CASE(["$JIT_TARGET_OK"],
[yes], [
rb_zjit_build_possible=no
AC_MSG_CHECKING([possible to build ZJIT])dnl only checked when --enable-zjit is not specified
AC_MSG_CHECKING([prerequisites for ZJIT])dnl only checked when --enable-zjit is not specified
# Fails in case rustc target doesn't match ruby target. Can happen on Rosetta, for example.
# 1.85.0 is the first stable version that supports the 2024 edition.
AS_IF([test "$RUSTC" != "no" && echo "#[cfg(target_arch = \"$JIT_TARGET_ARCH\")] fn main() {}" |
Expand Down Expand Up @@ -4051,44 +4051,44 @@ AS_CASE(["${ZJIT_SUPPORT}"],
JIT_RUST_FLAGS='--crate-type=staticlib --cfg feature=\"stats_allocator\"'
RLIB_DIR=
AS_CASE(["$JIT_CARGO_SUPPORT:$YJIT_SUPPORT:$ZJIT_SUPPORT"],
[no:yes:yes], [ # release build of YJIT+ZJIT
YJIT_LIBS=
ZJIT_LIBS=
JIT_RUST_FLAGS="--crate-type=rlib"
RLIB_DIR="target/release"
RUST_LIB="target/release/libruby.a"
],
[no:*], [],
[*], [ # JIT_CARGO_SUPPORT not "no" -- cargo required.
AC_CHECK_TOOL(CARGO, [cargo], [no])
AS_IF([test x"$CARGO" = "xno"],
AC_MSG_ERROR([this build configuration requires cargo. Installation instructions available at https://www.rust-lang.org/tools/install]))

YJIT_LIBS=
ZJIT_LIBS=

# There's more processing below to get the feature set for the
# top-level crate, so capture at this point for feature set of
# just the zjit crate.
ZJIT_TEST_FEATURES="${rb_cargo_features}"

AS_IF([test x"${YJIT_SUPPORT}" != x"no"], [
rb_cargo_features="$rb_cargo_features,yjit"
])
AS_IF([test x"${ZJIT_SUPPORT}" != x"no"], [
AC_SUBST(ZJIT_TEST_FEATURES)
rb_cargo_features="$rb_cargo_features,zjit"
])
# if YJIT and ZJIT release mode
AS_IF([test "${YJIT_SUPPORT}:${ZJIT_SUPPORT}" = "yes:yes"], [
JIT_CARGO_SUPPORT=release
])
CARGO_BUILD_ARGS="--profile ${JIT_CARGO_SUPPORT} --features ${rb_cargo_features}"
AS_IF([test "${JIT_CARGO_SUPPORT}" = "dev"], [
RUST_LIB="target/debug/libruby.a"
], [
RUST_LIB="target/${JIT_CARGO_SUPPORT}/libruby.a"
])
[no:yes:yes], [ # release build of YJIT+ZJIT
YJIT_LIBS=
ZJIT_LIBS=
JIT_RUST_FLAGS="--crate-type=rlib"
RLIB_DIR="target/release"
RUST_LIB="target/release/libruby.a"
],
[no:*], [],
[ # JIT_CARGO_SUPPORT not "no" -- cargo required.
AC_CHECK_TOOL(CARGO, [cargo], [no])
AS_IF([test x"$CARGO" = "xno"],
AC_MSG_ERROR([this build configuration requires cargo. Installation instructions available at https://www.rust-lang.org/tools/install]))

YJIT_LIBS=
ZJIT_LIBS=

# There's more processing below to get the feature set for the
# top-level crate, so capture at this point for feature set of
# just the zjit crate.
ZJIT_TEST_FEATURES="${rb_cargo_features}"

AS_IF([test x"${YJIT_SUPPORT}" != x"no"], [
rb_cargo_features="$rb_cargo_features,yjit"
])
AS_IF([test x"${ZJIT_SUPPORT}" != x"no"], [
AC_SUBST(ZJIT_TEST_FEATURES)
rb_cargo_features="$rb_cargo_features,zjit"
])
# if YJIT and ZJIT release mode
AS_IF([test "${YJIT_SUPPORT}:${ZJIT_SUPPORT}" = "yes:yes"], [
JIT_CARGO_SUPPORT=release
])
CARGO_BUILD_ARGS="--profile ${JIT_CARGO_SUPPORT} --features ${rb_cargo_features}"
AS_IF([test "${JIT_CARGO_SUPPORT}" = "dev"], [
RUST_LIB="target/debug/libruby.a"
], [
RUST_LIB="target/${JIT_CARGO_SUPPORT}/libruby.a"
])
])

# In case either we're linking rust code
Expand Down
4 changes: 4 additions & 0 deletions doc/jit/zjit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ You can change how much executable memory is allocated using [ZJIT's command-lin

## Build Instructions

Refer to [Building Ruby](rdoc-ref:contributing/building_ruby.md) for general build prerequists.
Additionally, ZJIT requires Rust 1.85.0 or later. Release builds need only `rustc`. Development
builds require `cargo` and may download dependencies.

### For normal use

To build ZJIT on macOS:
Expand Down
9 changes: 7 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,12 +1133,11 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int *pstate)
}

VALUE
rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2)
rb_ec_ensure(rb_execution_context_t *ec, VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2)
{
enum ruby_tag_type state;
volatile VALUE result = Qnil;
VALUE errinfo;
rb_execution_context_t * volatile ec = GET_EC();
EC_PUSH_TAG(ec);
if ((state = EC_EXEC_TAG()) == TAG_NONE) {
result = (*b_proc) (data1);
Expand All @@ -1155,6 +1154,12 @@ rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE dat
return result;
}

VALUE
rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2)
{
return rb_ec_ensure(GET_EC(), b_proc, data1, e_proc, data2);
}

static ID
frame_func_id(const rb_control_frame_t *cfp)
{
Expand Down
2 changes: 1 addition & 1 deletion ext/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ monitor_check_owner(VALUE monitor)
static void
monitor_exit0(struct monitor_args *args)
{
monitor_check_owner(args->monitor);
monitor_check_owner0(args);

if (args->mc->count <= 0) rb_bug("monitor_exit: count:%d", (int)args->mc->count);
args->mc->count--;
Expand Down
2 changes: 2 additions & 0 deletions internal/eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* header (related to this file, but not the same role).
*/
#include "ruby/ruby.h" /* for ID */
#include "vm_core.h" /* for ID */

#define id_signo ruby_static_id_signo
#define id_status ruby_static_id_status
Expand All @@ -30,6 +31,7 @@ VALUE rb_exception_setup(int argc, VALUE *argv);
void rb_refinement_setup(struct rb_refinements_data *data, VALUE module, VALUE klass);
void rb_vm_using_module(VALUE module);
VALUE rb_top_main_class(const char *method);
VALUE rb_ec_ensure(rb_execution_context_t *ec, VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);

/* eval_error.c */
VALUE rb_get_backtrace(VALUE info);
Expand Down
6 changes: 6 additions & 0 deletions test/ruby/test_rubyoptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1319,4 +1319,10 @@ def test_free_at_exit_env_var
def test_toplevel_ruby
assert_instance_of Module, ::Ruby
end

def test_ruby_patchlevel
# We stopped bumping RUBY_PATCHLEVEL at Ruby 4.0.0.
# Released versions have RUBY_PATCHLEVEL 0, and un-released versions have -1.
assert_include [-1, 0], RUBY_PATCHLEVEL
end
end
12 changes: 8 additions & 4 deletions test/test_timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ class TestTimeout < Test::Unit::TestCase

private def kill_timeout_thread
thread = Timeout.const_get(:State).instance.instance_variable_get(:@timeout_thread)
thread.kill
thread.join
if thread
thread.kill
thread.join
end
end

def test_public_methods
Expand Down Expand Up @@ -425,7 +427,9 @@ def test_timeout_in_trap_handler

rd, wr = IO.pipe

trap("SIGUSR1") do
signal = Signal.list["USR1"] ? :USR1 : :TERM

trap(signal) do
begin
Timeout.timeout(0.1) do
sleep 1
Expand All @@ -440,7 +444,7 @@ def test_timeout_in_trap_handler
end
end

Process.kill :USR1, Process.pid
Process.kill signal, Process.pid

assert_equal "OK", rd.read
rd.close
Expand Down
Loading