Skip to content

Conversation

@pboling
Copy link
Contributor

@pboling pboling commented Jan 31, 2026

  • lock in ruby_version/RUBY_VERSION +N parsing
  • keep MAJOR/MINOR/TEENY strict numeric parsing
  • add version.rs coverage for ruby_version suffix case

Closes #705
See: matsadler/magnus#167

Related: #703

Copilot AI review requested due to automatic review settings January 31, 2026 02:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates rb-sys’s environment/version handling to correctly support Ruby’s new +N ABI suffix while keeping strict numeric parsing for discrete MAJOR/MINOR/TEENY env vars, and adds tests to lock in the expected behavior.

Changes:

  • Bump internal crate versions in the fuzz workspace lockfile to align with the new rb-sys and helper crate versions.
  • Add a build-script test to ensure Version::current correctly parses ruby_version strings with a +N suffix.
  • Extend RubyVersion::from_raw_environment to parse VERSION/ruby_version/RUBY_VERSION values with suffixes via a new parse_version_component helper, while preserving strict numeric parsing for MAJOR/MINOR/TEENY, and add targeted tests for these cases.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
fuzz/Cargo.lock Updates pinned versions of rb-sys, rb-sys-build, rb-sys-env, and test-helper crates to match the new crate versions used elsewhere.
crates/rb-sys/build/version.rs Adds a unit test for Version::current to confirm that a ruby_version like 4.1.0+1 is parsed to Version::new(4, 1).
crates/rb-sys-env/src/ruby_version.rs Adjusts environment-based Ruby version parsing to accept +N and similar suffixes on VERSION / ruby_version / RUBY_VERSION, introduces parse_version_component, and adds tests for suffix handling and for rejecting suffixed MAJOR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pboling pboling force-pushed the feat/ruby-version-patch-as-abi branch from 1182081 to d9f9557 Compare January 31, 2026 02:19
@pboling pboling changed the title rbsys-env: add tests for version suffix handling feat: handle ABI version suffix in Ruby HEAD Jan 31, 2026
• lock in ruby_version/RUBY_VERSION +N parsing
• keep MAJOR/MINOR/TEENY strict numeric parsing
• add version.rs coverage for ruby_version suffix case
@pboling pboling force-pushed the feat/ruby-version-patch-as-abi branch from d9f9557 to 5b737ea Compare February 1, 2026 07:10
@gjtorikian gjtorikian merged commit 1a7c43d into oxidize-rb:main Feb 1, 2026
57 checks passed
@gjtorikian
Copy link
Member

thank you!

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.

Ruby HEAD ABI Version

2 participants