tuist: 📦 [Dependencies.swift][SPM] Module map linking not working for ObjectiveC packages
What happened?
When a package defines a modulemap file, it is linked to the projects depending on it using the -fmodule-map-file=… in OTHER_C_FLAGS and OTHER_CPP_FLAGS.
This doesn’t seem to work correctly if the dependent package is an Objective-C target.
As there were a number of issues related to this, I have created this one and will close the others as duplicate
How do we reproduce it?
There are a number of issues related to it, which you can use to reproduce it:
- https://github.com/tuist/tuist/issues/3463
- https://github.com/tuist/tuist/issues/4562
- https://github.com/tuist/tuist/issues/4573
- https://github.com/tuist/tuist/issues/4471
- https://github.com/tuist/tuist/issues/4436
- https://github.com/tuist/tuist/issues/4024
What were you expecting?
Import should work correctly out of the box
macOS version
12.0
Tuist version
3.10.0
Xcode version
13.4.1
Upvote & Fund
- We’re using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 42 (7 by maintainers)
AppLayer ---- Module A -------- Firebase (10.10.*) -------- Google Sign In (7.0.0) or (6.2.4) ---- Module B ---- Module C …
try add build settings at Module A’s build settings.
in my case, I solved. pay attention to the file path (public header path).
Hey folks 👋🏼. I started looking into this one. It seems that some build settings are missing in the projects in which dependencies are integrated and that causes the compilation errors that you are all seeing. I’ll use all the dependencies mentioned in this thread to reproduce this issue. Please, if you had issues with other dependencies, I’d appreciate if you could share the name with me.
Hey, folks 👋
This PR should finally fix this issue: https://github.com/tuist/tuist/pull/5887
If there’s any complex dependency that you’d like us to try out, let us know. We hope to include the fix in the next tuist release.
Thanks!
It worked for me with some slight modifications (paths were incorrect for me):
Adding this lines to xcconfig
helped me to build the project successfully in case of use GoogleSignIn SPM package
Firebase and GoogleSignIn can’t work as external dependency, because of this only as a native SPM
Hi, that’s great news ! Here is some dependencies that had issues: Realm https://github.com/realm/realm-swift Sentry https://github.com/getsentry/sentry-cocoa
I don’t know if it’s relevant but it looks like the publicHeadersPath is defined in Amplitude-iOS’s Package.swift file, Whereas AppAuth is left at “”. I’ve tried importing both and Amplitude does have it’s headers?
how to use that info? I’m not sure yet, just thought it might be something to share in case anyone else is still looking too.
Hey, setting
"USE_HEADERMAP": "YES"intargetSettingsfixed errors in Sentry 8.10.0No, it shouldn’t be related 🙏