mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
The ultimate effect of this change will be that both the native flags and Starlark flags will continue to work with future versions of Bazel that lack the proto fragment, until such time as we deprecate or remove the flags in a Protobuf release. This decouples Bazel releases from Protobuf behavior changes. 1. Builds on the Bazel 8-compatible abstraction layer we submitted in cl/955468205 by setting `HAS_NATIVE_PROTO_FLAGS` properly in Bazel. We do this by adding a `rules.has_proto_fragment` setting to the `proto_bazel_features.bzl` mechanism: we know that the fragment no longer needs to be read in Bazel 9+, because we can use `flag_alias()` instead. 2. Adds `flag_alias()` declarations in MODULE.bazel for all compat layer flags. This will work in Bazel 9, but is ignored in Bazel 8. This leads to a slight inconsistency. Consider the following set of flags set by a user: ``` --@protobuf//bazel/flags:protocopt=foo --protocopt=bar ``` In Bazel 9+, where the flag alias is respected, the final value of the flag will be `bar`. In Bazel 8, where we emulate `flag_alias()` by reconciling the two different values at analysis time, we always prefer the Starlark version (and cannot tell the relative order), so the final value of the flag will be `foo`. To avoid this, prefer setting the Starlark version of the flag whenever possible. PiperOrigin-RevId: 970834999 |
||
|---|---|---|
| .. | ||
| common | ||
| flags | ||
| private | ||
| tests | ||
| toolchains | ||
| BUILD | ||
| cc_proto_library.bzl | ||
| java_lite_proto_library.bzl | ||
| java_proto_library.bzl | ||
| proto_descriptor_set.bzl | ||
| proto_library.bzl | ||
| py_proto_library.bzl | ||
| upb_c_proto_library.bzl | ||
| upb_proto_reflection_library.bzl | ||