From 3c5bccbe33d545e7d1a4eeb4576fd227fd2bb450 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 12 Oct 2024 12:27:01 +0200 Subject: [PATCH 1/3] Skip well-known failing test on truffleruby * https://github.com/oracle/truffleruby/issues/2431 --- test/lib/zeitwerk/test_ruby_compatibility.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/zeitwerk/test_ruby_compatibility.rb b/test/lib/zeitwerk/test_ruby_compatibility.rb index 2ff7817..30d91bc 100644 --- a/test/lib/zeitwerk/test_ruby_compatibility.rb +++ b/test/lib/zeitwerk/test_ruby_compatibility.rb @@ -265,6 +265,8 @@ def require(path) # This allows Zeitwerk to be thread-safe on regular file autoloads. Module # autovivification is custom, has its own test. test "autoloads and constant references are synchronized" do + skip 'https://github.com/oracle/truffleruby/issues/2431' if RUBY_ENGINE == 'truffleruby' + $ensure_M_is_autoloaded_by_the_thread = Queue.new files = [["m.rb", <<-EOS]] From d94fcfe8f6e1298863c460dabb5f78fd1b49898f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 12 Oct 2024 12:28:00 +0200 Subject: [PATCH 2/3] Add truffleruby in CI now that the test suite is passing on it * We need to use truffleruby-head for now because of https://github.com/oracle/truffleruby/issues/3683 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cfbcbf..777e672 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,11 @@ jobs: ruby-version: - "3.2" - "3.3" + - "truffleruby-head" - "head" + exclude: + - { os: "windows-latest", ruby-version: "truffleruby-head" } + runs-on: ${{ matrix.os }} steps: - uses: "actions/checkout@v4" From 1267f6dad7a3deeb2dfe56e933864fdb17019af5 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 18 Oct 2024 20:44:19 +0200 Subject: [PATCH 3/3] Update README about TruffleRuby --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7073dc2..73a2335 100644 --- a/README.md +++ b/README.md @@ -1386,7 +1386,10 @@ The test suite passes on Windows with codepage `Windows-1252` if all the involve Starting with version 2.7, Zeitwerk requires Ruby 3.2 or newer. -As of this writing, Zeitwerk 2.7 does not work with TruffleRuby due to https://github.com/oracle/truffleruby/issues/3683. Nowadays, TruffleRuby users need a `< 2.7` version contraint for the `zeitwerk` gem. Older versions of Zeitwerk run well, except autoloading is not thread-safe. See https://github.com/oracle/truffleruby/issues/2431. If your program is multi-threaded, you need to eager load before threads are created. +Zeitwerk 2.7 requires TruffleRuby 24.1.2+ due to https://github.com/oracle/truffleruby/issues/3683. +Alternatively, TruffleRuby users can use a `< 2.7` version constraint for the `zeitwerk` gem. +As of this writing, [autoloading is not fully thread-safe yet on TruffleRuby](https://github.com/oracle/truffleruby/issues/2431). +If your program is multi-threaded, you need to eager load before threads are created. JRuby 9.3.0.0 is almost there. As of this writing, the test suite of Zeitwerk passes on JRuby except for three tests. (See https://github.com/jruby/jruby/issues/6781.)