Commit 3cd43f0
committed
Enable Bzlmod
All but finishes bazel-contrib#1482, save for publication of the first `rules_scala`
release to the Bazel Central Registry. Closes bazel-contrib#1625.
The module extensions and underlying helper macros comprise the most
significant part of the change. The extensions provide a thin layer
over the existing `WORKSPACE` API. The `scala/private/macros/bzlmod.bzl`
docstring explains the common pattern employed throughout.
- `scala/extensions/config.bzl`: invokes `scala_config()`
- `scala/extensions/deps.bzl`: invokes `scala_toolchains()`
- `scala/extensions/protoc.bzl`: invokes `scala_protoc_toolchains()`
- `scala/private/extensions/dev_deps.bzl`: internal testing dependencies
- `scala/private/macros/bzlmod.bzl`: module extension helper macros
Existing tests thoroughly validate `config.bzl`, `deps.bzl`,
`dev_deps.bzl`, and `protoc.bzl`. `test/shell/test_bzlmod_macros.sh`
tests the helpers from `scala/private/macros/bzlmod.bzl` using the new
test files from `scala/private/macros/test/...`.
Most of the new files are essentially boilerplate:
- Adds `MODULE.bazel` files mirroring existing `WORKSPACE`
configurations and copies of the `protobuf` toolchainization patch to
the main repo and every nested repo.
- Adds empty `WORKSPACE.bzlmod` files to ensure that Bzlmod won't
evaluate the `WORKSPACE` files.
These changes update CI and the release workflow:
- Sets `--noenable_workspace` in `.bazelrc` and
`tools/bazel.rc.buildkite`.
- Reenables the `last_green` Bazel build in `.bazelci/presubmit.yml`.
- Adds `.github/workflows/publish-to-bcr.yml` and `.bcr/*` for
publishing to the Bazel Central Registry.
`.github/workflows/release.yml` invokes this new workflow after
publishing a successful release to GitHub. Based on
aspect-build/rules_lint#498 and aspect-build/rules_lint#501.
All other changes:
- Adds `.bazelignore` to work around bazelbuild/bazel#22208.
- Adds `assert_matches` to `test/shell/test_helper.sh` for use in
`test/shell/test_bzlmod_macros.sh`.
- `test/shell/test_bzlmod_macros.sh` introduces a mechanism for
automatically finding and skipping tests, documented in the comment at
the bottom of the file.
- Adds `bazel mod tidy` checks to `test_lint.sh` and `test_version.sh`.
- Adds `bazel clean --expunge_async` to tests that create temporary
repos.
- Adds the `test_cleanup.sh` script to reclaim disk space.
---
This change enables Bazel 7 and 8 users to migrate their `rules_scala`
dependency from `WORKSPACE` to `MODULE.bazel` whenever they're ready. It
also ensures that new changes are compatible with the `last_green` build
of Bazel, and enables publishing releases to the Bazel Central Registry.
Per the (prereleased) "Publish to BCR" workflow setup instructions
linked from `.bcr/README.md`, we need to create:
- a fork of `bazelbuild/bazel-central-registry` (which I've proactively
referred to as `simuons/bazel-central-registry`)
- a personal access token with "workflow" and "repo" permissions, saved
as `PUBLISH_TOKEN` in the BCR fork (under "Settings > Secrets and
variables > Actions")
Once these items are ready, we can push a release tag to publish the
first `rules_scala` Bazel module to https://registry.bazel.build/.
At that point, we can close bazel-contrib#1482.1 parent 0aab4bc commit 3cd43f0
File tree
86 files changed
+3909
-49
lines changed- .bazelci
- .bcr
- .github/workflows
- docs
- dt_patches
- compiler_sources
- test_dt_patches_user_srcjar
- test_dt_patches
- examples
- crossbuild
- overridden_artifacts
- scala3
- semanticdb
- testing
- multi_frameworks_toolchain
- scalatest_repositories
- specs2_junit_repositories
- scala
- extensions
- private
- extensions
- macros
- test
- test_cross_build
- test_version
- test
- proto_cross_repo_boundary/repo
- shell
- third_party/test
- example_external_workspace
- new_local_repo
- proto
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
86 files changed
+3909
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
| 33 | + | |
36 | 34 | | |
37 | | - | |
| 35 | + | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
| |||
0 commit comments