This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Repository navigation
Conversation
…Ractors I18n.fallbacks fell through to @@fallbacks whenever the fiber had no :i18n_fallbacks (fallbacks never set, or a fiber with its own storage), and Ruby 4.0 refuses every class variable read from a non-main Ractor. It is now a module instance variable, which i18n/ractorize makes shareable; I18n.fallbacks= still freezes shallowly, so #map keeps working outside Ractors. INTERPOLATION_PATTERN gets back its .freeze. Both were reported by @yaroslav in ruby-i18n#741.
6 of 8 tasks
mhenrixon
added a commit
to zoolutions/conformance-kit
that referenced
this pull request
Oct 19, 2026
…ails main `conformance-kit check --ractorize` boots `ractorize.app` the way Rails 8.2 runs an app across Ractors: in production, with `ActiveSupport::Ractors.unshareable_proc_action = :raise`, then `Rails.application.ractorize!` and `require "i18n/ractorize"`. Each `ractorize.requests` path is served inside a non-main Ractor; a failure names the root cause and its first frame, also when the app's error page swallowed it (env["action_dispatch.exception"]). Then the audit runs on `ractorize.audit_namespaces` (default audit.namespace) in the same process. It skips with the reason below Ruby 4.0 or on a Rails without ractorize!. - New .conformance.yml keys: ractorize.app, .requests, .audit_namespaces, .setup (validated like the rest: unknown key exits 2). - config/ractorize.gemfile: the repo's Gemfile with Rails main, Rack main and Shopify/i18n#5 swapped in (it drops the repo's own lines for them, since Bundler refuses a gem declared twice). - conformance.yml: a Ractorize job, only when ractorize.app is set, continue-on-error until Rails 8.2 ships ractorize!. - main.yml: a report-only "Ractorize lane" (Ruby 4.0, the same gemfile) runs the fixture specs: a boot violation (a route block appended from an initializer) and a render violation (a shallow-frozen class ivar) must fail, naming the file and line; a conforming engine must pass. Refs #22 Claude-Session: https://claude.ai/code/session_01JCaQrTh5yGHrueUmq69PKs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the two things @yaroslav reported on ruby-i18n#741 (comment).
I18n.fallbacksfalls through to@@fallbackswhenever the current fiber has no:i18n_fallbacks, and Ruby 4.0 refuses every class variable read from a non-main Ractor, even when the value is shareable. Two cases hit it:I18n.fallbacks, oncei18n/backend/fallbacksis loaded. Action View then reads it for every lookup context (register_detail(:locale)inaction_view/lookup_context.rb:48), so every rendered page in a Ractor raises.Fiber.new(storage: {})), even when fallbacks were set at boot.The value now lives in a module instance variable, and
i18n/ractorizemakes it deeply shareable. The setter still freezes shallowly, so callingI18n.fallbacks.map(...)during boot keeps working.INTERPOLATION_PATTERNgets back its.freeze.Tests
test/ractor_test.rbruns each case in a child Ruby, becausei18n/ractorizemakes the configuration shareable for the rest of the process. The tests skip below Ruby 4.0.can not access class variables from non-main Ractors (@@fallbacks from I18n)andcan not access non-shareable objects in constant I18n::INTERPOLATION_PATTERN.bundle exec rake testgives 1610 runs, 0 failures on Ruby 4.0.7. On Ruby 3.4 the three new tests skip and the rest pass.I found this while running pghero's test suite with
Rails.application.ractorize!(ankane/pghero#548).Conformance case
test/ractor_test.rb:12: "I18n.fallbacks is readable from a non-main Ractor when it was never set"58aa1dc), Ruby 4.0.7: fails withRactor::IsolationError: can not access class variables from non-main Ractors (@@fallbacks from I18n); theINTERPOLATION_PATTERNtest fails withcan not access non-shareable objects in constant I18n::INTERPOLATION_PATTERN by non-main Ractor.Each test runs
require "i18n/ractorize"in a child Ruby and then reads the value in a Ractor, so it fails again if somethingractorizeshould cover stops being shareable; it skips below Ruby 4.0.