IBM-Swift/LoggerAPI has added a dependency on apple/swift-log in version 1.9.0. This unfortunately creates a clash with an existing module named Logging
in vapor/console 3.0.0 and later.
If you use IBM / Kitura packages that depend on LoggerAPI
with Vapor 3, you may see the following error while compiling:
error: multiple products named 'Logging' in: Console, swift-log
error: multiple targets named 'Logging' in: Console, swift-log
Solution 1: Rename Vapor's Logging module
I've opened a pull request here with a potential fix to this issue that renames Vapor's Logging
module to LoggingKit
:
https://github.com/vapor/console-kit/pull/114
This however is a breaking change itself and has the potential to cause projects based on Vapor 3 or community packages to stop compiling.
We can patch these issues quickly as they arise, but it's possible this process would end up negatively affecting more users than the current issue.
Solution 2: Pin to Logger API < 1.9.0
Another solution to this issue is for Vapor 3 projects to pin their LoggerAPI versions to < 1.9.0. This can be done with the following addition to Package.swift
:
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", .upToNextMinor(from: "1.8.0"))
There have already been a couple cases in http://vapor.team of people hitting this issue.
We're wondering if trying solution 1, which could potentially solve the issue or cause more breakages, is worth it. Or, if solution 2 will be fine for those who use Kitura packages alongside Vapor 3.
Any feedback you have on this would be great. Thanks!