Skip to content

Document and test supported_platforms matching and compiler fallback - #941

Merged
helly25 merged 2 commits into
bazel-contrib:masterfrom
helly25:docs/supported-platforms
Nov 7, 2026
Merged

helly25 merged 2 commits into
bazel-contrib:masterfrom
helly25:docs/supported-platforms

Conversation

@helly25

@helly25 helly25 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

The supported_platforms setting added in #933 needs user-facing guidance because excluding a platform can let Bazel select a different compiler.

Add a README example and explain exact OS/architecture matching, exec_os/exec_arch overrides, default validation, compiler fallback, and registration for Bzlmod and WORKSPACE. linux and darwin are explicit OS-wide values, not string prefixes. Architecture-specific values must use canonical keys, such as darwin-aarch64; prefixes, wildcards, and distribution-specific keys are rejected.

Add 10 regression tests calling the production matching function. Cover the README example, OS-wide and exact matches, host architecture normalization, execution-platform overrides, excluded platforms, default validation, and expected failures for invalid entries (even when another entry matches).

Validation:

  • All 55 tests under //toolchain/... pass with Bazel 9.3.0 in Bzlmod mode and Bazel 7.7.2 in WORKSPACE mode, including the 10 new tests.
  • Buildifier, Markdownlint, Prettier, and git diff --check pass.

No production behavior changes.

Signed-off-by: helly25 <6420169+helly25@users.noreply.github.com>
Signed-off-by: helly25 <6420169+helly25@users.noreply.github.com>
@helly25 helly25 changed the title Document supported_platforms and compiler fallback Document and test supported_platforms matching and compiler fallback Nov 7, 2026
@helly25

helly25 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@3405691582 this PRs adds additional tests and documents. Any comments?

@helly25
helly25 merged commit 4a084e5 into bazel-contrib:master Nov 7, 2026
99 checks passed
@helly25
helly25 deleted the docs/supported-platforms branch November 7, 2026 17:23
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.

1 participant