Skip to content

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 27, 2025

Bumps magnus from 0.7.1 to 0.8.0.

Release notes

Sourced from magnus's releases.

0.8.0

Magnus 0.8.0 adds a handful of features and fixes. The old-api feature introduced in 0.7.0 is no longer a default feature, so functions marked as part of the old API will be deprecated by default. Otherwise it is largely compatible with 0.7.

Magnus is a Rust library providing a high-level easy-to-use interface to the C API of the Ruby programming language. Magnus lets you write Ruby extension libraries (or 'gems') in Rust, or embed Ruby in your Rust program.

Fixes

  • The fatal exception raised when a Rust function bound to Ruby panics can no longer be caught with rescue Exception.
  • Fixed type bounds for TryConvertOwned for (T, ...) so that T must be TryConvertOwned.

API changes

The minimum supported Rust version in now 1.65.

Magnus 0.5 and earlier would allow you to create Ruby objects with associated functions, like RArray::new. In Magnus 0.6 a new set of APIs for creating Ruby objects was added, as methods on a Ruby handle that can only be obtained on a Ruby thread. The older associated functions API is now marked as deprecated by default. The old-api feature can be enabled to disable deprecation warnings for the old API. In a future version of Magnus will remove this feature.

The FString type has been removed as it can not safely uphold the promise it was making. Either due to Ruby's apis changing or a misinterpretation of old documentation it had been designed assuming interned strings (aka 'fstrings') would not be garbage collected, which is not the case.

Conversions between Ruby's Time and Rust's SystemTime now preserve nanosecond precision.

RString::to_string will now use a Ruby utf-8 validation api that caches the results of the validity check. This will greatly improve performance in the case a string is already known to be utf-8, but may slightly reduce performance when not known.

New Features

Upgrading

Upgrading from Magnus 0.6 or 0.7 should be straightforward. If upgrading from 0.5 or earlier, it's recommended to upgrade to 0.6 first.

FromIterator for RArray and RHash are hidden behind the old-api feature (which will be removed in a future version of Magnus). Use Ruby::ary_from_iter and Ruby::hash_from_iter rather than RArray/Rhash::from_iter or collect::<RArray>()/collect::<RHash>().


See the changelog for all the changes.

Thanks

@​ankane for implementing TryConvert for NonZero types, i128/u128 support, and some additional improvements. @​emwalker for the chrono feature. @​erickguan for improvements to docs, some fixes, and IO features including Ruby::io_extract_modeenc. @​ianks and @​sandbergja for other fixes. @​yaroslav for a detailed issue report that lead to an improvement.

Changelog

Sourced from magnus's changelog.

[0.8.0] - 2025-08-25

Added

  • Ruby::time_nano_new, Ruby::time_timespec_new, and Time::timespec.
  • The chrono feature can be enabled to allow automatic conversions between chrono::DateTime<Utc> and chrono::DateTime<FixedOffset> and Ruby Time objects.
  • typed_data::Writebarrier::writebarrier and writebarrier_unprotect.
  • Implement TryConvert for NonZero types.
  • io module available with io feature, supporting io_extract_modeenc, OpenFlags, FMode, and IoEncoding.
  • Ruby::io_extract_modeenc, a safe wrapper around rb_io_extract_modeenc, allowing structured extraction of open flags, mode flags, and IO encoding metadata.
  • OpenFlags struct, which wraps Ruby's O_ open flags (e.g. O_RDONLY, O_CREAT) in a convenient bitflag-like interface.
  • FMode struct, representing FMODE_ flags used internally by Ruby to represent IO modes (READ, WRITE, BINARY_MODE, etc.).
  • IoEncoding, a safe Rust struct for temporarily owning and inspecting rb_io_encoding, including safe accessors for internal/external encoding and encoding options.
  • Automatic type conversions to/from i128/u128.
  • to_i128/to_u128 for Fixnum/Bignum/Integer.
  • Ruby::integer_from_i128 & Ruby::integer_from_u128.
  • RHash::to_btree_map and automatic conversion from Hash to BTreeMap.

Changed

  • Minimum supported Rust version is now 1.65.
  • Conversions between Ruby's Time and Rust's SystemTime now preserve nanosecond precision.
  • 'old-api' feature, which disables deprecation warnings for the old api is no longer a default feature.
  • RString::to_string will now use a Ruby utf-8 validation api that caches the results of the validity check. This will greatly improve performance in the case a string is already known to be utf-8, but may slightly reduce performance when not known.
  • RString::to_interned_str now returns an RString rather than an FString.

Deprecated

  • thread_fd_close as it will be a no-op as of Ruby 3.5

Removed

  • FString as it can not safely uphold the promise it was making. Either due to Ruby's apis changing or a misinterpretation of old documentation it had been designed assuming interned strings (aka fstrings) would not be garbage collected, which is not the case.
  • RString::as_interned_str as its only purpose was to return an FString.

Fixed

  • The fatal exception raised when a Rust function bound to Ruby panics can no longer be caught with rescue Exception.

... (truncated)

Commits
  • 108c87e Merge pull request #154 from sandbergja/singleton-typo
  • 5347568 Fix typo: singlton should be singleton
  • 56bb429 update examples in magnus-macros
  • 16c1cc9 better fix for change in rb_fiber_raise
  • 00db8b1 fix doc
  • 5adb4d2 fix warnings introduced in newer rustc
  • 619c27e remove FString
  • f4d3e5e update changelog
  • 1940d56 add io_extract_modeenc to C function index
  • 96a126c Merge pull request #144 from erickguan/io
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [magnus](https://github.com/matsadler/magnus) from 0.7.1 to 0.8.0.
- [Release notes](https://github.com/matsadler/magnus/releases)
- [Changelog](https://github.com/matsadler/magnus/blob/main/CHANGELOG.md)
- [Commits](matsadler/magnus@0.7.1...0.8.0)

---
updated-dependencies:
- dependency-name: magnus
  dependency-version: 0.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Aug 27, 2025
Copy link

codspeed-hq bot commented Aug 27, 2025

CodSpeed Performance Report

Merging #542 will not alter performance

Comparing dependabot/cargo/bindings/ruby/magnus-0.8.0 (e15fff8) with master (e189022)

Summary

✅ 6 untouched benchmarks

Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.11%. Comparing base (e189022) to head (e15fff8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #542   +/-   ##
=======================================
  Coverage   89.11%   89.11%           
=======================================
  Files          18       18           
  Lines        2048     2048           
=======================================
  Hits         1825     1825           
  Misses        223      223           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants