Package does not get compiled by App Target #1755
Replies: 3 comments 1 reply
-
I'm not sure this is the same issue but do you declare your @main in the package ? I found that if you do and do not have any swift file in the Xcode project, Xcode won't recompile the library. I solve this by having a placeholder file in the project, even empty it solves the issue. |
Beta Was this translation helpful? Give feedback.
-
When this happens to me I see the overlay that displays "Build Succeeded" but in the Report Navigator:
|
Beta Was this translation helpful? Give feedback.
-
There seem to be a lot of problems in Swift's ability to incrementally compile, and so you should probably file bugs and feedbacks with a project that reproduces it. We have been running into these problems more and more. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The is not strictly a TCA question but rather a micro package architecture question - hope that is ok!
I have a large app project similar to Isowords: minimal App Target which uses an "AppFeature" which is declared in a local SPM Package and added as a local SPM dependency exactly like Isowords. In my App Target of the Xcode project the AppFeature is both reference from "Link binary with Libraries"

and also marked as a "Target Dependency":

Which IIRC is the standard way of flagging to Xcode that "please recompile this target when I run the app target".
AppFeature has a loooong dependency chain, exact like IsoWords, i.e.
AppFeature <- MainFeature <- HomeFeature <- ZClient <- YClient <- XClient
My problem:
When I make changes in the package
XClient
and run the app, I very often see that I do not get those changes in my app! It somehow uses an older potential caches(?) version of XClient.Of course all my packages state the being dependent on... their dependencies... otherwise the code would not compile. In my naive mind this SPM stated target dependency should cause Xcode to recompile XClient when I run the app.
This has bit me many many times in the *ss. I've probably wasted hours on this, where I had a bug in XClient, and actually fixed the bug in XClient, re-ran my app but the bug is still there.
What fixes this? Cleaning the whole project fixes this! But then recompiling - on a Mac Studio! - takes 4 minutes.
I would be sooo thankful for a good solution to this! I would really however, like to avoid having to add every link in the chain as Target Dependency in my AppTarget.
Beta Was this translation helpful? Give feedback.
All reactions