Skip to content

Commit d72912a

Browse files
committed
Merge remote-tracking branch 'origin/main' into release/6.1
2 parents fb0e494 + 307316d commit d72912a

File tree

6 files changed

+34
-17
lines changed

6 files changed

+34
-17
lines changed

Sources/PackageModel/ToolsVersion.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public struct ToolsVersion: Equatable, Hashable, Codable, Sendable {
3232
public static let v5_9 = ToolsVersion(version: "5.9.0")
3333
public static let v5_10 = ToolsVersion(version: "5.10.0")
3434
public static let v6_0 = ToolsVersion(version: "6.0.0")
35+
public static let v6_1 = ToolsVersion(version: "6.1.0")
3536
public static let vNext = ToolsVersion(version: "999.0.0")
3637

3738
/// The current tools version in use.

Tests/CommandsTests/BuildCommandTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final class BuildCommandTests: CommandsTestCase {
142142
stderr.contains(
143143
"error: Target A imports another target (B) in the package without declaring it a dependency."
144144
),
145-
"got stdout: \(stdout), stderr: \(stderr)"
145+
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
146146
)
147147
}
148148
}
@@ -159,7 +159,7 @@ final class BuildCommandTests: CommandsTestCase {
159159
stderr.contains(
160160
"warning: Target A imports another target (B) in the package without declaring it a dependency."
161161
),
162-
"got stdout: \(stdout), stderr: \(stderr)"
162+
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
163163
)
164164
}
165165
}

Tests/CommandsTests/PackageCommandTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,27 +2522,27 @@ final class PackageCommandTests: CommandsTestCase {
25222522

25232523
// Overall configuration: debug, plugin build request: debug -> without testability
25242524
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2525-
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
2525+
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
25262526
}
25272527

25282528
// Overall configuration: debug, plugin build request: release -> without testability
25292529
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2530-
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
2530+
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
25312531
}
25322532

25332533
// Overall configuration: release, plugin build request: debug -> with testability
25342534
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2535-
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
2535+
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
25362536
}
25372537

25382538
// Overall configuration: release, plugin build request: release -> with testability
25392539
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2540-
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
2540+
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
25412541
}
25422542

25432543
// Overall configuration: release, plugin build request: release including tests -> with testability
25442544
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2545-
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
2545+
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
25462546
}
25472547
}
25482548

Tests/FunctionalTests/TraitTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import XCTest
1919
final class TraitTests: XCTestCase {
2020
func testTraits_whenNoFlagPassed() async throws {
2121
try await fixture(name: "Traits") { fixturePath in
22-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
22+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
2323
// We expect no warnings to be produced. Specifically no unused dependency warnings.
2424
// When fixed, GitHub issue #8131 should re-enable the below assert.
2525
// XCTAssertFalse(stderr.contains("warning:"))
@@ -38,7 +38,7 @@ final class TraitTests: XCTestCase {
3838

3939
func testTraits_whenTraitUnification() async throws {
4040
try await fixture(name: "Traits") { fixturePath in
41-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
41+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
4242
// We expect no warnings to be produced. Specifically no unused dependency warnings.
4343
// When fixed, GitHub issue #8131 should re-enable the below assert.
4444
// XCTAssertFalse(stderr.contains("warning:"))
@@ -61,7 +61,7 @@ final class TraitTests: XCTestCase {
6161

6262
func testTraits_whenTraitUnification_whenSecondTraitNotEnabled() async throws {
6363
try await fixture(name: "Traits") { fixturePath in
64-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
64+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
6565
// We expect no warnings to be produced. Specifically no unused dependency warnings.
6666
// When fixed, GitHub issue #8131 should re-enable the below assert.
6767
// XCTAssertFalse(stderr.contains("warning:"))
@@ -82,7 +82,7 @@ final class TraitTests: XCTestCase {
8282

8383
func testTraits_whenIndividualTraitsEnabled_andDefaultTraits() async throws {
8484
try await fixture(name: "Traits") { fixturePath in
85-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
85+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
8686
// We expect no warnings to be produced. Specifically no unused dependency warnings.
8787
// When fixed, GitHub issue #8131 should re-enable the below assert.
8888
// XCTAssertFalse(stderr.contains("warning:"))
@@ -119,7 +119,7 @@ final class TraitTests: XCTestCase {
119119

120120
func testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled() async throws {
121121
try await fixture(name: "Traits") { fixturePath in
122-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
122+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
123123
// We expect no warnings to be produced. Specifically no unused dependency warnings.
124124
// When fixed, GitHub issue #8131 should re-enable the below assert.
125125
// XCTAssertFalse(stderr.contains("warning:"))
@@ -137,7 +137,7 @@ final class TraitTests: XCTestCase {
137137

138138
func testTraits_whenAllTraitsEnabled() async throws {
139139
try await fixture(name: "Traits") { fixturePath in
140-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
140+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
141141
// We expect no warnings to be produced. Specifically no unused dependency warnings.
142142
// GitHub issue #8131
143143
// XCTAssertFalse(stderr.contains("warning:"))
@@ -163,7 +163,7 @@ final class TraitTests: XCTestCase {
163163

164164
func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
165165
try await fixture(name: "Traits") { fixturePath in
166-
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
166+
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
167167
// We expect no warnings to be produced. Specifically no unused dependency warnings.
168168
// GitHub issue #8131
169169
// XCTAssertFalse(stderr.contains("warning:"))

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,25 @@ final class WorkspaceTests: XCTestCase {
217217
XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("6")])
218218
}
219219

220+
do {
221+
let ws = try createWorkspace(
222+
"""
223+
// swift-tools-version:5.9.2
224+
import PackageDescription
225+
let package = Package(
226+
name: "foo"
227+
)
228+
"""
229+
)
230+
231+
XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("5")])
232+
}
233+
220234
do {
221235
// Invalid package manifest should still produce build settings.
222236
let ws = try createWorkspace(
223237
"""
224-
// swift-tools-version:999.0
238+
// swift-tools-version:5.9.2
225239
import PackageDescription
226240
"""
227241
)
@@ -4122,7 +4136,7 @@ final class WorkspaceTests: XCTestCase {
41224136
.sourceControl(url: "https://localhost/org/foo", requirement: .upToNextMajor(from: "1.0.0")),
41234137
.sourceControl(url: "https://localhost/org/bar", requirement: .upToNextMinor(from: "1.1.0"))
41244138
],
4125-
toolsVersion: .vNext // change to the one after 5.9
4139+
toolsVersion: .v5_10
41264140
),
41274141
],
41284142
packages: [
@@ -8684,7 +8698,6 @@ final class WorkspaceTests: XCTestCase {
86848698

86858699
let maxConcurrentRequests = 2
86868700
let concurrentRequests = ThreadSafeBox(0)
8687-
let concurrentRequestsLock = NSLock()
86888701

86898702
var configuration = HTTPClient.Configuration()
86908703
configuration.maxConcurrentRequests = maxConcurrentRequests

Utilities/build-using-self

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ set -x
3232

3333
env | sort
3434

35+
# Display toolchain version
36+
swift --version
37+
3538
# Perform package update in order to get the latest commits for the dependencies.
3639
swift package update
3740
swift build -c $CONFIGURATION

0 commit comments

Comments
 (0)