Skip to content

Conversation

@pepicrft
Copy link

@pepicrft pepicrft commented Dec 20, 2025

Fixes swiftlang/swift-package-manager#9157

This change addresses an issue where multiple XCFrameworks containing libraries with the same name would cause build failures. When building a project that uses packages like Sentry.xcframework and Sentry-Dynamic.xcframework, both containing Sentry.framework internally, the build system would produce "Multiple commands produce" errors because they were all outputting to the same path in the build directory.

The fix modifies the output directory computation to include the xcframework name as a subdirectory. This ensures each xcframework outputs to its own isolated location. For example, Sentry.xcframework now outputs to build/Debug/Sentry/Sentry.framework while Sentry-Dynamic.xcframework outputs to build/Debug/Sentry-Dynamic/Sentry.framework. This is a minimal change that resolves the conflict without affecting the existing linking and embedding behavior.

Note

Backward Compatibility Consideration

This change modifies the output directory structure for all XCFrameworks, not just those with conflicting library names. Projects with scripts, caches, or tooling that depend on the previous output paths (e.g., build/Debug/Sentry.framework instead of build/Debug/Sentry/Sentry.framework) may need updates.

Is this acceptable, or should we consider an alternative approach that only adds the subdirectory when there's an actual conflict? The current approach is simpler and provides consistent, predictable output paths.

When multiple xcframeworks contain the same-named library (e.g.,
Sentry.xcframework and Sentry-Dynamic.xcframework both containing
Sentry.framework), they would all output to the same path in the
build directory, causing "Multiple commands produce" errors.

This fix includes the xcframework name in the output path, so each
xcframework outputs to its own subdirectory. For example:
- Sentry.xcframework outputs to build/Debug/Sentry/Sentry.framework
- Sentry-Dynamic.xcframework outputs to build/Debug/Sentry-Dynamic/Sentry.framework

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive doc comment explaining the output directory behavior
- Add explicit assertions verifying output directories are different
- Add command line checks for --target-path argument
- Add clarifying comments in test

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

[Parity] error: Multiple commands produce

1 participant