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
Fixing driver tests on Windows #20209
Conversation
The path separator changes are great. We are going to need a bunch of that in the debug info tests as we check the emitted paths. Why the change from swift to swiftc.EXE? |
CC: @jrose-apple |
Thanks for doing this!
Since you missed a few and things are still passing, I question whether we actually need this! At least for inputs to swiftc and other LLVMish tools.
I'm guessing this is because |
Yeah, not all the paths need changing. Swift for the most parts doesn't seem to have too many issues with backslashes. I think mostly just the ones that get written to On windows, %target-swiftc_driver gets resolved to "swiftc.EXE", e.g.
which then gets used in the rest of the driver. Checking for c.EXE was just the easiest fix. |
2a6e035
to
358162e
Compare
d740106
to
4bbcf0d
Compare
@jrose-apple also note that things aren't really passing from the perspective of the unit tests. There are a bunch of failing tests still. |
4bbcf0d
to
bd1dead
Compare
The conversions from e.g. |
@jrose-apple no, just for ones that print paths to .json files since the backslashes are invalid without escaping. It's possible I added a few where they weren't strictly needed though. |
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.
Thanks for the explanation! Here are a few more specific questions I had, then.
@@ -1,3 +1,4 @@ | |||
// UNSUPPORTED: win32 |
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 this one unsupported on Windows?
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.
This one uses driver-use-frontend-path, see also #21052
@@ -1,3 +1,4 @@ | |||
// UNSUPPORTED: win32 |
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.
I don't think this can both be unsupported on Windows and have slash changes.
// CHECK: "{{[^"]*[/\\]}}Module2.swiftmodule" | ||
// CHECK: "{{[^"]*[/\\]}}Module.swiftmodule" | ||
// CHECK: "{{[^"]*[/\\]}}Swift.swiftmodule" | ||
// CHECK: "{{[^"]*[/\\]}}SwiftOnoneSupport.swiftmodule" |
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.
This looks incorrect; this file is supposed to be JSON, right?
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.
Should be correct, it's looking for either a forwards or backslash, on windows the backslash gets escaped, so it'll be something like filepath\\Module2.swiftmodule
which should match
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.
Right, but the pattern you provided isn't checking for \\
because that's a character class.
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.
Oh, I guess it happens to work anyway because of the preceding character class. Okay.
test/Driver/parseable_output.swift
Outdated
@@ -1,44 +1,42 @@ | |||
// RUN: %swiftc_driver_plain -emit-executable %s -o %t.out -emit-module -emit-module-path %t.swiftmodule -emit-objc-header-path %t.h -serialize-diagnostics -emit-dependencies -parseable-output -driver-skip-execution 2>&1 | %FileCheck %s | |||
|
|||
// XFAIL: freebsd, linux |
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.
Does this work now?
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.
Nope :( That shouldn't have been removed. I've added it back.
test/Driver/response-file.swift
Outdated
@@ -1,5 +1,5 @@ | |||
// RUN: echo "-DTEST0" > %t.0.resp | |||
// RUN: %target-build-swift -typecheck @%t.0.resp %s 2>&1 | %FileCheck %s -check-prefix=SHORT | |||
// RUN: %target-build-swift -typecheck %s @%/t.0.resp 2>&1 | %FileCheck %s -check-prefix=SHORT |
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.
I don't think this one would matter?
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.
Yup, it doesn't. I'll remove it. It's broken because response files don't work on windows right now, not because of the path.
9e0fbc1
to
3492f49
Compare
3492f49
to
2467b66
Compare
@swift-ci Please test |
Build failed |
Build failed |
I should mention that this doesn't fix all the driver tests on windows, just the "easy" ones
|
See also #20172