You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor protobuf flag abstraction layer to custom flag targets
Instead of having rules depend on both native and Starlark versions of flags and reconciling them inside the rule implementation, this change moves the resolution logic into custom build setting flag targets (`compat_bool_flag` and `compat_string_list_flag`) defined in `third_party/protobuf/bazel/private/compat_flag.bzl`.
Key details:
- `compat_bool_flag`: Instantiates a custom string build setting flag with a "default" sentinel value. It checks for explicit Starlark flag settings vs. fallback to native `ctx.fragments.proto` fields or default values, providing a boolean `BuildSettingInfo`.
- `compat_string_list_flag`: Defines a string-list build setting flag that reconciles explicit Starlark build settings with `ctx.fragments.proto` and default values.
- Rules reference primary flag targets directly (without helper `_compat` targets or `config_setting` rules).
- Replaces `native_bool_flag.bzl` with `compat_flag.bzl`.
PiperOrigin-RevId: 952990495
0 commit comments