Swiftpm dependency error with all nightly docker images

What's the meaning of this error?
SwiftPM fetches repos failing with all nightly docker images

Computing version for https://github.com/mongodb/swift-bson.git
37
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
38
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
39
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
40
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
41
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
42
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
43
error: target 'libbson' referenced in product 'libbson' could not be found; valid targets are: ''
44
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
45
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
46
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
47
error: target 'bson' referenced in product 'bson' could not be found; valid targets are: ''
48
error: target 'libbson' referenced in product 'libbson' could not be found; valid targets are: ''
49
error: target 'libbson' referenced in product 'libbson' could not be found; valid targets are: ''
50
error: target 'libbson' referenced in product 'libbson' could not be found; valid targets are: ''
51
error: target 'libbson' referenced in product 'libbson' could not be found; valid targets are: ''
52
Computed https://github.com/mongodb/swift-bson.git at 3.0.2 (1.48s)
53
Fetching https://github.com/swift-extras/swift-extras-base64
54
Fetching https://github.com/swift-extras/swift-extras-json
55
Fetched https://github.com/swift-extras/swift-extras-json (0.21s)
56
Fetched https://github.com/swift-extras/swift-extras-base64 (0.21s)
57
Computing version for https://github.com/swift-extras/swift-extras-base64
58
error: fatalError in https://github.com/swift-extras/swift-extras-base64

issue: [SR-15764] swiftpm dependency error with all nightly docker images - Swift

I'm one of the maintainers of mongodb/swift-bson and started noticing this error in our CI testing against the development snapshots recently.

It's super puzzling because if you look at the package now there are no products/targets named bson or libbson. But... there did used to be in previous major versions -- version 1.x had a product and target named libbson and version 2.x had a product and target named bson. But you are pulling this in transitively via mongo-swift-driver which depends on 3.0.0+ so those versions shouldn't even be relevant.

This seems like it was some bug in SwiftPM's version resolution logic, that from my testing appears to fortunately be gone in the latest development snapshot from February 3.

BTW, I saw your GH Actions link from the SR issue - you shouldn't need to install libmongoc on your system to use MongoSwift anymore, the driver has included and used a vendored copy of libmongoc since its 1.0.0-rc0 release. (But you may still need to install some of libmongoc's dependencies as described here.)

Thanks for reply.
I also notices the bug was fixed with new version of docker images.

1 Like