-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating from bazelruby/rules_ruby for gems with native extensions #186
Comments
I haven't seen an example of gems building native extensions yet, so you might be the first to encounter this. It's worth asking in the #ruby channel on Bazel Slack though. If you have an example you could share, I can help figure out what needs to be changed in the ruleset to support your case. |
I will take a look at it, but please share if you have a simpler example I can experiment with (protobuf is quite large). It might be something w/o the Bazel bits, I just need to make sure I understand how to build platform-specific versions. |
|
@JasonLunn I've started experiment with native extensions in https://github.com/bazel-contrib/rules_ruby/tree/ext and so far I had no issues compiling the gem using |
Are are you invoking
Independent of addressing the nits above, |
I use
Hmm, I will look into it. I assumed that
So what's the workflow with Bazel then?
|
Our CI and release systems are bazel-centric to provide a single point of entry for all the programming languages that Protocol Buffers supports, even though we also support end users that build using language-specific tools like |
That makes sense, I'm merely trying to distill the complex protobuf library into a small Ruby gem with a set of Bazel targets I need the ruleset to support. My initial thought was that creating a gem with a native extension would fail, but it seems to work fine so far. So now I am wondering what targets I need to create to have them failing. I can add |
I think that would fix the issue for C-based rubies. A |
Follow up to #180
How do gem authors use
bazel-contrib/rules_ruby
to reference parts of the Ruby environment needed to construct native extensions?For example, if building a native extension in C for MRI, under
bazelruby/rules_ruby
I might include"@rules_ruby//ruby/runtime:headers"
in thedeps
of thecc_library
to exposeruby.h
. Similarly, for an native extension targeting JRuby, I might include"@rules_ruby//ruby/runtime:jars"
in thedeps
of thejava_library
.The text was updated successfully, but these errors were encountered: