I'm trying to set up the structure for a set of SPM packages that I'd also like to open / build in Xcode (13.1).
It seems I've run into some fundamental issue here, just want to see if anyone else has encountered this or have any workaround.
Basically, I have library packages A, B and C (and then there are executable D and E that will depend on A/B).
A depends on C
B depends on C
I've set up the dependency for a local package as such in both A and B:
dependencies: [
....
.package(path: "../C")
],
From a clean startup of Xcode, I can work with A or B and get the package C properly resolved with a fold-down arrow so I can edit the local copy as well as building A or B properly.
But if opening both A and B in Xcode, the secondly opened copy will not get a fold down and can't build as it fails with:
Missing package product 'C'
I've tried cleaning SPM package caches and build folders, but no go. If I open B first instead, A will fail, so it seems clearly related to which order these are opened.
I want to be able to open both A and B in Xcode and work in parallel on them, preferably with the fold down of the local package C such that it can be edited regardless of where my focus is at the time.
I also opened FB9796870
with a reproducer, but hoped there was some way to get this to work.
Command line builds with SPM works fine for both, I guess that is always a workaround, but would have been nice to be able to work from Xcode too.