gutiago
(Gustavo Tiago)
3
I was able to reproduce the issue on an example project. It can be found in here.
The main problem is that on my local package, I have a library called NetworkTestingSupport that depends on Network library. They are both inside the Network package.
NetworkTestingSupport is linked to the Test Target. Which causes the problem. I believe it is linked dynamically, so it can't find the implementation of the macro.
The below represents the dependency graph for the example project shared above. If I remove NetworkTestingSupport and ExampleTests link, it works.
But can't think of a way to fix the issue. Running swift build and swift test on the local packages seems to be working, so I don't think this is related to the SPM.
Looking into old posts in the forum, I could find this topic. Where the setup is similar to mine, and I believe this is related. Both is setting up a TestHelper library, that depends on another library in the package. And this library has dependency of an external package.
It seems Xcode can't link the parent dependencies when running tests.