You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PackageGraph] Allow package-level cyclic dependency only for >= 6.0 … (#7579)
…manifests
### Motivation:
Follow-up to #7530
Otherwise it might be suprising for package authors to discover that
their packages cannot be used with older tools because they
inadvertently introduced a cyclic dependency in a new version.
### Modifications:
`ModulesGraph.load` has been adjusted to run `findCycle` some of the
root manifests support tools version that is older than 6.0. New
diagnostic was added to help guide package authors to update their
versions if they have cyclic package-level dependencies.
### Result:
Attempts to introduce cyclic package-level dependencies to manifests
that support tools-versions less than 6.0 would result in a failure.
Copy file name to clipboardExpand all lines: Tests/WorkspaceTests/WorkspaceTests.swift
+3-7
Original file line number
Diff line number
Diff line change
@@ -11061,7 +11061,7 @@ final class WorkspaceTests: XCTestCase {
11061
11061
requirement: .upToNextMajor(from: "1.0.0")
11062
11062
),
11063
11063
],
11064
-
toolsVersion: .v5
11064
+
toolsVersion: .v6_0
11065
11065
),
11066
11066
],
11067
11067
packages: [
@@ -11209,11 +11209,7 @@ final class WorkspaceTests: XCTestCase {
11209
11209
// FIXME: rdar://72940946
11210
11210
// we need to improve this situation or diagnostics when working on identity
11211
11211
result.check(
11212
-
diagnostic: "'bar' dependency on '/tmp/ws/pkgs/other/utility' conflicts with dependency on '/tmp/ws/pkgs/foo/utility' which has the same identity 'utility'. this will be escalated to an error in future versions of SwiftPM.",
11213
-
severity: .warning
11214
-
)
11215
-
result.check(
11216
-
diagnostic: "product 'OtherUtilityProduct' required by package 'bar' target 'BarTarget' not found in package 'OtherUtilityPackage'.",
11212
+
diagnostic: "cyclic dependency between packages Root -> FooUtilityPackage -> BarPackage -> FooUtilityPackage requires tools-version 6.0 or later",
11217
11213
severity: .error
11218
11214
)
11219
11215
}
@@ -11244,7 +11240,7 @@ final class WorkspaceTests: XCTestCase {
0 commit comments