Closed stephencelis closed 2 months ago
I was coming here to report the same thing. Adding another Package.swift
in case it can help resolve the issue.
The following package fails to resolve:
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "ReproSPMBug",
products: [
],
dependencies: [
.package(
url: "https://github.com/abidon/Mockable.git",
branch: "2d1a7a48665b2719f3abf812ac97f4daf23685a8"
),
.package(
url: "https://github.com/apple/swift-testing.git",
exact: "0.10.0"
),
.package(
url: "https://github.com/pointfreeco/swift-dependencies.git",
exact: "1.3.1"
),
]
)
Adding or removing the swiftLanguageVersions: [.v6]
parameter doesn't seem to have an impact in this case.
I expect the package to resolve in both Swift 5 and 6 language modes.
Failure to resolve:
InternalError(description: "Internal error. Please file a bug at https://github.com/apple/swift-package-manager/issues with this info. Expected root cause {swift-dependencies[everything] 1.3.1, ¬swift-syntax[everything] 509.0.0..<601.0.0} to almost satisfy the current partial solution:\n [Decision 0: repro-spm-bug[everything] 1.0.0]\n [Derivation: swift-syntax[everything] 600.0.0-latest..<601.0.0 ← {repro-spm-bug[everything] 1.0.0, ¬swift-syntax[everything] 600.0.0-latest..<601.0.0}]\n [Derivation: swift-dependencies[everything] 1.3.1 ← {repro-spm-bug[everything] 1.0.0, ¬swift-dependencies[everything] 1.3.1}]\n [Derivation: swift-testing[everything] 0.10.0 ← {repro-spm-bug[everything] 1.0.0, ¬swift-testing[everything] 0.10.0}]\n")
Create a new package with the above Package.swift file.
Swift Package Manager - Swift 6.0.0-dev (Xcode 16 beta 1)
MacOS 15.0 Beta (24A5264n) // Xcode 16.0 Beta (16A5171c)
swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10) Target: arm64-apple-macosx15.0 Darwin Beam.local 24.0.0 Darwin Kernel Version 24.0.0: Thu May 30 21:30:12 PDT 2024; root:xnu-11215.0.31.511.2~1/RELEASE_ARM64_T6000 arm64
Looks like the problem here is not 6.0 but the fast that one of the depedencies is using -latest
now. There is a Swift forums thread about this behavior - https://forums.swift.org/t/what-does-this-dependency-resolution-error-mean/72278/8
Looks like this is partly intentional
But I believe the InternalError
is still considered a bug — the diagnostic here should be better. Possibly related to TSCUtility.Version.<
and Range<Version>.contains
(overload defined in TSCUtility
) having different version ordering semantics?
But removing the
swiftLanguageVersions
parameter causes it to resolve just fine.
I don't find this to be the case, removing swiftLanguageVersions
has no effect with swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a
.
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?Description
The following package fails to resolve:
But removing the
swiftLanguageVersions
parameter causes it to resolve just fine.Expected behavior
I expect the package to resolve in both Swift 5 and 6 language modes.
Actual behavior
Failure to resolve:
Steps to reproduce
Create a new package with the above Package.swift file, or simply download and open FigureOutDependencies.zip.
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.0.0-dev (Xcode 16 beta 1)
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10) Target: arm64-apple-macosx14.0 Darwin MacBook-Pro.lan 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64