Skip to content

Add TruffleRuby CI job#2996

Merged
soutaro merged 2 commits into
masterfrom
claude/adoring-albattani-6iiaey
Jun 16, 2026
Merged

Add TruffleRuby CI job#2996
soutaro merged 2 commits into
masterfrom
claude/adoring-albattani-6iiaey

Conversation

@soutaro

@soutaro soutaro commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds an experimental CI workflow (.github/workflows/truffleruby.yml) that builds the C extension and runs the test suite on TruffleRuby, so we can track whether RBS works on TruffleRuby.

The job is marked continue-on-error: true because TruffleRuby support is experimental — it reports the current status without blocking the build.

Workflow details

  • Sets up truffleruby via ruby/setup-ruby
  • Sets LANG: en_US.UTF-8 (TruffleRuby falls back to US-ASCII and emits warnings/errors when the locale is not UTF-8)
  • Runs bin/setup (compiles the C extension) then rake test
  • Excludes the profilers and typecheck_test bundle groups (not needed for the smoke test)

Verification

Verified locally with TruffleRuby 34.0.1 (like ruby 3.4.9):

Item Result
rbs_extension C extension compile/link ✅ builds (a few unsupported flags such as -Wc++-compat are auto-skipped by mkmf)
Loading core/stdlib signatures ✅ works
Parsing signatures (via the C extension) ✅ works
Core tests (parser/types/environment/definition_builder/writer, 250 tests) ✅ 99.6% (1 failure)

Known gaps / differences on TruffleRuby:

  1. rbs prototype rb/rbi/runtimeRubyVM::AbstractSyntaxTree is missing on TruffleRuby (already documented as MRI-only in cli.rb).
  2. Inline comment parsing (AST::Ruby) — TruffleRuby's prism returns nil from Prism::Location#start_line_slice, causing errors.
  3. A C-extension UTF-8 edge case — an invalid UTF-8 byte (\xFF) does not raise ParsingError as it does on MRI.

So RBS's core functionality works on TruffleRuby, but the full suite is not green yet — hence the continue-on-error job.

https://claude.ai/code/session_012razqriUGBbQnyVt6egp22


Generated by Claude Code

soutaro added 2 commits June 16, 2026 03:10
Add an experimental CI workflow that builds the C extension and runs the
test suite on TruffleRuby. The job is marked continue-on-error so it
reports the current status without blocking the build.
Add an `omit_on_truffle_ruby!` helper (class-level and instance-level) to
centralize skipping tests that cannot pass on TruffleRuby, instead of
sprinkling engine checks throughout the suite.

Skip whole classes that depend on features TruffleRuby lacks:
- prototype tests (RubyVM::AbstractSyntaxTree)
- runtime test tester (TracePoint :end event)

Skip the few isolated cases in otherwise-supported classes (CLI prototype/
test commands, inline comment parsing via prism, loop Enumerator type
checking, invalid UTF-8 handling, GC.compact).

With these omitted, the suite is green on TruffleRuby, so drop
continue-on-error from the workflow.
@soutaro soutaro added this to the RBS 4.1 milestone Jun 16, 2026
@soutaro soutaro merged commit 76f3c23 into master Jun 16, 2026
26 of 29 checks passed
@soutaro soutaro deleted the claude/adoring-albattani-6iiaey branch June 16, 2026 13:30
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.

1 participant