-
Notifications
You must be signed in to change notification settings - Fork 354
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
wanted: rules_ruby #1083
Comments
As I announced on Bazel slack in |
Honestly, I think it might be helpful to get the bazelruby rules up to date and compare. The focus when we wrote them was on staying as close as possible to a typical ruby developer flow. I don't know if we succeeded, but let's look at an example: https://github.com/p0deje/rules_ruby/blob/main/examples/gem/spec/BUILD Versus https://github.com/bazelruby/rules_ruby/blob/master/examples/simple_script/BUILD.bazel#L53
The idea is that we don't want to create a BUILD file in each folder, and it's probably not desirable to have to have a target per test file. So my focus is on productivity and having Bazel co-exist with rhe ruby ecosystem, and definitely avoid requiring a BUILD file in every subdirectory of a spec folder or lib folder. I want to make sure the examples from this folder in rhe bazelruby/rules_ruby still works with new rules. Otherwise porting projects would be a nightmare. I'll try to find the time to get the old rules up to the latest versions of everything... |
The ruleset supports both. You can create a single test target that will run all the specs and pass extra arguments to it like this: rb_test(
name = "spec",
srcs = glob(["spec/**/*.rb"],
main = "@bundle//:bin/rspec",
args = ["--format", "progress"],
deps = ["@bundle"],
) bazel test --test_arg="--fail-fast" :spec This is more common in Ruby projects. However, you can also create a tree of build files nested in directories which is more common in Bazel with a target per each spec file. The benefits of this approach are:
I made a small video back for Selenium showing why per-test targets are useful - https://youtu.be/lqqXHEBvU0Y |
Module location
Various forks
Link to bzlmod issue in the module's repository
No response
Any other context to provide?
protobuf is in the registry, but cannot be updated to a more recent release due to a newly introduced dependency on rules_ruby, see protocolbuffers/protobuf#14569
Unfortunately rules_ruby has gone through a series of forks, and I don't think any of them are canonical.
The Rules Authors SIG has some funding now, so my sense is that we need to jump in front of this situation, determine which of these is the "canonical" and then put some effort into converging some of them again.
Fund our work
The text was updated successfully, but these errors were encountered: