-
Notifications
You must be signed in to change notification settings - Fork 10
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 #180
Comments
|
In 0.16.0 you can now use: select({
"@ruby//engine:jruby": ["gem_java.jar"],
"@platforms//os:osx": ["gem_c.bundle"],
"//conditions:default": ["gem_c.so"],
}), |
|
The main issue with calling To cut it short, no rules should ever call to toolchains during WORKSPACE/MODULE.bazel loading. If you check in At this point you have an option of using |
I'm attempting to migrate from the similarly named but no-longer supported https://github.com/bazelruby/rules_ruby but running into trouble in a couple of places.
1. Understanding how to detect what Ruby platform is active from Bazel rules.
Today, I use
select()
to find out if I'm building for a JRuby or a CRuby, and build the native portion of the gem extension that is appropriate:This allows me to build the Jar if I'm on JRuby on any OS, compile the native code as a OSX bundle if I'm on macOS, and otherwise compile the native extension as normal.
This
rules_ruby
doesn't exposeruntime
the same way as the one I'm migrating from, so I'm curious how to achieve a similar outcome.2. Gemfile.lock required?
We don't check in a
Gemfile.lock
into our repo, butrb_bundle_fetch()
requires it. We're used to theGemfile.lock
being created on the build host for the specific platform and architecture we're building for at the time. Is there a way to generate theGemfile.lock
using a bazel rule rather than expecting it to already exist?The text was updated successfully, but these errors were encountered: