Skip to content

Leave .bazelversion symlinks out of archive#22

Merged
Wyverald merged 1 commit intobazelbuild:mainfrom
mbland:fix-#21-bazelversion-symlinks
Jan 22, 2026
Merged

Leave .bazelversion symlinks out of archive#22
Wyverald merged 1 commit intobazelbuild:mainfrom
mbland:fix-#21-bazelversion-symlinks

Conversation

@mbland
Copy link
Contributor

@mbland mbland commented Jan 22, 2026

Fixes #21.

@Wyverald
Copy link
Member

Thanks, I might cut a new release soon (see #20) and will test this out.

@Wyverald Wyverald merged commit 95abac4 into bazelbuild:main Jan 22, 2026
11 checks passed
@mbland mbland deleted the fix-#21-bazelversion-symlinks branch January 22, 2026 21:40
@mbland
Copy link
Contributor Author

mbland commented Jan 23, 2026

@Wyverald I appreciate that! Any idea when that might be? Our last_green builds are dead until those symlinks are gone from the distribution tarball.

(And yesterday I learned that 'patch' can't delete files. Or, rather, there's a hacky way to do it, but I can't tell that it works with symlinks or that I can pass through the required flag.)

mbland added a commit to mbland/rules_scala that referenced this pull request Jan 26, 2026
Replaces the `rules_scala` prebuilt `protoc` toolchain everywhere except
in a few `test_dependency_versions.sh` test cases. Updates `README.md`
to recommend using the `protobuf` prebuilt `protoc` toolchain, and
refactors and adds test cases to `test_dependency_versions.sh`.

Note that legacy `WORKSPACE` builds continue to use the `rules_scala`
prebuilt `protoc` toolchain, since the `protobuf` implementation only
supports Bzlmod.

After removing `protobuf.patch` files, updating `MODULE.bazel{,.lock}`
files, and updating Maven dependencies, the most significant changes for
supporting `protobuf` v33.4 are:

- `protoc/private/protoc_toolchains.bzl`, `scala/toolchains_repo.bzl`:
  Moves `proto_lang_toolchain` from `@rules_scala_protoc_toolchains` to
  `@rules_scala_toolchains//scala_proto`. This can break users using
  `rules_proto` < 7.0.0 and `protobuf` < v28.2, but `README.md` contains
  a patch for such users.

- `protoc/private/toolchain_impl.bzl`:
  Applies changes from the final state of protocolbuffers/protobuf#19679
  and updates the prebuilt `protoc` toolchain resolution check and error
  message.

- `test_dependency_versions.sh`, `deps/test/MODULE.bazel.template`,
  `deps/test/protoc_toolchains.template`: Adds Bazel 9 and `protobuf`
  prebuilt `protoc` toolchain test cases. Updates `do_build_and_test` to
  support both toolchains. Extracts the `protoc_toolchains.template` to
  include it only in test cases using the `rules_scala` toolchain.

Other key components of this change include:

- `protoc/BUILD`:
  Aliases `@protobuf//bazel/toolchains:prefer_prebuilt_protoc` as
  `@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelrc`, `tools/bazel.rc.buildkite`:
  Adds `common --@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelci/presubmit.yml`, `.bcr/presubmit.yml`:
  Adds `9.x` to the `bcr_bazel` matrix . Also applies whitespace and
  quoting format changes to `.bazelci/presubmit.yml`.

Also contains these small, but important changes to fix continuous
integration breakages and `last_green` Bazel compatibility:

- `.github/workflows/release_prep.sh`:
  Excludes `.bazelversion` symlinks, since per
  bazelbuild/bazel-worker-api#21, these break Bazel as of
  bazelbuild/bazel@f942a70.

- `MODULE.bazel`, `scala/private/macros/workspace_compat.bzl`:
  Bumps `bazelbuild/bazel-worker-api` to v0.0.9 (though we need v0.0.10
  to fix `last_green` builds per bazelbuild/bazel-worker-api#22).

- `test/shell/test_runner.sh`, `test/shell/test_bzlmod_macros.sh`:
  Replaces `relative_path_to_parent` with `convert_msys2_path` for
  bazelbuild/continuous-integration#2445, bazelbuild/bazel#28406.

Other minor changes include:

- `MODULE.bazel`:
  Removes the `version` parameter from the `module` declaration. The
  Publish to BCR GitHub Actions workflow patches this parameter anyway.
  See:
  - https://bazel.build/external/faq#module-versioning-best-practices
  - https://github.com/bazel-contrib/publish-to-bcr/blob/v1.1.0/src/domain/create-entry.ts#L176-L216
  - https://bazelbuild.slack.com/archives/C014RARENH0/p1767892286188219

- Replaces `precompiled` with `prebuilt` in every reference to the
  prebuilt `protoc` toolchain.

- `scala/toolchains_repo.bzl`:
  Replaces `@@{rules_scala_repo}` references with plain `@rules_scala`
  references, allowing repo mapping to do its thing.

- `test_dependency_version.sh`:
  Skips non-prebuilt `protoc` prebuilt toolchain test cases from for
  macOS on continuous integration. This test suite was taking a
  disproportionately long time to run before adding the new test cases,
  which Linux builds will continue to cover.

A summary of these changes excluding `README.md`, `protobuf.patch`,
`MODULE.bazel{,.lock}` files, and Maven dependency updates:

```txt
$ git diff --stat HEAD^ ':!README.md' ':!**MODULE.bazel*' \
  ':!**protobuf.patch' ':!third_party/repositories/scala_*'

.bazelci/presubmit.yml                    |  66 ++++++++++++++++++++...
.bazelrc                                  |   9 +++++--
.bcr/presubmit.yml                        |   2 +-
.github/workflows/release_prep.sh         |   7 +++++-
WORKSPACE                                 |  15 ++++++-----
deps/test/protoc_toolchains.template      |  12 +++++++++
protoc/BUILD                              |   8 ++++++
protoc/private/protoc_integrity.bzl       |  10 ++++++++
protoc/private/protoc_toolchains.bzl      |  19 +++-----------
protoc/private/toolchain_impl.bzl         |  30 ++++++++++++++--------
protoc/toolchains.bzl                     |   2 +-
scala/extensions/protoc.bzl               |   8 +++---
scala/latest_deps.bzl                     |   8 +++---
scala/private/macros/workspace_compat.bzl |   6 ++---
scala/toolchains_repo.bzl                 |  37 ++++++++++++++++----...
scala_proto/scala_proto_toolchain.bzl     |   2 ++
scripts/create_repository.py              |   2 +-
scripts/update_protoc_integrity.py        |   6 +++--
test/shell/test_bzlmod_macros.sh          |   3 ++-
test/shell/test_runner.sh                 |  28 ++++++++++-----------
test_dependency_versions.sh               | 151 ++++++++++++++++++++...
test_version.sh                           |   2 --
tools/bazel.rc.buildkite                  |   9 +++++--
23 files changed, 288 insertions(+), 154 deletions(-)
```

---

The following Bazel Slack thread pointed out the apparent
incompatibility with the new Bazel 9.0.0 release:

- https://bazelbuild.slack.com/archives/CDCKJ2KFZ/p1768383285232129
- https://github.com/bazelbuild/bazel/releases/tag/9.0.0

This happened because Bazel 9 now sets
`--incompatible_enable_proto_toolchain_resolution` by default:

- https://bazel.build/reference/command-line-reference#flag--incompatible_enable_proto_toolchain_resolution

Since the `scala_proto` implementation depends on this flag, this broke
projects that didn't configure the `rules_scala` prebuilt `protoc`
toolchain. This change fixes that problem while ensuring seamless
compatibility with the `protobuf` v33.4 prebuilt protoc toolchain.

We will likely release v7.2.0 as soon as this change lands. After that,
we can bump other dependency versions in a patch level release,
including `bazel-worker-api` as soon as v0.0.10 appears.
@ted-xie
Copy link
Contributor

ted-xie commented Jan 26, 2026

Since #20 is still under discussion and last_green builds are broken now, I think we should prioritize a new release ahead of the protobuf discussion being finalized.

FYI rules_android is also affected by this bazelbuild/rules_android#452 (I suspect all modules that depend on bazel-worker-api are affected)

@Wyverald
Copy link
Member

Right, sorry that I forgot about this. I'll push a new release now.

mbland added a commit to mbland/rules_scala that referenced this pull request Jan 27, 2026
Replaces the `rules_scala` prebuilt `protoc` toolchain everywhere except
in a few `test_dependency_versions.sh` test cases. Updates `README.md`
to recommend using the `protobuf` prebuilt `protoc` toolchain, and
refactors and adds test cases to `test_dependency_versions.sh`.

Note that legacy `WORKSPACE` builds continue to use the `rules_scala`
prebuilt `protoc` toolchain, since the `protobuf` implementation only
supports Bzlmod.

After removing `protobuf.patch` files, updating `MODULE.bazel{,.lock}`
files, and updating Maven dependencies, the most significant changes for
supporting `protobuf` v33.4 are:

- `protoc/BUILD`, `protoc/private/protoc_toolchains.bzl`:
  Moves `proto_lang_toolchain` from `@rules_scala_protoc_toolchains` to
  `//protoc:scala_protoc_toolchain`. This can break users using
  `rules_proto` < 7.0.0 and `protobuf` < v28.2, but `README.md` contains
  a patch for such users.

- `protoc/private/toolchain_impl.bzl`:
  Applies changes from the final state of protocolbuffers/protobuf#19679
  and updates the prebuilt `protoc` toolchain resolution check and error
  message.

- `test_dependency_versions.sh`, `deps/test/MODULE.bazel.template`,
  `deps/test/protoc_toolchains.template`: Adds Bazel 9 and `protobuf`
  prebuilt `protoc` toolchain test cases. Updates `do_build_and_test` to
  support both toolchains. Extracts the `protoc_toolchains.template` to
  include it only in test cases using the `rules_scala` toolchain.

Other key components of this change include:

- `protoc/BUILD`:
  Aliases `@protobuf//bazel/toolchains:prefer_prebuilt_protoc` as
  `@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelrc`, `tools/bazel.rc.buildkite`:
  Adds `common --@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelci/presubmit.yml`, `.bcr/presubmit.yml`:
  Adds `9.x` to the `bcr_bazel` matrix . Also applies whitespace and
  quoting format changes to `.bazelci/presubmit.yml`.

Also contains these small, but important changes to fix continuous
integration breakages and `last_green` Bazel compatibility:

- `.github/workflows/release_prep.sh`:
  Excludes `.bazelversion` symlinks, since per
  bazelbuild/bazel-worker-api#21, these break Bazel as of
  bazelbuild/bazel@f942a70.

- `MODULE.bazel`, `scala/private/macros/workspace_compat.bzl`:
  Bumps `bazelbuild/bazel-worker-api` to v0.0.10 to fix `last_green`
  builds per bazelbuild/bazel-worker-api#22.

- `test/shell/test_runner.sh`, `test/shell/test_bzlmod_macros.sh`:
  Replaces `relative_path_to_parent` with `convert_msys2_path` for
  bazelbuild/continuous-integration#2445, bazelbuild/bazel#28406.
  It turns out @WojciechMazur patched this in bazel-contrib#1794, but this change
  supersedes the change from that pull request.

Other minor changes include:

- `MODULE.bazel`:
  Removes the `version` parameter from the `module` declaration. The
  Publish to BCR GitHub Actions workflow patches this parameter anyway.
  See:
  - https://bazel.build/external/faq#module-versioning-best-practices
  - https://github.com/bazel-contrib/publish-to-bcr/blob/v1.1.0/src/domain/create-entry.ts#L176-L216
  - https://bazelbuild.slack.com/archives/C014RARENH0/p1767892286188219

- Replaces `precompiled` with `prebuilt` in every reference to the
  prebuilt `protoc` toolchain.

- `scala/toolchains_repo.bzl`:
  Replaces `@@{rules_scala_repo}` references with plain `@rules_scala`
  references, allowing repo mapping to do its thing.

- `test_dependency_version.sh`:
  Skips non-prebuilt `protoc` prebuilt toolchain test cases from for
  macOS on continuous integration. This test suite was taking a
  disproportionately long time to run before adding the new test cases,
  which Linux builds will continue to cover.

A summary of these changes excluding `README.md`, `protobuf.patch`,
`MODULE.bazel{,.lock}` files, and Maven dependency updates:

```txt
$ git diff --stat HEAD^ ':!README.md' ':!**MODULE.bazel*' \
  ':!**protobuf.patch' ':!third_party/repositories/scala_*'

.bazelci/presubmit.yml                                   |  66 ++++++...
.bazelrc                                                 |   9 ++++--
.bcr/presubmit.yml                                       |   2 +-
.github/workflows/release_prep.sh                        |   7 ++++-
WORKSPACE                                                |  15 ++++++...
deps/test/protoc_toolchains.template                     |  12 ++++++++
protoc/BUILD                                             |  20 ++++++...
protoc/private/protoc_integrity.bzl                      |  10 +++++++
protoc/private/protoc_toolchains.bzl                     |  19 +++---...
protoc/private/toolchain_impl.bzl                        |  30 ++++++...
protoc/toolchains.bzl                                    |   2 +-
scala/extensions/protoc.bzl                              |   8 +++---
scala/latest_deps.bzl                                    |   8 ++----
scala/private/macros/test/MODULE.bzlmod_test             |   8 +++++-
scala/private/macros/test/MODULE.bzlmod_test_root_module |   8 +++++-
scala/private/macros/workspace_compat.bzl                |   6 ++--
scala/toolchains.bzl                                     |   5 +++-
scala/toolchains_repo.bzl                                |  37 ++++++...
scala_proto/scala_proto_toolchain.bzl                    |   2 ++
scripts/create_repository.py                             |   2 +-
scripts/update_protoc_integrity.py                       |   6 ++--
test/shell/test_bzlmod_macros.sh                         |  23 ++++--...
test/shell/test_runner.sh                                |  34 ++++++...
test_dependency_versions.sh                              | 151 ++++++...
test_version.sh                                          |   2 --
tools/bazel.rc.buildkite                                 |   9 ++++--
26 files changed, 328 insertions(+), 173 deletions(-)
```

---

In the following Bazel Slack thread, @rafikk pointed out the apparent
incompatibility with the new Bazel 9.0.0 release:

- https://bazelbuild.slack.com/archives/CDCKJ2KFZ/p1768383285232129
- https://github.com/bazelbuild/bazel/releases/tag/9.0.0

This happened because Bazel 9 now sets
`--incompatible_enable_proto_toolchain_resolution` by default:

- https://bazel.build/reference/command-line-reference#flag--incompatible_enable_proto_toolchain_resolution

Since the `scala_proto` implementation depends on this flag, this broke
projects that didn't configure the `rules_scala` prebuilt `protoc`
toolchain. This change fixes that problem while ensuring seamless
compatibility with the `protobuf` v33.4 prebuilt protoc toolchain.

We will likely release v7.2.0 as soon as this change lands. After that,
we can bump other dependency versions in a patch level release.
mbland added a commit to mbland/rules_scala that referenced this pull request Jan 27, 2026
Replaces the `rules_scala` prebuilt `protoc` toolchain everywhere except
in a few `test_dependency_versions.sh` test cases. Updates `README.md`
to recommend using the `protobuf` prebuilt `protoc` toolchain, and
refactors and adds test cases to `test_dependency_versions.sh`.

Note that legacy `WORKSPACE` builds continue to use the `rules_scala`
prebuilt `protoc` toolchain, since the `protobuf` implementation only
supports Bzlmod.

After removing `protobuf.patch` files, updating `MODULE.bazel{,.lock}`
files, and updating Maven dependencies, the most significant changes for
supporting `protobuf` v33.4 are:

- `protoc/BUILD`, `protoc/private/protoc_toolchains.bzl`:
  Moves `proto_lang_toolchain` from `@rules_scala_protoc_toolchains` to
  `//protoc:scala_protoc_toolchain`. This can break users using
  `rules_proto` < 7.0.0 and `protobuf` < v28.2, but `README.md` contains
  a patch for such users.

- `protoc/private/toolchain_impl.bzl`:
  Applies changes from the final state of protocolbuffers/protobuf#19679
  and updates the prebuilt `protoc` toolchain resolution check and error
  message.

- `test_dependency_versions.sh`, `deps/test/MODULE.bazel.template`,
  `deps/test/protoc_toolchains.template`: Adds Bazel 9 and `protobuf`
  prebuilt `protoc` toolchain test cases. Updates `do_build_and_test` to
  support both toolchains. Extracts the `protoc_toolchains.template` to
  include it only in test cases using the `rules_scala` toolchain.

Other key components of this change include:

- `protoc/BUILD`:
  Aliases `@protobuf//bazel/toolchains:prefer_prebuilt_protoc` as
  `@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelrc`, `tools/bazel.rc.buildkite`:
  Adds `common --@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelci/presubmit.yml`, `.bcr/presubmit.yml`:
  Adds `9.x` to the `bcr_bazel` matrix . Also applies whitespace and
  quoting format changes to `.bazelci/presubmit.yml`.

Also contains these small, but important changes to fix continuous
integration breakages and `last_green` Bazel compatibility:

- `.github/workflows/release_prep.sh`:
  Excludes `.bazelversion` symlinks, since per
  bazelbuild/bazel-worker-api#21, these break Bazel as of
  bazelbuild/bazel@f942a70.

- `MODULE.bazel`, `scala/private/macros/workspace_compat.bzl`:
  Bumps `bazelbuild/bazel-worker-api` to v0.0.10 to fix `last_green`
  builds per bazelbuild/bazel-worker-api#22.

- `test/shell/test_runner.sh`, `test/shell/test_bzlmod_macros.sh`:
  Replaces `relative_path_to_parent` with `convert_msys2_path` for
  bazelbuild/continuous-integration#2445, bazelbuild/bazel#28406.
  It turns out @WojciechMazur patched this in bazel-contrib#1794, but this change
  supersedes the change from that pull request.

Other minor changes include:

- `MODULE.bazel`:
  Removes the `version` parameter from the `module` declaration. The
  Publish to BCR GitHub Actions workflow patches this parameter anyway.
  See:
  - https://bazel.build/external/faq#module-versioning-best-practices
  - https://github.com/bazel-contrib/publish-to-bcr/blob/v1.1.0/src/domain/create-entry.ts#L176-L216
  - https://bazelbuild.slack.com/archives/C014RARENH0/p1767892286188219

- Replaces `precompiled` with `prebuilt` in every reference to the
  prebuilt `protoc` toolchain.

- `scala/toolchains_repo.bzl`:
  Replaces `@@{rules_scala_repo}` references with plain `@rules_scala`
  references, allowing repo mapping to do its thing.

- `test_dependency_version.sh`:
  Skips non-prebuilt `protoc` prebuilt toolchain test cases from for
  macOS on continuous integration. This test suite was taking a
  disproportionately long time to run before adding the new test cases,
  which Linux builds will continue to cover.

A summary of these changes excluding `README.md`, `protobuf.patch`,
`MODULE.bazel{,.lock}` files, and Maven dependency updates:

```txt
$ git diff --stat HEAD^ ':!README.md' ':!**MODULE.bazel*' \
  ':!**protobuf.patch' ':!third_party/repositories/scala_*'

.bazelci/presubmit.yml                                   |  66 ++++++...
.bazelrc                                                 |   9 ++++--
.bcr/presubmit.yml                                       |   2 +-
.github/workflows/release_prep.sh                        |   7 ++++-
WORKSPACE                                                |  15 ++++++...
deps/test/protoc_toolchains.template                     |  12 ++++++++
protoc/BUILD                                             |  20 ++++++...
protoc/private/protoc_integrity.bzl                      |  10 +++++++
protoc/private/protoc_toolchains.bzl                     |  19 +++---...
protoc/private/toolchain_impl.bzl                        |  30 ++++++...
protoc/toolchains.bzl                                    |   2 +-
scala/extensions/protoc.bzl                              |   8 +++---
scala/latest_deps.bzl                                    |   8 ++----
scala/private/macros/test/MODULE.bzlmod_test             |   8 +++++-
scala/private/macros/test/MODULE.bzlmod_test_root_module |   8 +++++-
scala/private/macros/workspace_compat.bzl                |   6 ++--
scala/toolchains.bzl                                     |   5 +++-
scala/toolchains_repo.bzl                                |  26 ++++++...
scala_proto/scala_proto_toolchain.bzl                    |   2 ++
scripts/create_repository.py                             |   2 +-
scripts/update_protoc_integrity.py                       |   6 ++--
test/shell/test_bzlmod_macros.sh                         |  23 ++++--...
test/shell/test_runner.sh                                |  34 ++++++...
test_dependency_versions.sh                              | 151 ++++++...
test_version.sh                                          |   2 --
tools/bazel.rc.buildkite                                 |   9 ++++--
26 files changed, 317 insertions(+), 173 deletions(-)
```

---

In the following Bazel Slack thread, @rafikk pointed out the apparent
incompatibility with the new Bazel 9.0.0 release:

- https://bazelbuild.slack.com/archives/CDCKJ2KFZ/p1768383285232129
- https://github.com/bazelbuild/bazel/releases/tag/9.0.0

This happened because Bazel 9 now sets
`--incompatible_enable_proto_toolchain_resolution` by default:

- https://bazel.build/reference/command-line-reference#flag--incompatible_enable_proto_toolchain_resolution

Since the `scala_proto` implementation depends on this flag, this broke
projects that didn't configure the `rules_scala` prebuilt `protoc`
toolchain. This change fixes that problem while ensuring seamless
compatibility with the `protobuf` v33.4 prebuilt protoc toolchain.

We will likely release v7.2.0 as soon as this change lands. After that,
we can bump other dependency versions in a patch level release.

---

Also, Bazel 10.0.0-pre.20251208.3 selects the prebuilt `protoc`
toolchain, and 10.0.0-pre.20251217.3 doesn't. Investigating.
mbland added a commit to bazel-contrib/rules_scala that referenced this pull request Jan 29, 2026
Replaces the `rules_scala` prebuilt `protoc` toolchain everywhere except
in a few `test_dependency_versions.sh` test cases. Updates `README.md`
to recommend using the `protobuf` prebuilt `protoc` toolchain, and
refactors and adds test cases to `test_dependency_versions.sh`.

Note that legacy `WORKSPACE` builds continue to use the `rules_scala`
prebuilt `protoc` toolchain, since the `protobuf` implementation only
supports Bzlmod.

After removing `protobuf.patch` files, updating `MODULE.bazel{,.lock}`
files, and updating Maven dependencies, the most significant changes for
supporting `protobuf` v33.4 are:

- `protoc/BUILD`, `protoc/private/protoc_toolchains.bzl`:
  Moves `proto_lang_toolchain` from `@rules_scala_protoc_toolchains` to
  `//protoc:scala_protoc_toolchain`. This can break users using
  `rules_proto` < 7.0.0 and `protobuf` < v28.2, but `README.md` contains
  a patch for such users.

- `protoc/private/toolchain_impl.bzl`:
  Applies changes from the final state of protocolbuffers/protobuf#19679
  and updates the prebuilt `protoc` toolchain resolution check and error
  message.

- `test_dependency_versions.sh`, `deps/test/MODULE.bazel.template`,
  `deps/test/protoc_toolchains.template`: Adds Bazel 9 and `protobuf`
  prebuilt `protoc` toolchain test cases. Updates `do_build_and_test` to
  support both toolchains. Extracts the `protoc_toolchains.template` to
  include it only in test cases using the `rules_scala` toolchain.

Other key components of this change include:

- `protoc/BUILD`:
  Aliases `@protobuf//bazel/toolchains:prefer_prebuilt_protoc` as
  `@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelrc`, `tools/bazel.rc.buildkite`:
  Adds `common --@rules_scala//protoc:prefer_prebuilt_protoc`.

- `.bazelci/presubmit.yml`, `.bcr/presubmit.yml`:
  Adds `9.x` to the `bcr_bazel` matrix . Also applies whitespace and
  quoting format changes to `.bazelci/presubmit.yml`.

Also contains these small, but important changes to fix continuous
integration breakages and `last_green` Bazel compatibility:

- `.github/workflows/release_prep.sh`:
  Excludes `.bazelversion` symlinks, since per
  bazelbuild/bazel-worker-api#21, these break Bazel as of
  bazelbuild/bazel@f942a70.

- `MODULE.bazel`, `scala/private/macros/workspace_compat.bzl`:
  Bumps `bazelbuild/bazel-worker-api` to v0.0.10 to fix `last_green`
  builds per bazelbuild/bazel-worker-api#22.

- `test/shell/test_runner.sh`, `test/shell/test_bzlmod_macros.sh`:
  Replaces `relative_path_to_parent` with `convert_msys2_path` for
  bazelbuild/continuous-integration#2445, bazelbuild/bazel#28406.
  It turns out @WojciechMazur patched this in #1794, but this change
  supersedes the change from that pull request.

Other minor changes include:

- `MODULE.bazel`:
  Removes the `version` parameter from the `module` declaration. The
  Publish to BCR GitHub Actions workflow patches this parameter anyway.
  See:
  - https://bazel.build/external/faq#module-versioning-best-practices
  - https://github.com/bazel-contrib/publish-to-bcr/blob/v1.1.0/src/domain/create-entry.ts#L176-L216
  - https://bazelbuild.slack.com/archives/C014RARENH0/p1767892286188219

- Replaces `precompiled` with `prebuilt` in every reference to the
  prebuilt `protoc` toolchain.

- `scala/toolchains_repo.bzl`:
  Replaces `@@{rules_scala_repo}` references with plain `@rules_scala`
  references, allowing repo mapping to do its thing.

- `test_dependency_version.sh`:
  Skips non-prebuilt `protoc` prebuilt toolchain test cases from for
  macOS on continuous integration. This test suite was taking a
  disproportionately long time to run before adding the new test cases,
  which Linux builds will continue to cover.

A summary of these changes excluding `README.md`, `protobuf.patch`,
`MODULE.bazel{,.lock}` files, and Maven dependency updates:

```txt
$ git diff --stat HEAD^ ':!README.md' ':!**MODULE.bazel*' \
  ':!**protobuf.patch' ':!third_party/repositories/scala_*'

.bazelci/presubmit.yml                                   |  66 ++++++...
.bazelrc                                                 |   9 ++++--
.bcr/presubmit.yml                                       |   2 +-
.github/workflows/release_prep.sh                        |   7 ++++-
WORKSPACE                                                |  15 ++++++...
deps/test/protoc_toolchains.template                     |  12 ++++++++
protoc/BUILD                                             |  20 ++++++...
protoc/private/protoc_integrity.bzl                      |  10 +++++++
protoc/private/protoc_toolchains.bzl                     |  19 +++---...
protoc/private/toolchain_impl.bzl                        |  30 ++++++...
protoc/toolchains.bzl                                    |   2 +-
scala/extensions/protoc.bzl                              |   8 +++---
scala/latest_deps.bzl                                    |   8 ++----
scala/private/macros/test/MODULE.bzlmod_test             |   8 +++++-
scala/private/macros/test/MODULE.bzlmod_test_root_module |   8 +++++-
scala/private/macros/workspace_compat.bzl                |   6 ++--
scala/toolchains.bzl                                     |   5 +++-
scala/toolchains_repo.bzl                                |  26 ++++++...
scala_proto/scala_proto_toolchain.bzl                    |   2 ++
scripts/create_repository.py                             |   2 +-
scripts/update_protoc_integrity.py                       |   6 ++--
test/shell/test_bzlmod_macros.sh                         |  23 ++++--...
test/shell/test_runner.sh                                |  34 ++++++...
test_dependency_versions.sh                              | 151 ++++++...
test_version.sh                                          |   2 --
tools/bazel.rc.buildkite                                 |   9 ++++--
26 files changed, 317 insertions(+), 173 deletions(-)
```

---

In the following Bazel Slack thread, @rafikk pointed out the apparent
incompatibility with the new Bazel 9.0.0 release:

- https://bazelbuild.slack.com/archives/CDCKJ2KFZ/p1768383285232129
- https://github.com/bazelbuild/bazel/releases/tag/9.0.0

This happened because Bazel 9 now sets
`--incompatible_enable_proto_toolchain_resolution` by default:

- https://bazel.build/reference/command-line-reference#flag--incompatible_enable_proto_toolchain_resolution

Since the `scala_proto` implementation depends on this flag, this broke
projects that didn't configure the `rules_scala` prebuilt `protoc`
toolchain. This change fixes that problem while ensuring seamless
compatibility with the `protobuf` v33.4 prebuilt protoc toolchain.

---

Also, Bazel 10.0.0-pre.20251208.3 selects the prebuilt `protoc`
toolchain, and 10.0.0-pre.20251217.3 doesn't. See:

- protocolbuffers/protobuf#25561
keith added a commit to buildbuddy-io/buildbuddy that referenced this pull request Mar 3, 2026
This is required to test with bazel @ HEAD by pulling in this change:

bazelbuild/bazel-worker-api#22

Full diff has nothing else risky:

bazelbuild/bazel-worker-api@v0.0.9...v0.0.10
keith added a commit to buildbuddy-io/buildbuddy that referenced this pull request Mar 3, 2026
This is required to test with bazel @ HEAD by pulling in this change:

bazelbuild/bazel-worker-api#22

Full diff has nothing else risky:

bazelbuild/bazel-worker-api@v0.0.9...v0.0.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.bazelversion symlinks in tarballs incompatible with bazelbuild/bazel@f942a70

3 participants