I've found a solution, based on the following lead:
While I don't know exactly what's causing the cross-module symbol culling, enabling library evolution does appear to fix the problem:
.target(
name: "HeapSwiftCore",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
],
swiftSettings: [
.unsafeFlags([
"-enable-library-evolution",
"-emit-module-interface"
]),
]),
The only problem I have now is warning about swift-protobuf not being compiled with evolution support, but I believe I can fix this with @_implementationOnly import attributes, as described in below since I'm not exposing this outside of testing:
I'll probably end up with something like:
#if BUILD_FOR_DEVELOPMENT
import SwiftProtobuf
#else
@ _implementationOnly import SwiftProtobuf
#endif