Goal
Make sure PreviewsMCP's Bazel support (Sources/PreviewsCore/BazelBuildSystem.swift) works against large, real-world rules_xcodeproj projects, not just our examples/bazel fixture. These are public, clonable repos we can use as integration targets and regression cases.
Today BazelBuildSystem detects a Bazel root via MODULE.bazel/WORKSPACE, finds the owning swift_library via rdeps, queries module_name, builds, and locates the .swiftmodule via cquery --output=files. None of that is exercised against a monorepo-scale project. The repos below stress package layout, module naming, focused/unfocused targets, and resource-bundle handling in ways our fixture does not.
Candidate projects (public, xcodeproj(...) confirmed)
| Repo |
Stars |
Apple surface |
rules_xcodeproj evidence |
| TelegramMessenger/Telegram-iOS |
~8.6k |
Full iOS app (UIKit/AsyncDisplayKit) |
MODULE.bazel bazel_dep(name = "rules_xcodeproj"); Telegram/BUILD xcodeproj(name = "Telegram_xcodeproj") |
| Snapchat/Valdi |
~16.4k |
Cross-platform native UI framework |
valdi/bzl_project/BUILD.bazel multiple xcodeproj(...); MODULE.bazel |
| maplibre/maplibre-native |
~2k |
iOS + macOS map SDK |
platform/ios/BUILD.bazel & platform/macos/BUILD.bazel load @rules_xcodeproj//xcodeproj:defs.bzl, xcodeproj(...) |
| envoyproxy/envoy |
~28k |
mobile/ iOS client lib |
mobile/BUILD loads @com_github_buildbuddy_io_rules_xcodeproj//..., xcodeproj(...) (older WORKSPACE name) |
| AgentsMesh/AgentsMesh |
~2.2k |
Native iOS app (SwiftUI + TCA) |
build_defs/ios/ios_product.bzl xcodeproj(...). NOTE: uses custom macros over rules_xcodeproj; verify before relying on it. |
Notes:
- envoy-mobile is superseded — it moved into the
envoyproxy/envoy monorepo under mobile/. Target envoy instead.
- Most big adopters (Lyft, Reddit, Pinterest, Tinder, Spotify, Cash App, Slack, Robinhood) keep their iOS apps in private repos, so they are not clonable.
- For minimal repros: the
rules_xcodeproj repo's own examples/integration/* apps, and mattrobmattrob/bazel-ios-swiftui-template.
Known preview fragility in rules_xcodeproj (relevant to our JIT path)
The named repos have no public "previews broken" issues (and several aren't SwiftUI apps), but rules_xcodeproj itself has open, actively-tracked preview bugs — several directly adjacent to our JIT executor work:
- #3189 — previews fail in the ruleset's own example (Xcode 16 / Bazel 8.2.1):
CouldNotParseLinkCommandLine → FailedParsingMachObjectFile. Logs show run mode "JIT Executor."
- #3201 — Preview App can't find static libs at link time; SwiftUI Preview blocks standard swiftc stub injection, "necessitating an entirely new xctoolchain."
- #2977 — SPM resource-bundle deps crash in preview (
Bundle.module assertion / rspm_resource_bundle_accessor). Relevant to the collectSourceFiles resource-bundle gap already noted in BazelBuildSystem.swift.
- #2915 — Xcode Previews fail for
macos_*_framework top-level targets.
Mechanism worth encoding in our support matrix: rules_xcodeproj uses focused targets. To preview a view in library L, L must be focused and merged into a focused top-level target. Unfocused libraries are built by Bazel as opaque prebuilt artifacts, and a target reduced to a CompileStub.m shell cannot host previews. The legacy build_mode = "xcode" (BwX) path was removed in late 2023; everything is Build-with-Bazel now, so previews must work through that path.
Suggested scope
- Clone Telegram-iOS, Valdi, and maplibre-native; run our Bazel detection + build pipeline against a representative
#Preview in each. Record where findOwningTarget / queryModuleName / findCompilerFlags break on monorepo-scale graphs.
- Add at least one of these (or a trimmed fixture derived from one) as an integration target so we catch regressions.
- Document a support matrix: which package layouts, target-merging setups, and resource-bundle configurations we handle, and which are known-unsupported (cross-referencing the rules_xcodeproj issues above).
- Decide whether focused-vs-unfocused target detection belongs in
BazelBuildSystem (e.g. surface a clear error when the source's owning library is unfocused / stub-only, instead of a generic build failure).
Goal
Make sure PreviewsMCP's Bazel support (
Sources/PreviewsCore/BazelBuildSystem.swift) works against large, real-worldrules_xcodeprojprojects, not just ourexamples/bazelfixture. These are public, clonable repos we can use as integration targets and regression cases.Today
BazelBuildSystemdetects a Bazel root viaMODULE.bazel/WORKSPACE, finds the owningswift_libraryviardeps, queriesmodule_name, builds, and locates the.swiftmoduleviacquery --output=files. None of that is exercised against a monorepo-scale project. The repos below stress package layout, module naming, focused/unfocused targets, and resource-bundle handling in ways our fixture does not.Candidate projects (public,
xcodeproj(...)confirmed)MODULE.bazelbazel_dep(name = "rules_xcodeproj");Telegram/BUILDxcodeproj(name = "Telegram_xcodeproj")valdi/bzl_project/BUILD.bazelmultiplexcodeproj(...);MODULE.bazelplatform/ios/BUILD.bazel&platform/macos/BUILD.bazelload@rules_xcodeproj//xcodeproj:defs.bzl,xcodeproj(...)mobile/iOS client libmobile/BUILDloads@com_github_buildbuddy_io_rules_xcodeproj//...,xcodeproj(...)(older WORKSPACE name)build_defs/ios/ios_product.bzlxcodeproj(...). NOTE: uses custom macros over rules_xcodeproj; verify before relying on it.Notes:
envoyproxy/envoymonorepo undermobile/. Targetenvoyinstead.rules_xcodeprojrepo's ownexamples/integration/*apps, and mattrobmattrob/bazel-ios-swiftui-template.Known preview fragility in rules_xcodeproj (relevant to our JIT path)
The named repos have no public "previews broken" issues (and several aren't SwiftUI apps), but rules_xcodeproj itself has open, actively-tracked preview bugs — several directly adjacent to our JIT executor work:
CouldNotParseLinkCommandLine→FailedParsingMachObjectFile. Logs show run mode "JIT Executor."Bundle.moduleassertion /rspm_resource_bundle_accessor). Relevant to thecollectSourceFilesresource-bundle gap already noted inBazelBuildSystem.swift.macos_*_frameworktop-level targets.Mechanism worth encoding in our support matrix: rules_xcodeproj uses focused targets. To preview a view in library
L,Lmust be focused and merged into a focused top-level target. Unfocused libraries are built by Bazel as opaque prebuilt artifacts, and a target reduced to aCompileStub.mshell cannot host previews. The legacybuild_mode = "xcode"(BwX) path was removed in late 2023; everything is Build-with-Bazel now, so previews must work through that path.Suggested scope
#Previewin each. Record wherefindOwningTarget/queryModuleName/findCompilerFlagsbreak on monorepo-scale graphs.BazelBuildSystem(e.g. surface a clear error when the source's owning library is unfocused / stub-only, instead of a generic build failure).