-
-
Notifications
You must be signed in to change notification settings - Fork 55
Small improvements for Ruby 4.0 support #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+146
−47
Conversation
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
Previously, the CString was being created inline and immediately dropped, causing undefined behavior when rb_str_new_cstr tried to read from the dangling pointer. Now we keep the CString alive until after the FFI call.
Suppress the new Rust lint warning for function pointer comparisons in generated bindings.
- Add nixpkgs-ruby input for better Ruby version management - Configure Ruby 4.0.0-preview2 via .ruby-version file - Refactor devShell to use explicit pkgs prefix - Remove bundler (included with Ruby) - Update flake.lock with new dependencies
Add .envrc for automatic Nix flake loading and .ruby-version to specify Ruby 4.0.0-preview2.
Add continue-on-error for truffleruby matrix entries due to known compatibility issues. Remove allow_failure after 2025-01-01.
Update tests to invoke crate::ruby_sysinit (platform-agnostic wrapper for rb_w32_sysinit) and add a stack marker (using std::ptr::addr_of_mut) passed to crate::ruby_init_stack before calling ruby_setup. Ensures proper stdio/VM initialization and correct GC stack scanning, especially on Windows.
Unpin several gems in Gemfile (rake, minitest, rake-compiler, rake-compiler-dock, racc, base64, standard) to allow flexible versions. Remove the Ruby-version guard around the standard gem so it's always included. Add tsort as a dependency.
The ensure block was inside the each iterator without a begin block, which is invalid Ruby syntax and causes a parse error with older Ruby parsers.
- Fix conditional grouping in cargo_test_task so CI/--verbose check evaluates correctly when deciding test args. - Add parentheses around ternary and comparisons to avoid ambiguity. - Use super(<<~MSG) to pass heredoc safely. - Simplify string interpolation in mkmf and normalize require_relative paths.
nobu
reviewed
Jan 8, 2026
| - os: windows-2025 | ||
| rust_toolchain: stable | ||
| include: | ||
| # TODO: Remove allow_failure after 2025-01-01 (known compatibility issues) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe after 2026-01-01?
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
rb_str_new_cstrfinished reading from itnixpkgs-rubyfor version managementunpredictable_function_pointer_comparisonsRust lint in generated bindings