Skip to content

Add opt-in native Xcode Preview configurations - #3353

Draft
karim-alweheshy wants to merge 1 commit into
preview-stack-compiler-inputs-v2from
preview-stack-native-previews-v2
Draft

karim-alweheshy wants to merge 1 commit into
preview-stack-compiler-inputs-v2from
preview-stack-native-previews-v2

Conversation

@karim-alweheshy

Copy link
Copy Markdown
Contributor

Summary

  • Add an opt-in Xcode configuration for native compilation and linking of
    selected Preview targets, while leaving ordinary configurations Bazel-owned.
  • Prepare the selected target's declared Swift, Clang, generated-header, plugin,
    macro, and linker inputs from Bazel so Xcode can compile the Preview source
    with its native toolchain.
  • Keep Preview-analyzer path anchoring, static-library argument mode and
    runtime-policy preparation with their native consumers in this change.
  • Keep test, archive, and production configurations on the normal Bazel build
    path. Resource-bundle migration/staging is handled by the follow-up resource
    change.

Based on branch preview-stack-compiler-inputs-v2.

The opt-in and its required compiler/link/runtime plumbing stay together so no
intermediate merge exposes an incomplete configuration. The separate linker
and indexing improvements are already in the base. Resource bundles are outside
this chunk; the checked-in example makes that limitation explicit.

Review order

  1. Public preview_xcode_configurations option and project/configuration settings:
    check that only named configurations opt in and archive attempts are rejected.
  2. Selected-target compiler inputs and native link/runtime preparation:
    check the producer-to-consumer contract, static dependency closure, generated
    headers, test hosts, frameworks, and mixed-language targets.
  3. Regression tests and examples/previews: check ordinary configuration
    preservation and the supported scheme/source pairings.

Validation

This resegmented branch has exactly the same Git tree as the previously
CLI-validated candidate. Root tests and lint are rerun at this head. The example
CLI/build/staging evidence below is reused from that identical tree, not claimed
as a new execution during this split.

  • All 134 root Bazel 9 test targets plus the generated-docs test pass at the
    proposed head on macOS with Xcode 27.0. Repository Buildifier passes.
  • The resource-free example generates with its checked-in rules_swift 3.5 and
    rules_apple 4.4 pins, using this repository through local_path_override.
  • Ordinary Bazel builds of the macOS app, framework, and explicit-module target
    pass. An ordinary Xcode Debug build of the macOS app also passes.
  • Native Previews-configuration CLI builds pass for the library, mixed-language,
    framework, macOS app, explicit-module, and generic iOS Simulator schemes.
    The final assembled source was regenerated and the mixed/explicit schemes
    rerun. CLI builds used CODE_SIGNING_ALLOWED=NO.
  • Shell checks report no new findings; existing template warnings are unchanged
    from main. Generated documentation retains its required trailing blank line.

This is a draft extraction with compile/link/packaging evidence, not fresh Canvas
render or signed-runtime proof. The assembled stack still needs visual retesting.
The separate rules_swift 4.1 fixture is not included: ordinary compilation with
the installed Xcode 27 SDK crashes before a Preview action can run.

Testing

  • Generate the example project with the Preview configuration opted in.
  • Verify ordinary Debug build/test/archive actions remain Bazel-owned.
  • In Xcode, select a Preview scheme configured for native compilation, request
    a Preview, and record the first terminal result. A successful build alone is
    not a successful Preview; confirm the expected view actually renders before
    making that claim.

Signed-off-by: Karim Alweheshy <karim.alweheshy@reddit.com>
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