Skip to content

Add Ruby 4.0 support: upgrade magnus to 0.8.2 and update CI#83

Merged
fs0414 merged 9 commits intomainfrom
issue70-magnos-support-upgrade
Jan 25, 2026
Merged

Add Ruby 4.0 support: upgrade magnus to 0.8.2 and update CI#83
fs0414 merged 9 commits intomainfrom
issue70-magnos-support-upgrade

Conversation

@fs0414
Copy link
Owner

@fs0414 fs0414 commented Jan 25, 2026

📋 Summary

This PR adds full Ruby 4.0 support by upgrading dependencies and updating all CI workflows. This fixes the build errors reported in Issue #70.

🔧 Main Changes

Dependency Upgrades

  • magnus: 0.6.2 → 0.8.2 (Ruby 4.0 compatible)
  • rb-sys: 0.9.117 → 0.9.124 (Ruby 4.0 stable API support)
  • unicode-emoji: 4.1.0 → 4.2.0 (Ruby 4.0 compatible)

API Migration

  • lib.rs: Updated to use ruby.define_module() instead of deprecated define_module() function

CI Configuration Updates

  • ci.yml: Test matrix updated to ['3.4', '4.0'], lint/coverage use Ruby 4.0
  • main.yml: Ruby version updated to 4.0
  • release.yml: All jobs updated to Ruby 4.0, cross-gem targets 3.4,4.0

🗂️ Changed Files

  • CI: .github/workflows/ci.yml, .github/workflows/main.yml, .github/workflows/release.yml
  • Rust deps: ext/rfmt/Cargo.toml, Cargo.lock
  • Ruby deps: Gemfile.lock
  • Rust code: ext/rfmt/src/lib.rs

🧪 Testing

Local Test Results

87 examples, 0 failures

Verification

  • Build succeeds on Ruby 3.4.5
  • All 87 tests pass
  • No Rust compilation warnings
  • CI passes on Ruby 3.4 and 4.0

📦 Breaking Changes

Dropped Ruby versions: 3.1, 3.2, 3.3 are no longer tested in CI. Minimum supported version is now Ruby 3.4.

Related Issue

Closes #70

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

fs0414 and others added 9 commits January 25, 2026 13:39
- Multi-stage build (builder/runtime/test stages)
- Minimal Rust profile for faster installs
- YAML anchors for DRY compose config
- Simplified test script with modern bash

Co-Authored-By: Claude <noreply@anthropic.com>
Add Docker test environment for gem install verification
@fs0414 fs0414 merged commit a737dc4 into main Jan 25, 2026
8 checks passed
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.

[Bug]: build errors occur on Ruby 3.4.8 or later when gem install rfmt

1 participant