Issue with third party dependencies inside a XCFramework through SwiftPM

I'm hitting this same Library not loaded: @rpath/TransientDependency.framework/... issue using GitHub - surpher/PactSwift: A Swift version of Pact. Implements Pact Specification Version 3.

I'm building a XCFramework using Xcode 13.3+ and using it in my project. I built it in terminal and added it to my project. I'm having exactly the same issue if I build the XCFramework via Carthage (with --use-xcframeworks flag) and add it to my project.

When using Xcode 13.2.1 or older, everything seems to build and link up fine and I can use the dependency in my project(s).

Funny thing is, importing the library through SPM works just fine without any issues with any "relevant" Xcode version (that supports binaries in SPM). All transient dependencies are pulled into my project and everything builds and runs without issues.

Context:

  • Module A - a repo with a .xcodeproj (for cartahge) and Package.swift so it can be distributed via SPM and Carthage.
  • Module B - a repo wrapping huge binaries compiled from Rust codebase and is vended as a XCFramework via SPM to Module A.

Would really appreciate some help on this too? Looks like there's a few of us hitting the same/similar issue?

Seems like building a XCFramework that depends on other binaries eg .xcframework and using it in a project is broken from Xcode 13.3+?