swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.24k stars 413 forks source link

Multiple SPM frameworks with macros fail Xcode app project build #2822

Closed drekka closed 2 months ago

drekka commented 2 months ago

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

ahoppen commented 2 months ago

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

ahoppen commented 2 months ago

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?