91 releases

new 0.9.94 Apr 12, 2024
0.9.90 Mar 1, 2024
0.9.85 Dec 27, 2023
0.9.83 Nov 17, 2023
0.9.28 Jul 28, 2022

#5 in #cross-compilation

Download history 15225/week @ 2023-12-21 16028/week @ 2023-12-28 26172/week @ 2024-01-04 18428/week @ 2024-01-11 19424/week @ 2024-01-18 20150/week @ 2024-01-25 22711/week @ 2024-02-01 17418/week @ 2024-02-08 13770/week @ 2024-02-15 15442/week @ 2024-02-22 13998/week @ 2024-02-29 13726/week @ 2024-03-07 13616/week @ 2024-03-14 11810/week @ 2024-03-21 12981/week @ 2024-03-28 9591/week @ 2024-04-04

50,136 downloads per month
Used in 8 crates (via rb-sys)

MIT/Apache

68KB
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.94
x86_64-linux-musl rbsys/x86_64-linux-musl:0.9.94
aarch64-linux rbsys/aarch64-linux:0.9.94
aarch64-linux-musl rbsys/aarch64-linux-musl:0.9.94
arm-linux rbsys/arm-linux:0.9.94
arm64-darwin rbsys/arm64-darwin:0.9.94
x64-mingw32 rbsys/x64-mingw32:0.9.94
x64-mingw-ucrt rbsys/x64-mingw-ucrt:0.9.94
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

~6–13MB
~138K SLoC