Skip to content
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: symbolic links not created correctly with relative paths #928

Closed
dschaefer2 opened this issue Sep 19, 2024 · 2 comments · Fixed by #931
Closed

Windows: symbolic links not created correctly with relative paths #928

dschaefer2 opened this issue Sep 19, 2024 · 2 comments · Fixed by #931
Assignees
Labels
bug Something isn't working

Comments

@dschaefer2
Copy link
Member

SwiftPM creates a symbolic link in the .build directory to a sibling directory for backwards compatibility reasons. That link is currently in 6.0 not created correctly on Windows.

For Windows we check whether the destPath is a directory to add the SYMBOLIC_LINK_FLAG_DIRECTORY flag when creating the link. However, we don't check whether it's a relative path and just call fileExists to fetch the isDirectory boolean. That assumes the path is relative to the current directory not the symbolic link path.

I notice in corelibs-foundation, the path is resolved correctly before checking if it's a directory:

                let resolvedDest =
                  destPath.isAbsolutePath ? destPath
                                          : joinPath(prefix: path.deletingLastPathComponent,
                                                     suffix: destPath)
@dschaefer2 dschaefer2 added the bug Something isn't working label Sep 19, 2024
@dschaefer2
Copy link
Member Author

Original SwiftPM issue here: swiftlang/swift-package-manager#7965

@dschaefer2
Copy link
Member Author

Awesome, it worked. Thanks Jeremy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants