Skip to content

Commit 3c23f33

Browse files
authored
Revert "Add diagnostics to use module aliasing when duplicate targets found (#5606)" (#6961)
This reverts commit 33e05c7. We should not make this suggestion without better contextual awareness because it can often be confusing, e.g. when someone is already using a module alias in a case where it isn't supposed to work (see #6841). If we could find a way to confidently make the suggestion, we could bring it back, but currently it can be more confusing than not.
1 parent cb57dee commit 3c23f33

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/PackageLoading/PackageBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension ModuleError: CustomStringConvertible {
9898
switch self {
9999
case .duplicateModule(let target, let packages):
100100
let packages = packages.map(\.description).sorted().joined(separator: "', '")
101-
return "multiple targets named '\(target)' in: '\(packages)'; consider using the `moduleAliases` parameter in manifest to provide unique names"
101+
return "multiple targets named '\(target)' in: '\(packages)'"
102102
case .moduleNotFound(let target, let type, let shouldSuggestRelaxedSourceDir):
103103
let folderName = (type == .test) ? "Tests" : (type == .plugin) ? "Plugins" : "Sources"
104104
var clauses = ["Source files for target \(target) should be located under '\(folderName)/\(target)'"]

Tests/PackageGraphTests/PackageGraphTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ class PackageGraphTests: XCTestCase {
337337
)
338338

339339
testDiagnostics(observability.diagnostics) { result in
340-
result.check(diagnostic: "multiple targets named 'Bar' in: 'bar', 'foo'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
340+
result.check(diagnostic: "multiple targets named 'Bar' in: 'bar', 'foo'", severity: .error)
341341
}
342342
}
343343

@@ -396,7 +396,7 @@ class PackageGraphTests: XCTestCase {
396396
)
397397

398398
testDiagnostics(observability.diagnostics) { result in
399-
result.check(diagnostic: "multiple targets named 'First' in: 'first', 'fourth', 'second', 'third'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
399+
result.check(diagnostic: "multiple targets named 'First' in: 'first', 'fourth', 'second', 'third'", severity: .error)
400400
}
401401
}
402402

@@ -466,8 +466,8 @@ class PackageGraphTests: XCTestCase {
466466
)
467467

468468
testDiagnostics(observability.diagnostics) { result in
469-
result.checkUnordered(diagnostic: "multiple targets named 'Bar' in: 'fourth', 'third'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
470-
result.checkUnordered(diagnostic: "multiple targets named 'Foo' in: 'first', 'second'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
469+
result.checkUnordered(diagnostic: "multiple targets named 'Bar' in: 'fourth', 'third'", severity: .error)
470+
result.checkUnordered(diagnostic: "multiple targets named 'Foo' in: 'first', 'second'", severity: .error)
471471
}
472472
}
473473

@@ -535,7 +535,7 @@ class PackageGraphTests: XCTestCase {
535535
)
536536

537537
testDiagnostics(observability.diagnostics) { result in
538-
result.check(diagnostic: "multiple targets named 'First' in: 'first', 'fourth'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
538+
result.check(diagnostic: "multiple targets named 'First' in: 'first', 'fourth'", severity: .error)
539539
}
540540
}
541541

@@ -1255,7 +1255,7 @@ class PackageGraphTests: XCTestCase {
12551255
)
12561256

12571257
testDiagnostics(observability.diagnostics) { result in
1258-
result.check(diagnostic: "multiple targets named 'Foo' in: 'dep2', 'start'; consider using the `moduleAliases` parameter in manifest to provide unique names", severity: .error)
1258+
result.check(diagnostic: "multiple targets named 'Foo' in: 'dep2', 'start'", severity: .error)
12591259
}
12601260
}
12611261

0 commit comments

Comments
 (0)