swiftlang/swift-syntax

Multiple SPM frameworks with macros fail Xcode app project build

drekka opened this issue · 2 comments

Description

I have a large project with multiple SPM packages being compiled into a single Xcode app project. I've added macros to 3 of the of the SPM packages and they all compile, test and work when used on other SPM packages.

However when I attempt to build the app project in Xcode (or via xcodebuild) I get failure messages about the SPM modules that contain macros all trying to copy the swift-syntax frameworks. Like this:

…
error: Multiple commands produce '…/Products/Debug/Frameworks/SwiftBasicFormat.framework/Versions/A/SwiftBasicFormat'
    note: Target 'FlagDataMacros' (project 'FeatureFlagsMacros') has copy command from '…/Build/Products/Debug/PackageFrameworks/SwiftBasicFormat.framework' to '…/Build/Products/Debug/Frameworks/SwiftBasicFormat.framework'
    note: Target 'ToolboxMacros' (project 'Toolbox') has copy command from '…/Build/Products/Debug/PackageFrameworks/SwiftBasicFormat.framework' to '…/Build/Products/Debug/Frameworks/SwiftBasicFormat.framework'
    note: Target 'ToolboxUIMacros' (project 'ToolboxUI') has copy command from '…/Build/Products/Debug/PackageFrameworks/SwiftBasicFormat.framework' to '…/Build/Products/Debug/Frameworks/SwiftBasicFormat.framework'
…

Generally a set of these errors for every swift-syntax framework.

Anyone know how to fix this?

Steps to Reproduce

No response

Synced to Apple’s issue tracker as rdar://134672802

This seems like an issue with the way that your project is built in Xcode, not with swift-syntax itself. Could you file a feedback for this on https://feedbackassistant.apple.com?