Skip to content

Improve Xcode selection diagnostics - #644

Open
erikkerber wants to merge 3 commits into
bazelbuild:mainfrom
erikkerber:codex/actionable-xcode-errors
Open

erikkerber wants to merge 3 commits into
bazelbuild:mainfrom
erikkerber:codex/actionable-xcode-errors

Conversation

@erikkerber

@erikkerber erikkerber commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

An attempt to (greatly) increase the legibility of the currently inscrutible error message developers receive when the configured Xcode is not available locally or remotely.

Bazel couldn’t match the selected Xcode to this project’s supported versions:
  27.0 (build 27A266a)

Supported versions:
  26.5 (build 17F42)
  27.2 (build 27B5019j)

Detected locally:
  26.5 (build 17F42)
  27.0 (build 27A266a)
  27.2 (build 27B5019j)

Install a supported Xcode version and select it with xcode-select.

Validation

  • bazel test //test:xcode_config_test on Bazel 8.7.0, 9.0.0, 9.0.1, and 9.2.0: all 51 tests pass on each release, including unsupported, unknown, ambiguous, duplicate, and empty inventories, plus custom and empty hints.
  • Verified the failure against a consuming project's configuration and checked the fallback when discovery fails.

A few examples:

CleanShot 2026-09-17 at 13 32 56@2x CleanShot 2026-09-17 at 13 33 21@2x

@erikkerber
erikkerber marked this pull request as ready for review September 17, 2026 18:31
Comment thread xcode/xcode_config.bzl
xcode_config = rule(
attrs = {
"xcode_selection_hint": attr.string(
default = "Install a supported Xcode version and select it with \033[1;36mxcode-select\033[0m.",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realizing this actually a terrible default because it's not the default way Xcode is configured.

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.

2 participants