Skip to content

Commit

Permalink
Merge pull request #305 from eregon/add-truffleruby-in-ci
Browse files Browse the repository at this point in the history
Add TruffleRuby in CI
  • Loading branch information
fxn authored Oct 18, 2024
2 parents 5ecdd9f + 1267f6d commit 0be1875
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.)

Expand Down
2 changes: 2 additions & 0 deletions test/lib/zeitwerk/test_ruby_compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down

0 comments on commit 0be1875

Please sign in to comment.