Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.0
9.0.0
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
mode:
- bzlmod
- WORKSPACE
exclude:
# TruffleRuby doesn't work on Windows.
- os: windows-latest
Expand All @@ -61,8 +58,7 @@ jobs:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.18.0
with:
# Move autoload_externally to .bazelrc once Bazel 6 support is dropped.
bazelrc: common --announce_rc --color=yes --incompatible_autoload_externally= ${{ matrix.mode == 'WORKSPACE' && '--enable_workspace' || '' }}
bazelrc: common --announce_rc --color=yes
module-root: examples/gem
# Workaround for long path issues: https://github.com/jruby/jruby/issues/3995.
output-base: ${{ matrix.os == 'windows-latest' && 'D:/b' || '' }}
Expand Down Expand Up @@ -160,8 +156,7 @@ jobs:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.18.0
with:
# Move autoload_externally to .bazelrc once Bazel 6 support is dropped.
bazelrc: common --announce_rc --color=yes --incompatible_autoload_externally=
bazelrc: common --announce_rc --color=yes
module-root: examples/deep_gem
# Workaround for long path issues: https://github.com/jruby/jruby/issues/3995.
output-base: ${{ matrix.os == 'windows-latest' && 'D:/b' || '' }}
Expand Down Expand Up @@ -193,8 +188,7 @@ jobs:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.18.0
with:
# Move autoload_externally to .bazelrc once Bazel 6 support is dropped.
bazelrc: common --announce_rc --incompatible_autoload_externally=
bazelrc: common --announce_rc
module-root: examples/rails
repository-cache: true
- run: echo ${{ matrix.ruby }} > .ruby-version
Expand Down Expand Up @@ -225,8 +219,7 @@ jobs:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.15.0
with:
# Move autoload_externally to .bazelrc once Bazel 6 support is dropped.
bazelrc: common --announce_rc --incompatible_autoload_externally=
bazelrc: common --announce_rc
module-root: examples/proto
repository-cache: true
- run: echo ${{ matrix.ruby }} > .ruby-version
Expand Down
36 changes: 2 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This repository hosts [Ruby][1] language ruleset for [Bazel][2].

The ruleset is known to work with:

- Bazel 8 using WORKSPACE and Bzlmod _(tested on CI)_.
- Bazel 9 using Bzlmod _(tested on CI)_.
- Bazel 8 using WORKSPACE and Bzlmod _(no longer tested on CI)_.
- Bazel 7 using WORKSPACE and Bzlmod _(no longer tested on CI)_.

## Getting Started
Expand All @@ -15,39 +16,6 @@ The ruleset is known to work with:

The fastest way to try this in an empty project is to click the green "Use this template" button on https://github.com/bazel-starters/ruby.

### WORKSPACE

1. Install the ruleset following WORKSPACE instructions on the [latest release][13].
2. Download and install Ruby:

```bazel
# WORKSPACE
load("@rules_ruby//ruby:deps.bzl", "rb_register_toolchains")

rb_register_toolchains(
version = "3.3.9",
# alternatively, load version from .ruby-version file
# version_file = "//:.ruby-version",
)
```

3. _(Optional)_ Download and install Bundler dependencies:

```bazel
# WORKSPACE
load("@rules_ruby//ruby:deps.bzl", "rb_bundle_fetch")

rb_bundle_fetch(
name = "bundle",
gemfile = "//:Gemfile",
gemfile_lock = "//:Gemfile.lock",
)
```

4. Start defining your library, binary and test targets in `BUILD` files.

### Bzlmod

1. Install ruleset following Bzlmod instructions on the [latest release][13].
2. Download and install Ruby:

Expand Down
Empty file removed WORKSPACE
Empty file.
6 changes: 2 additions & 4 deletions docs/repository_rules.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions examples/deep_gem/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
startup --windows_enable_symlinks
build --enable_runfiles

# Do not autoload language-specific rules removed in Bazel core.
# https://github.com/bazelbuild/bazel/issues/23043
common --incompatible_autoload_externally=

# Allow to run Bazel without pre-installed JDK.
# Docs: https://bazel.build/reference/command-line-reference#flag--java_runtime_version
build --java_runtime_version=remotejdk_21 --tool_java_runtime_version=remotejdk_21
Expand Down
4 changes: 4 additions & 0 deletions examples/gem/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
startup --windows_enable_symlinks
build --enable_runfiles

# Do not autoload language-specific rules removed in Bazel core.
# https://github.com/bazelbuild/bazel/issues/23043
common --incompatible_autoload_externally=

# Allow to run Bazel without pre-installed JDK.
# Docs: https://bazel.build/reference/command-line-reference#flag--java_runtime_version
build --java_runtime_version=remotejdk_21 --tool_java_runtime_version=remotejdk_21
Expand Down
81 changes: 0 additions & 81 deletions examples/gem/WORKSPACE

This file was deleted.

2 changes: 0 additions & 2 deletions examples/gem/WORKSPACE.bzlmod

This file was deleted.

6 changes: 5 additions & 1 deletion examples/proto/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc
common --repo_env="JAVA_HOME=../bazel_tools/jdk"
common --repo_env="JAVA_HOME=../bazel_tools/jdk"

# Do not autoload language-specific rules removed in Bazel core.
# https://github.com/bazelbuild/bazel/issues/23043
common --incompatible_autoload_externally=
7 changes: 4 additions & 3 deletions examples/rails/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ build --incompatible_strict_action_env=true
# Don't allow empty glob patterns by default
build --incompatible_disallow_empty_glob

# Enable bzlmod
common --enable_bzlmod

# Download the JDK to run Bazel
build --java_runtime_version=remotejdk_11

# Do not autoload language-specific rules removed in Bazel core.
# https://github.com/bazelbuild/bazel/issues/23043
common --incompatible_autoload_externally=
Loading