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
relax strickter validation to warning to allow transition (#3713)
motivation: recent change to SwiftPM introduced strickter validation of dependencies uniquness to address undefined behavior. however, we want to allow users some times to adjust before making a breaking change
changes: update the validation to emit a warning instead of error under the specific condition the previous behavior incorrectly ignored!
diagnostics.emit(.warning(error.description +". this will be upgraded to an error in future versions of SwiftPM."), location:package.diagnosticLocation)
workspace.checkPackageGraph(roots:["Root"]){ graph, diagnostics in
5775
+
DiagnosticsEngineTester(diagnostics){ result in
5776
+
result.check(
5777
+
diagnostic:"'root' dependency on '/tmp/ws/pkgs/bar/utility' conflicts with dependency on '/tmp/ws/pkgs/foo/utility' which has the same identity 'utility'",
@@ -6337,12 +6397,19 @@ final class WorkspaceTests: XCTestCase {
6337
6397
]
6338
6398
)
6339
6399
6340
-
// FIXME: rdar://72940946
6341
-
// we need to improve this situation or diagnostics when working on identity
6400
+
// 9/2021 this is currently emitting a warning only to support backwards compatibility
6401
+
// we will upgrade this to an error in a few versions to tighten up the validation
6342
6402
workspace.checkPackageGraph(roots:["Root"]){ graph, diagnostics in
6343
6403
DiagnosticsEngineTester(diagnostics){ result in
6344
6404
result.check(
6345
-
diagnostic:"product 'OtherUtilityProduct' required by package 'bar' target 'BarTarget' not found in package 'OtherUtilityPackage'.",
6405
+
diagnostic:"'bar' dependency on '/tmp/ws/pkgs/other-foo/utility' conflicts with dependency on '/tmp/ws/pkgs/foo/utility' which has the same identity 'utility'. this will be upgraded to an error in future versions of SwiftPM.",
6406
+
behavior:.warning,
6407
+
location:"'BarPackage' /tmp/ws/pkgs/bar"
6408
+
)
6409
+
// FIXME: rdar://72940946
6410
+
// we need to improve this situation or diagnostics when working on identity
6411
+
result.check(
6412
+
diagnostic:"product 'OtherUtilityProduct' required by package 'bar' target 'BarTarget' not found in package 'utility'.",
6346
6413
behavior:.error,
6347
6414
location:"'BarPackage' /tmp/ws/pkgs/bar"
6348
6415
)
@@ -6420,10 +6487,10 @@ final class WorkspaceTests: XCTestCase {
6420
6487
]
6421
6488
)
6422
6489
6423
-
// FIXME: rdar://72940946
6424
-
// we need to improve this situation or diagnostics when working on identity
6425
6490
workspace.checkPackageGraph(roots:["Root"]){ graph, diagnostics in
6426
6491
DiagnosticsEngineTester(diagnostics){ result in
6492
+
// FIXME: rdar://72940946
6493
+
// we need to improve this situation or diagnostics when working on identity
0 commit comments