Skip to content

Fix search for the Swift compiler on Windows #2758

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

Closed
wants to merge 2 commits into from

Conversation

egorzhdan
Copy link
Contributor

Since the Path.isAbsolute implementation isn't valid for Windows paths, SwiftPM tries to find the Swift compiler in paths like this:

C:/Users/User/Documents/C:/Library/Developer/Toolchains/custom-development.xctoolchain/usr/bin/swiftc.exe

while the actual path is:

C:/Library/Developer/Toolchains/custom-development.xctoolchain/usr/bin/swiftc.exe

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).

@abertelrud
Copy link
Contributor

First, thanks for the fixes! But, @aciidb0mb3r and @neonichu, the TSC in SwiftPM is just a vendored copy, right? These fixes should instead be made in that repository, right, and then the vendored copy should be updated? (or better yet, it should no longer be vendored)

@neonichu
Copy link
Contributor

Yes, that's correct. I also remember there being a broader discussion about Windows support w.r.t. to file paths, but I don't know where that ended up.

@egorzhdan
Copy link
Contributor Author

Ah, cool, thanks, I've misunderstood the readme (https://github.com/apple/swift-tools-support-core#development).
Created a new PR in the TSC repo: swiftlang/swift-tools-support-core#72

@egorzhdan
Copy link
Contributor Author

Closing this PR since I've moved it to the TSC repo: swiftlang/swift-tools-support-core#72
Would greatly appreciate if someone could take a look at the changes 🙂

@egorzhdan egorzhdan closed this Jul 28, 2020
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.

3 participants