Skip to content

[DNM] Check if development matters for source compat #8211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Sources/PackageModel/ToolsVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public struct ToolsVersion: Equatable, Hashable, Codable, Sendable {
public static let v5_9 = ToolsVersion(version: "5.9.0")
public static let v5_10 = ToolsVersion(version: "5.10.0")
public static let v6_0 = ToolsVersion(version: "6.0.0")
public static let v6_1 = ToolsVersion(version: "6.1.0")
public static let vNext = ToolsVersion(version: "999.0.0")

/// The current tools version in use.
Expand Down
4 changes: 2 additions & 2 deletions Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class BuildCommandTests: CommandsTestCase {
stderr.contains(
"error: Target A imports another target (B) in the package without declaring it a dependency."
),
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
"got stdout: \(stdout), stderr: \(stderr)"
)
}
}
Expand All @@ -159,7 +159,7 @@ final class BuildCommandTests: CommandsTestCase {
stderr.contains(
"warning: Target A imports another target (B) in the package without declaring it a dependency."
),
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
"got stdout: \(stdout), stderr: \(stderr)"
)
}
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/CommandsTests/PackageCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2522,27 +2522,27 @@ final class PackageCommandTests: CommandsTestCase {

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

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

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

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

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

Expand Down
14 changes: 7 additions & 7 deletions Tests/FunctionalTests/TraitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import XCTest
final class TraitTests: XCTestCase {
func testTraits_whenNoFlagPassed() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -38,7 +38,7 @@ final class TraitTests: XCTestCase {

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

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

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

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

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

func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// GitHub issue #8131
// XCTAssertFalse(stderr.contains("warning:"))
Expand Down
19 changes: 3 additions & 16 deletions Tests/WorkspaceTests/WorkspaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,11 @@ final class WorkspaceTests: XCTestCase {
XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("6")])
}

do {
let ws = try createWorkspace(
"""
// swift-tools-version:5.9.2
import PackageDescription
let package = Package(
name: "foo"
)
"""
)

XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("5")])
}

do {
// Invalid package manifest should still produce build settings.
let ws = try createWorkspace(
"""
// swift-tools-version:5.9.2
// swift-tools-version:999.0
import PackageDescription
"""
)
Expand Down Expand Up @@ -4136,7 +4122,7 @@ final class WorkspaceTests: XCTestCase {
.sourceControl(url: "https://localhost/org/foo", requirement: .upToNextMajor(from: "1.0.0")),
.sourceControl(url: "https://localhost/org/bar", requirement: .upToNextMinor(from: "1.1.0"))
],
toolsVersion: .v5_10
toolsVersion: .vNext // change to the one after 5.9
),
],
packages: [
Expand Down Expand Up @@ -8698,6 +8684,7 @@ final class WorkspaceTests: XCTestCase {

let maxConcurrentRequests = 2
let concurrentRequests = ThreadSafeBox(0)
let concurrentRequestsLock = NSLock()

var configuration = HTTPClient.Configuration()
configuration.maxConcurrentRequests = maxConcurrentRequests
Expand Down
3 changes: 0 additions & 3 deletions Utilities/build-using-self
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ set -x

env | sort

# Display toolchain version
swift --version

# Perform package update in order to get the latest commits for the dependencies.
swift package update
swift build -c $CONFIGURATION
Expand Down