Skip to content

[pull] master from ruby:master#907

Merged
pull[bot] merged 13 commits intoturkdevops:masterfrom
ruby:master
Apr 3, 2026
Merged

[pull] master from ruby:master#907
pull[bot] merged 13 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Apr 3, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

k0kubun and others added 13 commits April 2, 2026 13:34
`yes-update-default-gemspecs` uses `$(XRUBY)` which execs the ruby
binary, but only depended on `main` (extensions and encodings).
When `make runirb` runs with parallel jobs, the linker may still be
writing the ruby binary while `update-default-gemspecs` tries to
exec it, causing `Errno::EACCES` (Permission denied).

Add `$(PROGRAM)` as a dependency so the binary is fully linked
before attempting to execute it.

This is to prevent CI from randomly failing on the runirb step, e.g.
https://github.com/ruby/ruby/actions/runs/23921136182/job/69767485157?pr=16648
The server thread writes the HTTP response while the client has a
0.1s read_timeout. On slow CI (especially Windows), the client can
time out and close the socket before the server finishes writing
headers or the response body, causing Errno::EPIPE in the server
thread. Since the broken pipe is expected when the client times out,
rescue it along with ECONNRESET and ECONNABORTED.

This attempts to mitigate random CI failures like:
https://github.com/ruby/ruby/actions/runs/23921136139/job/69767484567?pr=16648

    1) Error:
  TestOpenURI#test_read_timeout:
  Test::Unit::ProxyError: Broken pipe
      D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'IO#write'
      D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'IO#print'
      D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'block (2 levels) in TestOpenURI#test_read_timeout'
warn_unused_block uses the caller's PC to build a dedup key for the
unused block warning table. When called from ZJIT-compiled code via
rb_vm_send, cfp->pc may be stale (poisoned or uninitialized) because
ZJIT stores the real PC in cfp->jit_return instead.

Use CFP_PC() which reads from jit_return when available, falling back
to cfp->pc for interpreter frames. This prevents the dedup key from
being based on a garbage PC value that could randomly collide with
prior entries, suppressing warnings that should be emitted.
The default limit of 2.0 is too tight for RSS measurements on macOS,
causing random CI failures when the ratio lands just above 2.0 (e.g.
2.05). Increase to 2.2 to account for normal RSS measurement noise.

https://github.com/ruby/ruby/actions/runs/23923072484/job/69773771596

    1) Failure:
  TestStruct::TopStruct#test_named_structs_are_not_rooted [/Users/runner/work/ruby/ruby/src/test/ruby/test_struct.rb:541]:
  rss: 8781824 => 18006016.
  Expected 2.050373134328358 to be < 2.0.

  ruby -v: ruby 4.1.0dev (2026-04-02T21:34:07Z master e957b3a) +PRISM [arm64-darwin23]
…16650)

Reduce the number of spawned processes from 50 to 20 and increase the
timeout from 30s to 60s. Process creation is expensive on Windows, and
the combination caused the test to exceed the 30s limit on Windows CI.
The transmute triggered a miscompilation on Rust 1.85.0, where the
callback was "optimized" to unconditional go to a `SIGTRAP`ping
instruction.

While later Rust versions don't have the same miscompilation, it seems
that this is also partly our fault for being funky with the pointer provenance
in this code. It's possible rust will make some changes that break the
transmute.

Use the Exposed Provenance API here and steer clear of transmute.

See: rust-lang/rust#121282
See: rust-lang/rust#147265
See: rust-lang/rust#128409 (comment)
Despite adding rb_ec_stack_check() to Rust code entry points, we've seen
SystemStackError causing test failures due to debug builds consume too
much native stack space. Let's use opt-level=1 so rustc/LLVM are more
efficient with stack space usage, hopefully enough to fit in the margin
in rb_ec_stack_check(). Continue to use opt-level=0 in the test profile.
@pull pull bot locked and limited conversation to collaborators Apr 3, 2026
@pull pull bot added the ⤵️ pull label Apr 3, 2026
@pull pull bot merged commit 6200574 into turkdevops:master Apr 3, 2026
1 check was pending
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants