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
{{ message }}
Repository navigation
Migrate darwin config_settings to constraint_values for --platforms compatibility #46572
Under --platforms-based builds, the legacy values = {"cpu": ...} darwin settings may not match. Any select() keyed on //bazel:darwin_x86_64 / //bazel:darwin_arm64 can therefore silently fall through to //conditions:default on macOS, rather than matching the intended darwin branch.
This was surfaced in review of #46570 (discussion r3735759962), where the prebuilt protoc select mixed constraint-based linux keys with legacy darwin keys. That PR is being kept macos-arm-only to avoid scope creep, but the underlying inconsistency is a pre-existing issue that likely affects other selects across the repo, not just protoc.
Proposed fix
Migrate the darwin config settings to constraint_values, mirroring the linux pattern. Both arm64 and x86_64 should be covered (macOS x86_64 support should be retained):
The legacy darwin_x86_64 / darwin_arm64 names are referenced in several places in bazel/BUILD (e.g. apple, darwin_any, x86, not_x86_ppc, not_x86 config_setting_groups) and potentially elsewhere in the repo. All usages need to be audited and updated (or the legacy settings kept as aliases during transition).
Audit all select()s that key on darwin settings to ensure they behave correctly under --platforms.
Confirm the correct @platforms//os constraint name for macOS (osx) matches what the toolchains resolve to.
Activity
dio commentedon Aug 11, 2026
@phlax, are you already working on this? If not, I’d be happy to pick it up. I have a small compatibility-preserving spike ready.
phlax commentedon Aug 11, 2026
i wasnt yet - it surfaced in bot reviews of another pr - so separated out here - would be great if you are up for addressing
dio commentedon Aug 11, 2026
Thanks, I’ll take it.
bazel: support platform-based Darwin architecture selection (#46637)