`Gem::Version.new`, `#bump`, and `#release` do not work in ractor
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start with lib/rubygems/version.rb, especially Gem::Version.new, #bump, and #release, and review how their class variables are used. Reproduce the reported Ractor::IsolationError in a non-main Ractor, then add or update the relevant RubyGems tests to cover those methods in Ractors. Done means the methods work in the reported Ractor scenarios without the class-variable isolation error, with focused tests passing.
索引モデルが issue の本文から書いたものです。
説明
reproduction:
Gem::VERSION # => "4.0.23"
Ractor.new { Gem::Version.new(1) }
# => #<Thread:0x0000000122ea71d0 run> terminated with exception (report_on_exception is true):
# => ~/.asdf/installs/ruby/4.0/lib/ruby/4.0.0/rubygems/version.rb:201:in 'Gem::Version.new':
# => can not access class variables from non-main Ractors (@@all from Gem::Version) (Ractor::IsolationError)
relevant code: https://github.com/ruby/rubygems/blob/f033df93676007227d1ae0bd7326008e6396b3e9/lib/rubygems/version.rb#L212-L220
i guess this hasn't become apparent yet because gem versions are usually initialized at load-time? it could, however, be an issue for a few gems that do things like if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0') at runtime.
same for #bump and #release:
Ractor.new(Gem::Version.new(1), &:bump)
# => #<Thread:0x00000001206e3658 run> terminated with exception (report_on_exception is true):
# => ~/.asdf/installs/ruby/4.0/lib/ruby/site_ruby/4.0.0/rubygems/version.rb:236:in 'Gem::Version#bump':
# => can not access class variables from non-main Ractors (@@bump from Gem::Version) (Ractor::IsolationError)
Ractor.new(Gem::Version.new(1), &:release)
# => #<Thread:0x00000001206c0b80 run> terminated with exception (report_on_exception is true):
# => ~/.asdf/installs/ruby/4.0/lib/ruby/site_ruby/4.0.0/rubygems/version.rb:314:in 'Gem::Version#release':
# => can not access class variables from non-main Ractors (@@release from Gem::Version) (Ractor::IsolationError)
- 主要言語
- Ruby
- スター
- 4k
- フォーク
- 2k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 48
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/rubygems のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
Cooldown drops the locked version of a gem named in bundle lock --update or bundle update対応中かも @senid231 が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
Gem::Package::TarReader silently ignores pax/GNU extension headers対応中かも @akasakariko が 5 日前に担当しました。 オープンRubyGems
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
ruby/rubygems#9988 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`bundle install` exits 0 even when a git gem's submodules fail to clone対応中かも @mattyb が 14 日前に担当しました。 オープンBundler
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
swombat/souls-house#795 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
Missing hi translation: components/common/CommunitySolution.tsx:communitySolution.numTimesStarredオープン
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
Tracking: SQLite usage and the Windows GVL/SQLite deadlock (lich-5#2254): moonwatch.lic, low riskオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
elanthia-online/dr-scripts#7968 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
fullsend-ai/agents#1901 ·
メンテナーはふだん 1 日以内に返信