Skip to content

Conversation

@daveinglis
Copy link
Contributor

Fix various tests so they pass on Windows

basename = String(basename.dropLast(4))
}
if basename == "/" {
if basename == "/" || basename == "\\" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a single central variable that is an array of the possible path separators for the host.

See https://github.com/swiftlang/swift-build/blob/bc2e7d92d36caed0399f64594b9e5518b2f83731/Sources/SWBUtil/Path.swift#L69 for example.

There might already be one in the SwiftPM codebase somewhere, or in TSC.

Also, this part of the logic should probably be constrained to file URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I couldn't find a central definition for path separators like whats in swift-build, and it looks like from this https://github.com/swiftlang/swift-package-manager/pull/6706/files we moved away from URL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like python's take on the separator by storing in a variable. e.g.: os.sep. Should we consider something similar for Swift?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If by "for Swift" you mean the Swift standard library, I don't think it's appropriate for the stdlib to be aware of the concept of filesystems and file paths. Maybe a SwiftSystem API.

@daveinglis daveinglis force-pushed the test_fixes branch 2 times, most recently from fb81f29 to 12e88df Compare November 24, 2025 15:37
Copy link
Contributor

@bkhouri bkhouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see tests being enabled for Windows!

basename = String(basename.dropLast(4))
}
if basename == "/" {
if basename == "/" || basename == "\\" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like python's take on the separator by storing in a variable. e.g.: os.sep. Should we consider something similar for Swift?

}
} when: {
ProcessInfo.isHostAmazonLinux2()
ProcessInfo.isHostAmazonLinux2() //rdar://134238535
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: can we references a GitHub issue instead?

await XCTAssertBuilds(
fixturePath,
Xswiftc: ["-warnings-as-errors"],
buildSystem: .native,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: this suite is verifying the native build system. can we migrate this suite to SwiftTesting and ensure we verify the SwiftBuild build system too?

This comment applies to all applicable XCTestCase

@daveinglis daveinglis force-pushed the test_fixes branch 3 times, most recently from dfe2626 to e34946e Compare December 1, 2025 15:41
@daveinglis daveinglis force-pushed the test_fixes branch 2 times, most recently from 8165ac5 to 9fa1a90 Compare December 3, 2025 21:18
@daveinglis daveinglis marked this pull request as ready for review December 4, 2025 19:34
@daveinglis daveinglis force-pushed the test_fixes branch 2 times, most recently from ec9ffa3 to c4caddd Compare December 5, 2025 12:26
@daveinglis daveinglis enabled auto-merge (squash) December 5, 2025 13:45
@daveinglis daveinglis force-pushed the test_fixes branch 8 times, most recently from 167515e to 6958b5f Compare December 10, 2025 14:58
@daveinglis daveinglis force-pushed the test_fixes branch 3 times, most recently from e4f8614 to 13c0be3 Compare December 11, 2025 14:54
@swiftlang swiftlang deleted a comment from rconnell9 Dec 11, 2025
@swiftlang swiftlang deleted a comment from rconnell9 Dec 11, 2025
@daveinglis daveinglis force-pushed the test_fixes branch 5 times, most recently from 4e17075 to e77d891 Compare December 12, 2025 19:09
@swiftlang swiftlang deleted a comment from rconnell9 Dec 12, 2025
@swiftlang swiftlang deleted a comment from rconnell9 Dec 12, 2025
@swiftlang swiftlang deleted a comment from rconnell9 Dec 12, 2025
@daveinglis daveinglis force-pushed the test_fixes branch 3 times, most recently from d7dc932 to 33dba80 Compare December 16, 2025 17:06
- also mark withKnownIssues tests as isIntermittent: true so that as we
  fix things in dependent packages (like swift-build) we don't break
  swiftPM CI

- serializing some test that change cwd to hopefully fix the AL2
  crashes where the CWD has been deleted and calls to get CWD returns
  nil
@daveinglis
Copy link
Contributor Author

@swift-ci test

@daveinglis
Copy link
Contributor Author

@swift-ci test windows

@bkhouri
Copy link
Contributor

bkhouri commented Dec 17, 2025

@swift-ci test windows

@daveinglis daveinglis merged commit 757bfd3 into swiftlang:main Dec 18, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants