Skip to content

fix(examples): auto-build Swift bindings in Xcode pre-action#258

Open
SeanROlszewski wants to merge 2 commits into
mainfrom
fix/auto-build-swift-bindings
Open

fix(examples): auto-build Swift bindings in Xcode pre-action#258
SeanROlszewski wants to merge 2 commits into
mainfrom
fix/auto-build-swift-bindings

Conversation

@SeanROlszewski
Copy link
Copy Markdown
Contributor

Summary

  • Replace the validation-only Xcode pre-build script with one that automatically runs scripts/package-swift.sh when the xcframework or generated bindings are missing, or when Rust sources under rust/core/src/ are newer than the artifacts
  • Skips the rebuild entirely when everything is present and up to date (no-op on clean builds)
  • Updates both project.yml (XcodeGen source of truth) and the generated .xcscheme

Test plan

  • Delete IDKitFFI.xcframework at the repo root, then build in Xcode — the pre-action should run package-swift.sh and the build should succeed
  • Build again immediately — the pre-action should be a no-op (no rebuild)
  • touch rust/core/src/bridge.rs, then build — the staleness check should trigger a rebuild

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview, Comment May 14, 2026 2:48pm

Request Review

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>
@Takaros999
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +48 to +50
if [ "${NEEDS_BUILD}" -eq 1 ]; then
echo "note: IDKit native artifacts missing or stale — rebuilding..."
"${REPO_ROOT}/scripts/package-swift.sh"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

2 participants