80 releases

new 0.9.83 Nov 17, 2023
0.9.81 Aug 3, 2023
0.9.79 Jun 13, 2023
0.9.70 Mar 24, 2023
0.9.28 Jul 28, 2022

#71 in Procedural macros

Download history 12577/week @ 2023-07-28 9029/week @ 2023-08-04 10846/week @ 2023-08-11 10781/week @ 2023-08-18 8633/week @ 2023-08-25 12174/week @ 2023-09-01 14251/week @ 2023-09-08 14569/week @ 2023-09-15 24245/week @ 2023-09-22 50212/week @ 2023-09-29 15603/week @ 2023-10-06 21282/week @ 2023-10-13 23486/week @ 2023-10-20 24225/week @ 2023-10-27 26631/week @ 2023-11-03 17399/week @ 2023-11-10

95,313 downloads per month
Used in 8 crates (2 directly)

MIT/Apache

65KB
1.5K SLoC

rb-sys

.github/workflows/ci.yml Join the discussion Crates.io Gem

The primary goal of rb-sys is to make building native Ruby extensions in Rust easier than it would be in C. If it's not easy, it's a bug.

Features

  • Battle-tested Rust bindings for the Ruby C API
  • Support for Ruby 2.4+
  • Supports all major platforms (Linux, macOS, Windows)
  • Cross compilation of gems
  • Integration with rake-compiler

New to rb-sys?

Usage

Below are some examples of how to use rb-sys to build native Rust extensions. Use these as a starting point for your building your own gem.

Supported Toolchains

  • Ruby: 2.4+ (for full compatibility with Rubygems)
  • Rust: 1.60+

Supported Platforms

We support cross compilation to the following platforms (this information is also available in the ./data directory for automation purposes):

Platform Supported Docker Image
x86_64-linux rbsys/x86_64-linux:0.9.82
x86_64-linux-musl rbsys/x86_64-linux-musl:0.9.82
aarch64-linux rbsys/aarch64-linux:0.9.82
arm-linux rbsys/arm-linux:0.9.82
arm64-darwin rbsys/arm64-darwin:0.9.82
x64-mingw32 rbsys/x64-mingw32:0.9.82
x64-mingw-ucrt rbsys/x64-mingw-ucrt:0.9.82
mswin not available on Docker

Getting Help

We make a concerted effort to help out new users. If you have questions, please join our Slack and post your question in the #general channel. Alternatively, you can open an issue and we'll try to help you out.

Contributing

See the CONTRIBUTING.md file for information about setting up a development environment.

Bug reports and pull requests are welcome on GitHub at https://github.com/oxidize-rb/rb-sys.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~5.5–7.5MB
~130K SLoC