Skip to content

fix: support modern Swift release builds#269

Open
steipete wants to merge 2 commits into
Choochmeque:mainfrom
steipete:fix/swift-6-4-build
Open

fix: support modern Swift release builds#269
steipete wants to merge 2 commits into
Choochmeque:mainfrom
steipete:fix/swift-6-4-build

Conversation

@steipete

Copy link
Copy Markdown

Summary

  • resolve SwiftPM's actual binary output directory instead of reconstructing the legacy path
  • preserve swift-bridge entry points in optimized Swift builds
  • reuse one Swift build command for compilation and output-path discovery

Why

Current Swift toolchains can place products below Products/Debug or Products/Release, so the hard-coded <triple>/<profile> link path fails. Optimized builds can also strip the internal @_cdecl bridge functions generated by swift-bridge; this is tracked in swift-bridge#166.

Validation

  • cargo fmt --check
  • cargo check
  • optimized macOS Tauri app bundle build with Swift 6.4
  • verified the release static library exports the generated bridge symbols

Copilot AI review requested due to automatic review settings July 17, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the macOS Swift build step in build.rs to be compatible with modern SwiftPM output layouts and to prevent swift-bridge-generated entry points from being stripped in optimized Swift builds.

Changes:

  • Switch from reconstructing the SwiftPM output directory to querying it via swift build --show-bin-path.
  • Preserve swift-bridge entry points in release builds by adding -Xswiftc -enable-testing.
  • Refactor the Swift invocation into a shared swift_build_command() helper and return the resolved build output directory for linking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build.rs
Comment thread build.rs
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.48%. Comparing base (2a00e01) to head (35d04a6).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #269   +/-   ##
=========================================
  Coverage     50.48%   50.48%           
  Complexity       65       65           
=========================================
  Files            31       31           
  Lines          6499     6499           
  Branches        235      235           
=========================================
  Hits           3281     3281           
  Misses         3184     3184           
  Partials         34       34           
Flag Coverage Δ
android 27.98% <ø> (ø)
ios 78.76% <ø> (ø)
javascript 92.10% <ø> (ø)
macos 64.59% <ø> (ø)
rust 35.02% <ø> (ø)
windows 15.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings July 17, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

3 participants