-
Notifications
You must be signed in to change notification settings - Fork 129
Fix search for the Swift compiler on Windows #72
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
@swift-ci please test |
6ea0ce0
to
a8f3e36
Compare
@compnerd would you be able to help drive this PR per your recent work on the topic |
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 think that the cleanups in Path.swift
and fixes in misc.swift
are good. Would you mind splitting that out so that we can get those merged? I had something similar to the changes to misc.swift
as well.
Sources/TSCLibc/libc.swift
Outdated
} | ||
return String(cString: result).withCStringW { resultW, capacity in | ||
return path.withCStringW { pathW, _ in | ||
guard _wfullpath(UnsafeMutablePointer(mutating: resultW), pathW, capacity) != nil else { |
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 that this is really the equivalent to realpath
btw, this will expand the relative paths but I don't think it will resolve symlinks along the way.
I've excluded the changes in |
@swift-ci please test |
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!
Since the
Path.isAbsolute
implementation isn't valid for Windows paths, SwiftPM tries to find the Swift compiler in paths like this:while the actual path is:
After this change SwiftPM can successfully find
swiftc.exe
on Windows, create a temporary directory for the artifacts and run the compiler (which currently results in an unrelated error).