-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[windows] SourceKit tests with VFS fixes #28250
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
[windows] SourceKit tests with VFS fixes #28250
Conversation
@swift-ci please clean test Windows platform |
Fail for me also locally with the same
Regression.
Unrelated. Broken in master since https://ci-external.swift.org/job/oss-swift-windows-x86_64/1953/. Probably introduced in #28126 |
cc @akyrtzi |
@@ -10,7 +10,7 @@ func foo( | |||
|
|||
// CHECK-CMODULE: key.kind: source.lang.swift.ref.struct | |||
// CHECK-CMODULE: key.name: "StructDefinedInCModule" | |||
// CHECK-CMODULE: key.filepath: "/CModule/CModule.h" | |||
// CHECK-CMODULE: key.filepath: "{{.*}}/CModule{{/|\\\\}}CModule.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is one slash here always a forward slash, but the other can be a backslash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to Windows™️! :D
(Yes, one of them was a /
even on Windows, so I didn't replace it. Adding the {{.*}}
accounts for the new path relative to %t
, while the {{/|\\\\}}
accounts for an escaped \
in Windows.
@swift-ci please smoke test |
75d012a
to
6a67065
Compare
The @swift-ci please clean test Windows platform [Edit: https://ci-external.swift.org/view/Pull%20Request/job/swift-PR-windows/173/ in case it doesn't get linked below] |
@swift-ci please clean test Windows platform |
Still happening (expected)
Regression :(
Failing in master. Sigh. |
6a67065
to
97143a4
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
97143a4
to
95fb21b
Compare
@swift-ci please test Windows platform |
https://ci-external.swift.org/view/Pull%20Request/job/swift-PR-windows/177/ failed because of #28280, which is testing and I hope to land soon. Sigh. |
@swift-ci please test Windows platform |
The VFS tests were using Unix absolute paths, which does not play well when Windows see them as relative to the current drive letter. By using the temporal directory, both Windows and Unix can use the same paths and avoid the problem. Additionally, a couple of inputs have to be transformed into the native path format, because sourcekitd-test compares the inputs as strings, and they need to match exactly. So the source file and the name of the VFS entries are transformed into native using the helper from LLVM support.
95fb21b
to
a1a891e
Compare
Removed the explicit slashes in the unit test, which should make it work in both OS. @swift-ci please smoke test |
@swift-ci please test Windows platform |
1 similar comment
@swift-ci please test Windows platform |
Thanks for doing all that tedious path fiddling! |
Thanks to you for all the help! |
The VFS tests were using Unix absolute paths, which does not play well
when Windows see them as relative to the current drive letter.
By using the temporal directory, both Windows and Unix can use the same
paths and avoid the problem.
Additionally, a couple of inputs have to be transformed into the native
path format, because sourcekitd-test compares the inputs as strings, and
they need to match exactly. So the source file and the name of the VFS
entries are transformed into native using the helper from LLVM support.