Skip to content

Commit eba6e97

Browse files
committed
Adjust to SE-0305: Adjust suffixes for artifact bundles and artifact indices
1 parent 39a8e7f commit eba6e97

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

Fixtures/Miscellaneous/Plugins/MyBinaryToolPlugin/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let package = Package(
2222
// The vended executable that generates source files.
2323
.binaryTarget(
2424
name: "MyVendedSourceGenBuildTool",
25-
path: "Binaries/MyVendedSourceGenBuildTool.arar"
25+
path: "Binaries/MyVendedSourceGenBuildTool.artifactbundle"
2626
),
2727
]
2828
)

Sources/PackageModel/Target.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ public final class BinaryTarget: Target {
547547
case .xcframework:
548548
return "xcframework"
549549
case .artifactsArchive:
550-
return "arar"
550+
return "artifactbundle"
551551
}
552552
}
553553

Sources/Workspace/Workspace.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,11 +1593,11 @@ extension Workspace {
15931593
let authProvider: AuthorizationProviding? = try? Netrc.load(fromFileAtPath: netrcFilePath).get()
15941594

15951595
// zip files to download
1596-
// stored in a thread-safe way as we may fetch more from "ari" files
1596+
// stored in a thread-safe way as we may fetch more from "artifactbundleindex" files
15971597
let zipArtifacts = ThreadSafeArrayStore<RemoteArtifact>(artifacts.filter { $0.url.pathExtension.lowercased() == "zip" })
15981598

1599-
// fetch and parse "ari" files, if any
1600-
let indexFiles = artifacts.filter { $0.url.pathExtension.lowercased() == "ari" }
1599+
// fetch and parse "artifactbundleindex" files, if any
1600+
let indexFiles = artifacts.filter { $0.url.pathExtension.lowercased() == "artifactbundleindex" }
16011601
if !indexFiles.isEmpty {
16021602
let hostToolchain = try UserToolchain(destination: .hostDestination())
16031603
let jsonDecoder = JSONDecoder.makeWithDefaults()
@@ -1642,7 +1642,7 @@ extension Workspace {
16421642
}
16431643
}
16441644

1645-
// wait for all "ari" files to be processed
1645+
// wait for all "artifactbundleindex" files to be processed
16461646
group.wait()
16471647

16481648
// no reason to continue if we already ran into issues

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ final class BuildPlanTests: XCTestCase {
26722672
let fs = InMemoryFileSystem(emptyFiles: "/Pkg/Sources/exe/main.swift")
26732673

26742674
let artifactName = "my-tool"
2675-
let toolPath = AbsolutePath("/Pkg/MyTool.arar")
2675+
let toolPath = AbsolutePath("/Pkg/MyTool.artifactbundle")
26762676
try fs.createDirectory(toolPath, recursive: true)
26772677

26782678
try fs.writeFileContents(
@@ -2710,7 +2710,7 @@ final class BuildPlanTests: XCTestCase {
27102710
],
27112711
targets: [
27122712
TargetDescription(name: "exe", dependencies: ["MyTool"]),
2713-
TargetDescription(name: "MyTool", path: "MyTool.arar", type: .binary),
2713+
TargetDescription(name: "MyTool", path: "MyTool.artifactbundle", type: .binary),
27142714
]
27152715
),
27162716
],

Tests/PackageLoadingTests/PD5_3LoadingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class PackageDescription5_3LoadingTests: PackageDescriptionLoadingTests {
250250
"""
251251

252252
XCTAssertManifestLoadThrows(stream.bytes) { _, diagnostics in
253-
diagnostics.check(diagnostic: "unsupported extension for binary target 'Foo'; valid extensions are: 'xcframework', 'arar'", behavior: .error)
253+
diagnostics.check(diagnostic: "unsupported extension for binary target 'Foo'; valid extensions are: 'xcframework', 'artifactbundle'", behavior: .error)
254254
}
255255
}
256256

@@ -293,7 +293,7 @@ class PackageDescription5_3LoadingTests: PackageDescriptionLoadingTests {
293293
"""
294294

295295
XCTAssertManifestLoadThrows(stream.bytes) { _, diagnostics in
296-
diagnostics.check(diagnostic: "unsupported extension for binary target 'Foo'; valid extensions are: 'xcframework', 'arar'", behavior: .error)
296+
diagnostics.check(diagnostic: "unsupported extension for binary target 'Foo'; valid extensions are: 'xcframework', 'artifactbundle'", behavior: .error)
297297
}
298298
}
299299

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4914,9 +4914,9 @@ final class WorkspaceTests: XCTestCase {
49144914
do {
49154915
let contents: String
49164916
switch request.url.lastPathComponent {
4917-
case "a1.ari":
4917+
case "a1.artifactbundleindex":
49184918
contents = ariFiles[0]
4919-
case "a2.ari":
4919+
case "a2.artifactbundleindex":
49204920
contents = ariFiles[1]
49214921
default:
49224922
throw StringError("unexpected url \(request.url)")
@@ -4959,11 +4959,11 @@ final class WorkspaceTests: XCTestCase {
49594959
let name: String
49604960
switch archivePath.basename {
49614961
case "a1.zip":
4962-
name = "A1.arar"
4962+
name = "A1.artifactbundle"
49634963
case "a2.zip":
4964-
name = "A2.arar"
4964+
name = "A2.artifactbundle"
49654965
case "b.zip":
4966-
name = "B.arar"
4966+
name = "B.artifactbundle"
49674967
default:
49684968
throw StringError("unexpected archivePath \(archivePath)")
49694969
}
@@ -5005,13 +5005,13 @@ final class WorkspaceTests: XCTestCase {
50055005
MockTarget(
50065006
name: "A1",
50075007
type: .binary,
5008-
url: "https://a.com/a1.ari",
5008+
url: "https://a.com/a1.artifactbundleindex",
50095009
checksum: ariFilesChecksums[0]
50105010
),
50115011
MockTarget(
50125012
name: "A2",
50135013
type: .binary,
5014-
url: "https://a.com/a2.ari",
5014+
url: "https://a.com/a2.artifactbundleindex",
50155015
checksum: ariFilesChecksums[1]
50165016
)
50175017
],
@@ -5077,23 +5077,23 @@ final class WorkspaceTests: XCTestCase {
50775077
url: "https://a.com/a1.zip",
50785078
checksum: "a1"
50795079
),
5080-
path: workspace.artifactsDir.appending(components: "A", "A1.arar")
5080+
path: workspace.artifactsDir.appending(components: "A", "A1.artifactbundle")
50815081
)
50825082
result.check(packageName: "A",
50835083
targetName: "A2",
50845084
source: .remote(
50855085
url: "https://a.com/a2/a2.zip",
50865086
checksum: "a2"
50875087
),
5088-
path: workspace.artifactsDir.appending(components: "A", "A2.arar")
5088+
path: workspace.artifactsDir.appending(components: "A", "A2.artifactbundle")
50895089
)
50905090
result.check(packageName: "B",
50915091
targetName: "B",
50925092
source: .remote(
50935093
url: "https://b.com/b.zip",
50945094
checksum: "b0"
50955095
),
5096-
path: workspace.artifactsDir.appending(components: "B", "B.arar")
5096+
path: workspace.artifactsDir.appending(components: "B", "B.artifactbundle")
50975097
)
50985098
}
50995099
}
@@ -5127,7 +5127,7 @@ final class WorkspaceTests: XCTestCase {
51275127
MockPackage(
51285128
name: "A",
51295129
targets: [
5130-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: "does-not-matter"),
5130+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: "does-not-matter"),
51315131
],
51325132
products: [
51335133
MockProduct(name: "A", targets: ["A"]),
@@ -5139,7 +5139,7 @@ final class WorkspaceTests: XCTestCase {
51395139

51405140
workspace.checkPackageGraphFailure(roots: ["Foo"]) { diagnostics in
51415141
DiagnosticsEngineTester(diagnostics) { result in
5142-
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.ari': badResponseStatusCode(500)"), behavior: .error)
5142+
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.artifactbundleindex': badResponseStatusCode(500)"), behavior: .error)
51435143
}
51445144
}
51455145
}
@@ -5169,7 +5169,7 @@ final class WorkspaceTests: XCTestCase {
51695169
do {
51705170
let contents: String
51715171
switch request.url.lastPathComponent {
5172-
case "a.ari":
5172+
case "a.artifactbundleindex":
51735173
contents = ari
51745174
default:
51755175
throw StringError("unexpected url \(request.url)")
@@ -5200,7 +5200,7 @@ final class WorkspaceTests: XCTestCase {
52005200
MockPackage(
52015201
name: "A",
52025202
targets: [
5203-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: "incorrect"),
5203+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: "incorrect"),
52045204
],
52055205
products: [
52065206
MockProduct(name: "A", targets: ["A"]),
@@ -5212,7 +5212,7 @@ final class WorkspaceTests: XCTestCase {
52125212

52135213
workspace.checkPackageGraphFailure(roots: ["Foo"]) { diagnostics in
52145214
DiagnosticsEngineTester(diagnostics) { result in
5215-
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.ari': checksum of downloaded artifact of binary target 'A' (\(ariChecksums)) does not match checksum specified by the manifest (incorrect)"), behavior: .error)
5215+
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.artifactbundleindex': checksum of downloaded artifact of binary target 'A' (\(ariChecksums)) does not match checksum specified by the manifest (incorrect)"), behavior: .error)
52165216
}
52175217
}
52185218
}
@@ -5240,7 +5240,7 @@ final class WorkspaceTests: XCTestCase {
52405240
MockPackage(
52415241
name: "A",
52425242
targets: [
5243-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: "a"),
5243+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: "a"),
52445244
],
52455245
products: [
52465246
MockProduct(name: "A", targets: ["A"]),
@@ -5266,7 +5266,7 @@ final class WorkspaceTests: XCTestCase {
52665266
packageRef: aRef,
52675267
targetName: "A",
52685268
source: .remote(
5269-
url: "https://a.com/a.ari",
5269+
url: "https://a.com/a.artifactbundleindex",
52705270
checksum: "old-checksum"
52715271
),
52725272
path: workspace.packagesDir.appending(components: "A", "A.xcframework")
@@ -5308,7 +5308,7 @@ final class WorkspaceTests: XCTestCase {
53085308
do {
53095309
let contents: String
53105310
switch request.url.lastPathComponent {
5311-
case "a.ari":
5311+
case "a.artifactbundleindex":
53125312
contents = ari
53135313
default:
53145314
throw StringError("unexpected url \(request.url)")
@@ -5346,7 +5346,7 @@ final class WorkspaceTests: XCTestCase {
53465346
let name: String
53475347
switch archivePath.basename {
53485348
case "a.zip":
5349-
name = "A.arar"
5349+
name = "A.artifactbundle"
53505350
default:
53515351
throw StringError("unexpected archivePath \(archivePath)")
53525352
}
@@ -5380,7 +5380,7 @@ final class WorkspaceTests: XCTestCase {
53805380
MockPackage(
53815381
name: "A",
53825382
targets: [
5383-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: ariChecksums),
5383+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: ariChecksums),
53845384
],
53855385
products: [
53865386
MockProduct(name: "A", targets: ["A"]),
@@ -5424,7 +5424,7 @@ final class WorkspaceTests: XCTestCase {
54245424
do {
54255425
let contents: String
54265426
switch request.url.lastPathComponent {
5427-
case "a.ari":
5427+
case "a.artifactbundleindex":
54285428
contents = ari
54295429
default:
54305430
throw StringError("unexpected url \(request.url)")
@@ -5458,7 +5458,7 @@ final class WorkspaceTests: XCTestCase {
54585458
MockPackage(
54595459
name: "A",
54605460
targets: [
5461-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: ariChecksums),
5461+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: ariChecksums),
54625462
],
54635463
products: [
54645464
MockProduct(name: "A", targets: ["A"]),
@@ -5503,7 +5503,7 @@ final class WorkspaceTests: XCTestCase {
55035503
do {
55045504
let contents: String
55055505
switch request.url.lastPathComponent {
5506-
case "a.ari":
5506+
case "a.artifactbundleindex":
55075507
contents = ari
55085508
default:
55095509
throw StringError("unexpected url \(request.url)")
@@ -5534,7 +5534,7 @@ final class WorkspaceTests: XCTestCase {
55345534
MockPackage(
55355535
name: "A",
55365536
targets: [
5537-
MockTarget(name: "A", type: .binary, url: "https://a.com/a.ari", checksum: ariChecksum),
5537+
MockTarget(name: "A", type: .binary, url: "https://a.com/a.artifactbundleindex", checksum: ariChecksum),
55385538
],
55395539
products: [
55405540
MockProduct(name: "A", targets: ["A"]),
@@ -5546,7 +5546,7 @@ final class WorkspaceTests: XCTestCase {
55465546

55475547
workspace.checkPackageGraphFailure(roots: ["Foo"]) { diagnostics in
55485548
DiagnosticsEngineTester(diagnostics) { result in
5549-
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.ari': No supported archive was found for '\(hostToolchain.triple.tripleString)'"), behavior: .error)
5549+
result.check(diagnostic: .contains("failed retrieving 'https://a.com/a.artifactbundleindex': No supported archive was found for '\(hostToolchain.triple.tripleString)'"), behavior: .error)
55505550
}
55515551
}
55525552
}

0 commit comments

Comments
 (0)