fix: add --platforms flag for correct Apple SDK resolution#4
Merged
maatheusgois-dd merged 1 commit intoMay 19, 2026
Merged
Conversation
swift_library targets were compiling against macOS SDK instead of iOS because --ios_multi_cpus alone doesn't force a platform transition. Adding --platforms=@build_bazel_apple_support//platforms:... ensures the correct SDK is always used regardless of target rule type. Also exposes all platform options (macos, tvos, watchos, visionos) in the bazel_ios_build tool schema. Generated-by: Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
maatheusgois-dd
marked this pull request as ready for review
May 19, 2026 20:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
swift_librarytargets were compiling against macOS SDK instead of iOS Simulator SDK when usingbazel_ios_buildwithplatform: "simulator". This is because--ios_multi_cpus=sim_arm64alone doesn't force a platform transition for standalone library targets — it only affects the CPU split for rules that already transition to iOS (likeios_application).Fix: Add
--platforms=@build_bazel_apple_support//platforms:ios_sim_arm64(and equivalents for all other platforms) which forces Bazel's top-level platform resolution to the correct Apple SDK. The legacy--ios_multi_cpusflag is kept alongside for backward compatibility withrules_appletransition logic.Also: Exposes all platform options (
macos,tvos,watchos,visionos) in thebazel_ios_buildtool schema — they were already supported internally but not advertised to MCP clients.Test plan
bazel build --platforms=@build_bazel_apple_support//platforms:ios_sim_arm64 --ios_multi_cpus=sim_arm64 //Packages/DebugTools:DebugToolsCoresucceeds (previously failed withCADisplayLink unavailable in macOS)Made with Cursor