This repository hosts Ruby language ruleset for Bazel.
The ruleset is known to work with Bazel 5 and 6.
Pending the first release.
- See repository rules for the documentation of
WORKSPACE
rules. - See rules for the documentation of
BUILD
rules.
The following toolchains are known to work and tested on CI.
Ruby | Linux | macOS | Windows |
---|---|---|---|
MRI 3.2 | 🟩 | 🟩 | 🟩 |
MRI 3.1 | 🟩 | 🟩 | 🟩 |
MRI 3.0 | 🟩 | 🟩 | 🟩 |
JRuby 9.4 | 🟩 | 🟩 | 🟩 |
TruffleRuby 23.0 | 🟩 | 🟩 | 🟥 |
The following toolchains were previously known to work but no longer tested on CI.
Ruby | Linux | macOS | Windows |
---|---|---|---|
MRI 2.7 | 🟩 | 🟩 | 🟩 |
JRuby 9.3 | 🟩 | 🟩 | 🟩 |
TruffleRuby 22.0 | 🟩 | 🟩 | 🟥 |
On Linux and macOS, ruby-build is used to install MRI from sources. Keep in mind, that it takes some time for compilation to complete.
On Windows, RubyInstaller is used to install MRI.
On all operating systems, JRuby is downloaded manually. It uses Bazel runtime Java toolchain as JDK.
On Linux and macOS, ruby-build is used to install TruffleRuby. Windows is not supported.
On Linux and macOS, you can potentially use any Ruby distribution that is supported by ruby-build. However, some are known not to work or work only partially (e.g. mRuby has no bundler support).
- JRuby/TruffleRuby might need
HOME
variable exposed. Seeeamples/gem/.bazelrc
to learn how to do that. This is to be fixed injruby/jruby#5661
andoracle/truffleruby#2784
. - JRuby might fail with
Errno::EACCES: Permission denied - NUL
error on Windows. You need to configure JDK to allow proper access. Seeexamples/gem/.bazelrc
to learn how to do that. This is described injruby/jruby#7182
. - RuboCop < 1.55 crashes with
LoadError
on Windows. This is fixed inrubocop/rubocop#12062
. - REPL doesn't work when used with
bazel test
. To work it around, use a debugger with remote client support such asruby/debug
. Seeexamples/gem/.bazelrc
to learn how to do that.