fix(examples): auto-build Swift bindings in Xcode pre-action#258
fix(examples): auto-build Swift bindings in Xcode pre-action#258SeanROlszewski wants to merge 2 commits into
Conversation
Replace the validation-only pre-build script with one that automatically runs `scripts/package-swift.sh` when the xcframework or generated bindings are missing or when Rust sources are newer than the artifacts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
On some CI runners (e.g. macOS with Xcode 26.0.1), the rustup cargo proxy is not in PATH even after toolchain installation, causing `cargo` to resolve to `rustup-init`. Source the cargo environment when cargo is not found. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 787a89f066
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ "${NEEDS_BUILD}" -eq 1 ]; then | ||
| echo "note: IDKit native artifacts missing or stale — rebuilding..." | ||
| "${REPO_ROOT}/scripts/package-swift.sh" |
There was a problem hiding this comment.
Move artifact build before SwiftPM resolution
When building the sample app from a fresh checkout or after deleting IDKitFFI.xcframework as described in the test plan, this scheme pre-action is too late to create the artifact: the Xcode project depends on the local Swift package at ../.., and swift/Package.swift declares a binary target at swift/IDKitFFI.xcframework, so Xcode/SwiftPM must resolve that package and validate the binary target before it can run the scheme's build pre-actions. In that missing-artifact state package resolution fails first, so package-swift.sh is never invoked and the advertised auto-build path still does not work.
Useful? React with 👍 / 👎.
Summary
scripts/package-swift.shwhen the xcframework or generated bindings are missing, or when Rust sources underrust/core/src/are newer than the artifactsproject.yml(XcodeGen source of truth) and the generated.xcschemeTest plan
IDKitFFI.xcframeworkat the repo root, then build in Xcode — the pre-action should runpackage-swift.shand the build should succeedtouch rust/core/src/bridge.rs, then build — the staleness check should trigger a rebuild🤖 Generated with Claude Code