Skip to content

fix(berd-call): link Swift bridges built by the swiftbuild system - #430

Merged
johnmatthewtennant merged 1 commit into
mainfrom
jtennant/henry/swift-build-path
Oct 23, 2026
Merged

johnmatthewtennant merged 1 commit into
mainfrom
jtennant/henry/swift-build-path

Conversation

@johnmatthewtennant

Copy link
Copy Markdown
Contributor

Summary

Fresh Berd checkouts fail to build on current Xcode (macOS 27) with:

error: could not find native static library `BerdMacSpeechBridge`, perhaps an -L flag is missing?

swift build succeeds. The failure is the Rust link step. Newer Xcode defaults SwiftPM to the swiftbuild system, which writes products to <scratch>/out/Products/<Config>. swift-rs 1.0.7 only adds <scratch>/<arch>-apple-macosx/<config> to the link search path, so the library is never found. The root Berd crate has the same problem with BerdAirPodsBridge.

Both build.rs files now also emit cargo:rustc-link-search=native=$OUT_DIR/swift-rs/<package>/out/Products/<Debug|Release>. On the old layout the extra path is unused, so older Xcode and macOS CI are unaffected. Linux and Windows skip the Swift code entirely.

Testing

Each run used a fresh CARGO_TARGET_DIR, from src-tauri with the Hermit toolchain on macOS 27 and /Applications/Xcode.app.

Before (origin/main):

  • cargo build -p berd-call fails: could not find native static library BerdMacSpeechBridge
  • cargo build -p Berd (with TAURI_CONFIG as in just tauri-check) fails: could not find native static library BerdAirPodsBridge

After:

  • cargo build -p berd-call passes
  • cargo build --release -p berd-call passes
  • cargo test -p berd-call passes
  • cargo build -p Berd passes

Not verified: an older Xcode that still uses the <arch>-apple-macosx layout, and macOS CI.

Newer Xcode defaults `swift build` to the swiftbuild system, which writes
products to `<scratch>/out/Products/<Config>`. swift-rs 1.0.7 only adds
`<scratch>/<arch>-apple-macosx/<config>` to the link search path, so the
BerdMacSpeechBridge and BerdAirPodsBridge static libraries were not found
even though `swift build` succeeded.

Also emit the new products directory as a link search path. The old layout
keeps working because the extra path is simply unused there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Henry <a0d9f90f86da5f023099d22b8e3599af162d9423a422d8f385a12815de879cf2@buzz.block.builderlab.xyz>
@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review October 23, 2026 18:22
@johnmatthewtennant
johnmatthewtennant requested a review from a team October 23, 2026 18:22
@johnmatthewtennant
johnmatthewtennant merged commit 31661e2 into main Oct 23, 2026
11 checks passed
@johnmatthewtennant
johnmatthewtennant deleted the jtennant/henry/swift-build-path branch October 23, 2026 19:37
johnmatthewtennant pushed a commit that referenced this pull request Oct 23, 2026
Main now carries the speech-hold, interim-word and playback-cancel
fixes from #429, which this branch and #428 already had in their own
form, plus the Swift link-path fix from #430.

Conflicts take this branch's versions, with #428's interim words and
the final_end coverage fix layered on, so the configurable and learned
thresholds stay in place of #429's single fixed VAD threshold. The
swiftbuild link-path change from #430 is kept as is. The merged tree
matches the combined build that passed the full berd-call suite, plus
the two build.rs changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johnmatthewtennant pushed a commit that referenced this pull request Oct 23, 2026
Main now carries the speech-hold, interim-word and playback-cancel
fixes from #429, which this branch and #428 already had in their own
form, plus the Swift link-path fix from #430.

Conflicts take this branch's versions, with #428's interim words and
the final_end coverage fix layered on, so the configurable and learned
thresholds stay in place of #429's single fixed VAD threshold. The
swiftbuild link-path change from #430 is kept as is. The merged tree
matches the combined build that passed the full berd-call suite, plus
the two build.rs changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Henry <a0d9f90f86da5f023099d22b8e3599af162d9423a422d8f385a12815de879cf2@buzz.block.builderlab.xyz>
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