Hello all, we have ran into a problem building our test target that only occurs in Xcode 15. Our team has an SPM package that we use for shared code across our apps. This SPM package also has a dynamically linked target that contains utilities for testing. Within our app we link this test utilities library via Build Phases -> Link Binary with Libraries. On Xcode < 15 we have no problem resolving this library within our test target but on 15 we get a linking error if we try and and link it in the same way. If we remove this library from Build Phases -> Link Binary with Libraries then the linking error goes away, though of course then we will get errors as this library is still used within the XCTests of our test target.
This is a simplified snippet of what our Package.swift looks like for our Swift Package
let package = Package(
name: "Library",
platforms: [
.iOS(.v15)
],
products: [
.library(
name: "Library",
targets: ["Library"]
),
.library(
name: "LibraryTestUtilities",
type: .dynamic,
targets: ["LibraryTestUtilities"]
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
targets: [
.target(
name: "Library",
dependencies: [
// Dependencies
])
,
.target(
name: "LibraryTestUtilities",
dependencies: [
"Library"
]),
.testTarget(
name: "LibraryTests",
dependencies: ["Library", "LibraryTestUtilities"]),
]
)
I have tried to use the linker flags -ld_classic and -ld64 to no avail and I'm not sure where to go from here. It's not exactly obvious what linking change in Xcode 15 is resulting in the failure to resolve this library.
We would appreciate any help on this matter, thanks!