Skip to content

Conversation

@eregon
Copy link
Member

@eregon eregon commented Nov 21, 2025

@eregon eregon marked this pull request as draft November 21, 2025 19:11
@eregon eregon changed the title Fix harness-common.rb to not depend on Ractor being defined Fix make_shareable shim in harness-common.rb Nov 21, 2025
@eregon eregon force-pushed the fix-harness-common-ractor-defined branch from de70988 to b5f1f6b Compare November 21, 2025 19:13
@eregon eregon marked this pull request as ready for review November 21, 2025 19:14
* Ractor is not defined on non-CRuby.
@eregon eregon force-pushed the fix-harness-common-ractor-defined branch from b5f1f6b to 0e1ee81 Compare November 21, 2025 19:30
@eregon eregon enabled auto-merge November 21, 2025 19:40
@eregon eregon disabled auto-merge November 21, 2025 19:41
@eregon
Copy link
Member Author

eregon commented Nov 21, 2025

Mmh, it's not great to define Ractor because then things like this happen:
https://github.com/ruby/ruby-bench/actions/runs/19581337387/job/56079691198?pr=442

/home/runner/.rubies/truffleruby-25.0.0/lib/mri/psych.rb:709:in `config': undefined method `current' for class Ractor (NoMethodError)
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/psych.rb:725:in `load_tags='
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/psych.rb:741:in `<module:Psych>'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/psych.rb:234:in `<top (required)>'
	from <internal:core> core/kernel.rb:229:in `gem_original_require'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/bundled_gems.rb:69:in `require'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/yaml.rb:4:in `<top (required)>'
	from <internal:core> core/kernel.rb:229:in `gem_original_require'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/bundled_gems.rb:69:in `require'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/gems/gems/rubocop-1.79.1/lib/rubocop/config_loader_resolver.rb:4:in `<top (required)>'
	from <internal:core> core/kernel.rb:292:in `require_relative'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/gems/gems/rubocop-1.79.1/lib/rubocop.rb:778:in `<top (required)>'
	from <internal:core> core/kernel.rb:229:in `gem_original_require'
	from /home/runner/.rubies/truffleruby-25.0.0/lib/mri/bundled_gems.rb:69:in `require'
	from /home/runner/work/ruby-bench/ruby-bench/benchmarks/rubocop/benchmark.rb:11:in `<main>'

So I think we should either define Object#make_shareable (see #375 (comment)), or Object#deep_freeze.

@rafaelfranca
Copy link
Collaborator

I think since this is mostly for shim a method that doesn't exist anyway in some Ruby implementation Object#make_shareable should be fine

* Defining Ractor causes issues with gems assuming the rest of Ractor is available, like:
  lib/mri/psych.rb:709:in `config': undefined method `current' for class Ractor (NoMethodError)
@eregon
Copy link
Member Author

eregon commented Nov 21, 2025

Done, and updated benchmarks to use Object#make_shareable. Should be good now (tried a few benchmarks locally) but I'll check CI.

@eregon eregon enabled auto-merge November 21, 2025 20:11
@eregon eregon merged commit f5d5e0f into ruby:main Nov 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants