Support Ruby 4.0 by upgrading magnus to 0.8#34
Open
mlarraz wants to merge 1 commit intonjaremko:mainfrom
Open
Conversation
Ruby 4.0 removed the `typed_flag` field from `RTypedData`, which breaks magnus 0.7.x compilation. Upgrade to magnus 0.8.2 which has the fix. Changes: - Bump magnus from 0.7 to 0.8 in both ext/parquet and ext/parquet-ruby-adapter Cargo.toml files - Enable `old-api` feature to maintain compatibility with existing code that uses associated functions like `RArray::new()`, `RHash::new()` - Refactor StringCache to use Rust-side deduplication (HashSet<Arc<str>>) instead of Ruby VM interning via FString, which was removed in magnus 0.8 as it could not safely guarantee interned strings wouldn't be garbage collected - Bump rb-sys from 0.9.116 to 0.9.124 for Ruby 4.0 bindings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ruby 4.0 removed the
typed_flagfield fromRTypedData(see ruby/ruby@ce51ef30), which causes compilation failures with magnus 0.7.x:This PR upgrades magnus from 0.7 to 0.8, which includes the fix (see matsadler/magnus#147).
Changes
0.7to0.8in bothext/parquet/Cargo.tomlandext/parquet-ruby-adapter/Cargo.tomlold-apifeature to maintain compatibility with existing code that uses associated functions likeRArray::new(),RHash::new(),Symbol::new()(deprecated in 0.8, not removed)StringCacheto use Rust-side deduplication (HashSet<Arc<str>>) instead of Ruby VM interning viaFString, which was removed in magnus 0.8 as it could not safely guarantee interned strings wouldn't be garbage collected0.9.116to0.9.124for Ruby 4.0 bindings supportTesting
Verified the Rust extension compiles successfully against Ruby 4.0.1 on arm64-darwin.
Test plan
cargo build --releasecompiles cleanly on Ruby 4.0.1