Hello!
When I add a specific dependency to my Package.swift (GitHub - hectr/swift-http-client: [wip] Declarative HTTP endpoints for Swift) file, SPM stops working (It cannot resolve package dependencies):
$ swift package resolve
Fatal error: 'try!' expression unexpectedly raised an error: TSCBasic.GraphError.unexpectedCycle: file /Library/Caches/com.apple.xbs/Sources/swiftpm/swiftpm-16074/Sources/Workspace/Workspace.swift, line 1112
zsh: illegal hardware instruction swift package resolve
I attempted to use the dependency using a tag, the branch name and a local folder in my machine, but the outcome was the same. Renaming the library didn't help either.
The minimal Package.swift file that reproduces the crash is this:
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "Package",
platforms: [
.iOS(.v10),
],
products: [],
dependencies: [
.package(url: "https://github.com/hectr/swift-http-client.git", .branch("master")),
],
targets: [],
swiftLanguageVersions: [.v5]
)
I have already reported this issue as a bug: [SR-12482] SwiftPM cannot resolve package dependencies and crashes Xcode · Issue #4570 · apple/swift-package-manager · GitHub
Does anyone know what can I do differently to avoid this problem?
Thank you,
Hèctor