gjtorikian / commonmarker

Ruby wrapper for the comrak (CommonMark parser) Rust crate
MIT License
429 stars 82 forks source link

Migrate to magnus/rb_sys #194

Closed gjtorikian closed 1 year ago

gjtorikian commented 1 year ago

The previous attempt to create a gem based on a Rust lib worked, but I could not for the life of me figure out MingW build errors in the FFI.

After searching the Net for some help I came across rb-sys and magnus; the former makes packaging Rust libs much easier than the mini_portile2 method I was using before, and the latter enabled writing the glue binding code to be written in Rust, not C. Beautiful, incredible.

gjtorikian commented 1 year ago

Awesome stuff, super excited to see this happening. Let me know if you have any questions along the way. Happy to help!

Thanks! The rewrite to use Rust “glue” has happened and was tremendously easy. My biggest fight right now is figuring out how to automate the compilation and packaging for all the operating systems I want to support. This has raised a number of problems, most of which are GitHub Actions runner related:

I just want x86_64 and arm64 builds for Linux, Windows, and macOS. I got it working locally but I’m really struggling with the runners. 😞

ianks commented 1 year ago

aarch64-linux builds to indeed work with magnus, but arm-linux (32 bit) do not yet.

I just want x86_64 and arm64 builds for Linux, Windows, and macOS. I got it working locally but I’m really struggling with the runners. 😞

The cross-gem-action should support all of these. Here is a good working reference. These images are all based on rake-compiler-dock. I would recommend using these images since they have all of the right libc versions and patches in place, whereas the github runner images may have portability issues.