67 releases

new 0.9.70 Mar 24, 2023
0.9.65 Feb 13, 2023
0.9.53 Dec 26, 2022
0.9.44 Nov 18, 2022
0.9.28 Jul 28, 2022

#66 in Build Utils

Download history 3306/week @ 2022-12-03 4774/week @ 2022-12-10 3863/week @ 2022-12-17 2970/week @ 2022-12-24 2795/week @ 2022-12-31 5439/week @ 2023-01-07 3662/week @ 2023-01-14 4303/week @ 2023-01-21 3785/week @ 2023-01-28 4675/week @ 2023-02-04 7111/week @ 2023-02-11 4475/week @ 2023-02-18 5476/week @ 2023-02-25 19161/week @ 2023-03-04 15764/week @ 2023-03-11 95079/week @ 2023-03-18

136,240 downloads per month
Used in 5 crates (via rb-sys)

MIT/Apache

47KB
1K 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

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.51+ (for old versions of rust toolchains ubuntu)

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.53
x86_64-linux-musl rbsys/x86_64-linux-musl:0.9.53
aarch64-linux rbsys/aarch64-linux:0.9.53
arm-linux rbsys/arm-linux:0.9.53
arm64-darwin rbsys/arm64-darwin:0.9.53
x64-mingw32 rbsys/x64-mingw32:0.9.53
x64-mingw-ucrt rbsys/x64-mingw-ucrt:0.9.53
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

~4.5MB
~109K SLoC