-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix SourceKit/CursorInfo Tests on Windows #24171
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
Conversation
FILE_SHARE_READ | FILE_SHARE_WRITE, | ||
nullptr, | ||
OPEN_EXISTING, | ||
FILE_FLAG_BACKUP_SEMANTICS, |
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 the backup semantics?
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.
It's required to obtain a directory to a handle.
|
||
if (fileHandle == INVALID_HANDLE_VALUE) | ||
return InputPath; | ||
|
||
DWORD success = GetFinalPathNameByHandleA( | ||
fileHandle, full_path, sizeof(full_path), FILE_NAME_NORMALIZED); | ||
DWORD getPathSuccess = GetFinalPathNameByHandleW( |
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 the rename of success
?
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 added a convertSuccess
check and it seemed weird to have a success
and convertSuccess
.
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.
You could just do success &= ...
;-)
CC: @akyrtzi @benlangmuir |
@swift-ci please test |
Instead of updating the tests by optionally checking for the filename (which I think is unlikely that we will be able to remember to do every time we add new tests), why not updating |
Build failed |
8f32c19
to
a9c83f1
Compare
Looking at the realpath implementation on Windows, it was using GetFullPathName rather than GetFinalPathName which explains why the paths were getting normalized differently. I've fixed it to call GetFinalPathByHandle which removes the need for changing the tests themselves. |
a9c83f1
to
7da91d5
Compare
Checking again if I can trigger ci yet @swift-ci please test |
@swift-ci Please test |
@gmittert try with |
Build failed |
Build failed |
sourcekitd-test only prints the file path if it's different than the one it's passed. Since on Windows, paths get normalized to start with
\\?\
all paths fail this check and get printed.Also fixed the symlink resolving to follow symlinks and to support unicode.