Skip to content

Commit af0fd7a

Browse files
authored
Revert "Error on empty product names (#5805)"
This reverts commit d61b1ea.
1 parent d61b1ea commit af0fd7a

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

Sources/PackageLoading/PackageBuilder.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,13 @@ extension Target.Error.ModuleNameProblem: CustomStringConvertible {
181181
extension Product {
182182
/// An error in a product definition.
183183
enum Error: Swift.Error {
184-
case emptyName
185184
case moduleEmpty(product: String, target: String)
186185
}
187186
}
188187

189188
extension Product.Error: CustomStringConvertible {
190189
var description: String {
191190
switch self {
192-
case .emptyName:
193-
return "product names can not be empty"
194191
case .moduleEmpty(let product, let target):
195192
return "target '\(target)' referenced in product '\(product)' is empty"
196193
}
@@ -1150,10 +1147,6 @@ public final class PackageBuilder {
11501147
filteredProducts = self.manifest.products.filter { set.contains($0.name) }
11511148
}
11521149
for product in filteredProducts {
1153-
if product.name.isEmpty {
1154-
throw Product.Error.emptyName
1155-
}
1156-
11571150
let targets = try modulesFrom(targetNames: product.targets, product: product.name)
11581151
// Perform special validations if this product is exporting
11591152
// a system library target.

Tests/PackageLoadingTests/PackageBuilderTests.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -577,24 +577,6 @@ class PackageBuilderTests: XCTestCase {
577577
}
578578
}
579579

580-
func testEmptyProductNameError() throws {
581-
let fs = InMemoryFileSystem(emptyFiles: "/Sources/best/best.swift")
582-
583-
let manifest = Manifest.createRootManifest(
584-
name: "pkg",
585-
products: [
586-
try ProductDescription(name: "", type: .library(.automatic), targets: ["best"]),
587-
],
588-
targets: [
589-
try TargetDescription(name: "best"),
590-
]
591-
)
592-
593-
PackageBuilderTester(manifest, in: fs) { package, diagnostics in
594-
diagnostics.check(diagnostic: "product names can not be empty", severity: .error)
595-
}
596-
}
597-
598580
func testMultipleTestEntryPointsError() throws {
599581
let name = SwiftTarget.defaultTestEntryPointName
600582
let swift: AbsolutePath = AbsolutePath("/swift")

0 commit comments

Comments
 (0)