You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The support for building Rust extensions added in #5175 is great! But we are lacking documentation on the proper way to use it. https://guides.rubygems.org/gems-with-extensions/ only talks about C extensions as well.
After trying to publish a gem with a Rust extension built with rutie, it seems like the ruby library has to require the <gemname.so> file for the integration to work. However, it is not clear how to build that shared library while developing the gem locally. Cargo builds usually end up in the target directory, and it only builds the lib<gemname>.so object (which incidentally ends up at /path/to/ruby/extensions/<platform>/release. through the Cargo extension builder).
Moreover, it seems like it expects us to check in the Cargo.lock file, whereas Cargo by default adds to to .gitignore for lib projects.
Basically, I think we can benefit from docs on how to structure the project correctly to be installed and worked on locally. I haven't yet figured out a way to make both of those possible at the same time, so while I am willing to contribute docs, I would appreciate pointers!
I recommend using the rb_sys for developing a gem locally. It handles all of that stuff, and more. As far as starting a new gem, #5613 will make getting started a lot easier.
I've started a bit on writing docs for it in this Cargo book. Although I consider Rust in Ruby to have feature parity with C at this point, the documentation is the biggest weakness at this point. I would be incredibly grateful for help on this!
If you are interested in helping, I would love to help you through this. Can you join the oxidize-rb Slack to discuss more? @pawandubey
Thanks @deivid-rodriguez and @ianks! I will check out the links. Looks like things are already moving in the right direction, which is exciting! I will join the Slack and connect there. I am happy to leave this issue open for now, and close it once we have some documentation (even links to resources) rolled into the Rubygems guides, but no objection to closing it either.
Hello,
The support for building Rust extensions added in #5175 is great! But we are lacking documentation on the proper way to use it. https://guides.rubygems.org/gems-with-extensions/ only talks about C extensions as well.
After trying to publish a gem with a Rust extension built with rutie, it seems like the ruby library has to require the
<gemname.so>
file for the integration to work. However, it is not clear how to build that shared library while developing the gem locally. Cargo builds usually end up in thetarget
directory, and it only builds thelib<gemname>.so
object (which incidentally ends up at/path/to/ruby/extensions/<platform>/release
. through the Cargo extension builder).Moreover, it seems like it expects us to check in the
Cargo.lock
file, whereas Cargo by default adds to to.gitignore
forlib
projects.Basically, I think we can benefit from docs on how to structure the project correctly to be installed and worked on locally. I haven't yet figured out a way to make both of those possible at the same time, so while I am willing to contribute docs, I would appreciate pointers!
I will abide by the code of conduct.
The text was updated successfully, but these errors were encountered: