Skip to content

Commit d5b6a9f

Browse files
Add news announcement for Bazel Starlark flag migration.
PiperOrigin-RevId: 883347678
1 parent 5f3c644 commit d5b6a9f

File tree

4 files changed

+87
-3
lines changed

4 files changed

+87
-3
lines changed

content/news/2025-09-19.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,43 @@ This release will remove the following public runtime APIs.
223223

224224
**Replacement:** Use `!required && fieldType == GPBFieldTypeSingle` instead.
225225

226-
## Other Changes {#other-changes}
226+
## Changes in Bazel {#bazel}
227227

228-
The following are additional breaking changes.
228+
### Migration of Proto Flags to Starlark {#bazel-starlark-flags}
229+
230+
`--proto_toolchain_for*` and `--proto_compiler` are no longer read by Proto
231+
rules. These toolchain-related flags are deprecated and will be removed in the
232+
future. Switching to the equivalent Starlark flags is a short-term fix:
233+
234+
* `--@protobuf//bazel/flags/cc:proto_toolchain_for_cc`
235+
* `--@protobuf//bazel/flags/java:proto_toolchain_for_java`
236+
* `--@protobuf//bazel/flags/java:proto_toolchain_for_javalite`
237+
* `--@protobuf//bazel/flags:proto_compiler`
238+
239+
The longer-term fix is to enable
240+
`--incompatible_enable_proto_toolchain_resolution` (which is the default in
241+
Bazel 9 anyway) and to register toolchains using the normal platforms-related
242+
mechanisms (`register_toolchain()` in `MODULE.bazel` or `WORKSPACE`, or
243+
`--extra_toolchains`).
244+
245+
All other Bazel Proto flags have also been migrated to Starlark, and the native
246+
flags will be deprecated with the next Bazel release. Use the following Starlark
247+
flags to avoid future breakages:
229248

230-
### Bazel: Remove deprecated ProtoInfo.transitive_imports {#bazel-transitive-imports}
249+
* `--@protobuf//bazel/flags:strict_proto_deps`
250+
* `--@protobuf//bazel/flags:strict_public_imports`
251+
* `--@protobuf//bazel/flags:experimental_proto_descriptor_sets_include_source_info`
252+
* `--@protobuf//bazel/flags/cc:cc_proto_library_header_suffixes`
253+
* `--@protobuf//bazel/flags/cc:cc_proto_library_source_suffixes`
254+
* `--@protobuf//bazel/flags:protocopt`
255+
256+
**NOTE:** In v34.0, `--@protobuf//bazel/flags:protocopt` was incorrectly located
257+
at `--@protobuf//bazel/flags/cc:protocopt`. The flag will be moved to its
258+
correct location, and the `cc` location will remain as a deprecated alias
259+
starting in v34.1. This alias should not be used and will be removed in the next
260+
breaking change.
261+
262+
### Remove deprecated ProtoInfo.transitive_imports {#bazel-transitive-imports}
231263

232264
The deprecated `transitive_imports` field in `ProtoInfo` will be removed. Users
233265
should migrate to `transitive_sources`.
@@ -237,6 +269,10 @@ should migrate to `transitive_sources`.
237269
Due to Bazel's recent improvements on Windows, we now plan to continue to
238270
support Bazel+MSVC. The `--define=protobuf_allow_msvc` flag will be removed.
239271

272+
## Other Changes {#other-changes}
273+
274+
The following are additional breaking changes.
275+
240276
### Languages Without a Major Version Bump
241277

242278
Java, Ruby, C#, Rust, and JRuby will not have a major version bump in this

content/news/2026-03-13.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
+++
2+
title = "Changes Announced on March 13, 2026"
3+
linkTitle = "March 13, 2026"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers on March 13, 2026."
6+
type = "docs"
7+
+++
8+
9+
## Changes in Bazel {#bazel}
10+
11+
### Migration of Proto Flags to Starlark {#bazel-starlark-flags}
12+
13+
`--proto_toolchain_for*` and `--proto_compiler` are no longer read by Proto
14+
rules. These toolchain-related flags are deprecated and will be removed in the
15+
future. Switching to the equivalent Starlark versions of the flags is a
16+
short-term fix:
17+
18+
* `--@protobuf//bazel/flags/cc:proto_toolchain_for_cc`
19+
* `--@protobuf//bazel/flags/java:proto_toolchain_for_java`
20+
* `--@protobuf//bazel/flags/java:proto_toolchain_for_javalite`
21+
* `--@protobuf//bazel/flags:proto_compiler`
22+
23+
The longer-term fix is to enable
24+
`--incompatible_enable_proto_toolchain_resolution` (which is the default in
25+
Bazel 9 anyway) and to register toolchains using the normal platforms-related
26+
mechanisms (`register_toolchain()` in `MODULE.bazel` or `WORKSPACE`, or
27+
`--extra_toolchains`).
28+
29+
All other Bazel Proto flags have also been migrated to Starlark, and the native
30+
flags will be deprecated with the next Bazel release. Use the following Starlark
31+
flags to avoid future breakages:
32+
33+
* `--@protobuf//bazel/flags:strict_proto_deps`
34+
* `--@protobuf//bazel/flags:strict_public_imports`
35+
* `--@protobuf//bazel/flags:experimental_proto_descriptor_sets_include_source_info`
36+
* `--@protobuf//bazel/flags/cc:cc_proto_library_header_suffixes`
37+
* `--@protobuf//bazel/flags/cc:cc_proto_library_source_suffixes`
38+
* `--@protobuf//bazel/flags:protocopt`
39+
40+
**NOTE:** In v34.0, `--@protobuf//bazel/flags:protocopt` was incorrectly located
41+
at `--@protobuf//bazel/flags/cc:protocopt`. The flag will be moved to its
42+
correct location, and the `cc` location will remain as a deprecated alias
43+
starting in v34.1. This alias should not be used and will be removed in the next
44+
breaking change.

content/news/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ New news topics will also be published to the
2020
The following news topics provide information in the reverse order in which it
2121
was released.
2222

23+
* [March 13, 2026](/news/2026-03-13) - Breaking changes
24+
in Bazel for the upcoming 34.x release
2325
* [January 16, 2026](/news/2026-01-16) - Prebuilt proto
2426
compiler (protoc) for Bazel
2527
* [September 19, 2025](/news/2025-09-19) - Breaking

content/news/v34.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ type = "docs"
88

99
The following news topics provide information about changes in the 34.x release.
1010

11+
* [March 13, 2026](/news/2026-03-13) - Breaking changes
12+
in Bazel for the upcoming 34.x release
1113
* [January 16, 2026](/news/2026-01-16) - Prebuilt proto
1214
compiler (protoc) for Bazel
1315
* [September 19, 2025](/news/2025-09-19) - Breaking

0 commit comments

Comments
 (0)