How deep does the moduleAliases go?

I need to add two packages, but they both depends on WebRTC so I am getting conflict during dependency graph resolution. I tried wrapping one of the packages in local package and use moduleAliases, but it doesn't seem to work. WebRTC is not a direct dependency of either of those two packages I need to import, they both have at least one additional package between them and WebRTC.
It looks like moduleAliases only renames targets directly in the dependency, and doesn't do anything to targets of that target's dependencies. Is that correct or am I just doing something wrong?

Two packages in question are mobile-messaging-sdk-ios and sendbird-calls-ios

It would be easier to help you with more information (what's the exact error message you're seeing? What are the URLs of the packages you're depending on? What are the URLs of the conflicting packages where the WebRTC modules are defined?). But I suspect this:


No. that's not correct. See SE-0339 for details on the actual limitations.

Sorry for lack of details, I was more interested in overall answer, rather than solution to my specific scenario and I thought I provided enough information. Looks like I was wrong. All your assumptions are correct tho. WebRTC is imported as binary target in both packages.

So if I am reading this correctly, I am screwed in two ways. First that aliasing doesn't rename target's target, so there is nothing I can do to fix it and second is that aliasing doesn't work for binary targets, so not even vendors can do anything about it.

Thank you for the explanation! Now I know where I stand. As for my specific problem, I was able to use a workaround. One package is added using SPM and other one is added using CocoaPods

my understanding is this is because module aliasing actually rewrites the ABI names of all the declarations in the aliased module, which cannot be done if the module has already been compiled under a different name.