johnno1962 / InstantSyntax

SwiftSyntax binary frameworks
Apache License 2.0
47 stars 3 forks source link

"Multiple commands produce..." #1

Open vmanot opened 6 months ago

vmanot commented 6 months ago

Firstly, thank you for undertaking this incredible effort!

I believe you've already hit the error I'm running into, as you note in your Package.swift:

// It would be more correct to uncomment this line and it might even solve a few
// problems but it results in a scree of error messages with the current Xcode 15.2
// about "duplicate copy commands being generated" when you are using more than one
// macro defining package. They should really be just warnings. This is an SPM bug.
//             + (modules.first(where: { $0.name == name })?.depends ?? [])

The trouble is, I'm running into it irregardless.

I have an xcworkspace with multiple local SPM packages and a few Xcode projects, and I'm trying to get my app to use InstantSyntax over the source package.

But when I use InstantSyntax as described in the README, I get the same error that you've noted in your comments.

johnno1962 commented 6 months ago

Hi, Thanks for trying it out! I'm surprised you're seeing that error. Can you post a screenshot of the exact error you're getting here or email it to me at github at johnholdsworth..com please? Which version of Xcode is this? Have you tried it on a smaller test project? Are you in a position to remove the other local projects? Are your local packages Macros?

johnno1962 commented 6 months ago

I've filed a rdar about this suggesting they change this error to a warning as copying something twice isn't really a problem. Have you had any luck solving this reorganising your project? Thankfully, it's very easy to iterate over or I can TeamView if you would like to send me the details.

vmanot commented 6 months ago

@johnno1962 let me get back to you over my weekend with a project you can repro with.

I'm using Xcode 15.2 (App Store version), building for macOS as a target. My local packages have multiple targets (macros and just regular targets).

Would love to Zoom/TeamView if that's an option! Feel free to iMessage me at vatsal.manot@yahoo.com. And please let me know the radar number, I'm happy to dupe! :)

johnno1962 commented 6 months ago

I've spent some quality time with Xcode this morning and think I understand these issues better. The TL;DR is the problem you're seeing seems to already be fixed in more recent Swift toolchains so I recommend downloading and trying: https://download.swift.org/swift-5.10-branch/xcode/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-06-a/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-06-a-osx.pkg . I've expanded out the README with more information about this. Remember to close and open your project window after switching toolchains or the incorrect "build plans" can get cached.