xcode_locator respects DEVELOPER_DIR #27366
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ability to build swift code by xcode from user defined DEVELOPER_DIR was significant feature of bazel 8.3.0
However, if doesn't work fully.
swiftc compiler doesn't run directly in build action. It is launched through xcode_locator, which set DEVELOPER_DIR before swiftc call.
Problems are:
xcode_locator doesn't respect DEVELOPER_DIR (defined by me).
xcode_locator selects installed xcodes only.
First problem looks even worse, because xcode_swift_toolchain determines "my" xcode and plans to use it (xcode_swift_toolchain analyzes DEVELOPER_DIR), but it doesn't guarantee "my" xcode usage (because of xcode_locator as intermediate lawyer).
As feature user I want to say, that if I set DEVELOPER_DIR, I know better what xcode should be chosen and accept all risks.
This is very important when you try to build swift code on newest MacOS by old xcode. You can't install it due to OS policies, but you would like (and actually can) to use it still by extracting .xip archive.
Issue: #27238