i’m really struggling with this error when building a SwiftPM Snippet in a package that has a dependency on swift-collections
the project is swift-bson at 0.1.0, and i’m trying to add the following Snippet:
import BSON
do
{
let full:[UInt8] = [
0x09, 0x00, 0x00, 0x00, // Document header
0x08, 0x62, 0x00, 0x01, // Document body
0x00 // Trailing null byte
]
let bson:BSON.Document = .init(bytes: full[4 ..< 8])
print(bson)
}
when i do a fresh build of the package, i get
$ swift build --explicit-target-dependency-import-check=error
Building for debugging...
error: link command failed with exit code 1 (use -v to see invocation)
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'round'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'rint'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'trunc'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'ceil'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'floor'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'ceil'
/swift/swift-bson/.build/checkouts/swift-collections/Sources/OrderedCollections/HashTable/_HashTable+Constants.swift:79: error: undefined reference to 'floor'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[336/337] Linking GettingStarted
what is really strange is that the BSON
target has no actual dependency on swift-collections, that package is only used by a different target called BSON_OrderedCollections
.
what is going on here?