bazelruby / rules_ruby

Formerly canonical rules for ruby, that are about 2-3 years behind current Bazel. If they work for you great, but if not — please try the new rules ruby by Alex Radionov: https://github.com/bazel-contrib/rules_ruby
Apache License 2.0
99 stars 37 forks source link

Add ruby versioning support #137

Closed mkruskal-google closed 2 years ago

mkruskal-google commented 2 years ago

This adds more useable versioning support to rules_ruby.

Downstream projects should call rules_ruby_register_toolchains which will setup the allowed ruby toolchains for each version, including the system installation. The --@rules_ruby//ruby:version=<version> flag can be passed to switch between these dynamically, with the default being whatever is currently installed on the system.

ruby_binary will use the interpreter from whichever toolchain was resolved. Downstream targets can access information about the selected installation via the following targets:

kigster commented 1 year ago

Why did you close this?

kigster commented 1 year ago

In any case there are two separate PRs here:

  1. First one deals with the global rename bazelruby_rules_ruby to rules_ruby
  2. Second modified the toolchain

Please split them up and resubmit.

mkruskal-google commented 1 year ago

This was never meant to be opened in the first place. I meant to send this out to our fork (https://github.com/protocolbuffers/rules_ruby), where it is two separate PRs. We might try to upstream these changes in the future, but have no immediate plans to