Skip to content

Conversation

@giginet
Copy link
Owner

@giginet giginet commented Dec 18, 2025

Summary

  • Fix an issue where .bundle resources were not included in artifact bundles when building Universal binaries
  • When building with swift build -c release --arch arm64 --arch x86_64, the collector was finding both the Universal binary and single-arch binaries, creating redundant variants
  • Since .bundle resources only exist in the apple/Products/Release/ path, single-arch variants were missing resources
  • This fix filters out single-arch variants that are already covered by Universal binaries

Problem

When building Universal binaries, Swift creates:

  • apple/Products/Release/executable (Universal binary) + .bundle resources
  • arm64-apple-macosx/release/executable (intermediate, no .bundle)
  • x86_64-apple-macosx/release/executable (intermediate, no .bundle)

The collector was finding all three and creating separate variants, but only the Universal variant had .bundle resources.

Solution

Add filtering logic in collector.ts to exclude single-arch variants when a Universal binary already covers those architectures. This ensures only the Universal variant (with .bundle) is included in the artifact bundle.

Test plan

  • Updated test to verify only Universal variant is created when Universal binary exists
  • Updated test to verify .bundle resources are included in Universal variant
  • All existing tests pass
  • Verified with real SlideGen project that .bundle resources are correctly included

🤖 Generated with Claude Code

giginet and others added 3 commits December 18, 2025 23:53
When building Universal binaries, the collector was finding both the
Universal binary from apple/Products/Release/ and single-arch binaries
from arm64-apple-macosx/release/ and x86_64-apple-macosx/release/.
This created redundant variants, and since .bundle resources only exist
in the apple path, single-arch variants were missing resources.

This fix filters out single-arch variants that are already covered by
Universal binaries, ensuring only the Universal variant (with .bundle)
is included in the artifact bundle.

Changes:
- Add filtering logic in collector.ts to exclude redundant single-arch
  variants when Universal binary exists
- Update test to verify only Universal variant is created and .bundle
  is included

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace non-null assertion (!) with proper guard clause for
macosPlatformDir to avoid TypeScript force unwrap.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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