macournoyer / rb-sys

Easily build Ruby native extensions in Rust

Home Page:https://oxidize-rb.github.io/rb-sys/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

Quick links

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.81
x86_64-linux-musl βœ… rbsys/x86_64-linux-musl:0.9.81
aarch64-linux βœ… rbsys/aarch64-linux:0.9.81
arm-linux βœ… rbsys/arm-linux:0.9.81
arm64-darwin βœ… rbsys/arm64-darwin:0.9.81
x64-mingw32 βœ… rbsys/x64-mingw32:0.9.81
x64-mingw-ucrt βœ… rbsys/x64-mingw-ucrt:0.9.81
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.

About

Easily build Ruby native extensions in Rust

https://oxidize-rb.github.io/rb-sys/

License:Apache License 2.0


Languages

Language:Rust 69.8%Language:Ruby 24.3%Language:Shell 4.1%Language:C 1.2%Language:Dockerfile 0.6%