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] path: drop the trailing backslash before invoking PathCchRe… #479

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Aug 2, 2024

…moveFileSpec to compute the dirname

PathCchRemoveFileSpec's is documented to not remove the file spec if it comes with a backslash suffix. Thus, we should remove the trailing backslashes before calling this API, to ensure we actually drop the current file/directory name.

This regressed after adoption of new swift-foundation, as it's filesystemRepresentation no longer drops the trailing backslash.

…moveFileSpec to compute the dirname

PathCchRemoveFileSpec's is documented to not remove the file spec if it comes with a backslash suffix. Thus, we should remove the trailing backslashes before calling this API, to ensure we actually drop the current file/directory name
@hyp
Copy link
Contributor Author

hyp commented Aug 2, 2024

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Aug 2, 2024

@swift-ci please tset

@hyp
Copy link
Contributor Author

hyp commented Aug 2, 2024

@swift-ci please test

@xedin
Copy link

xedin commented Aug 3, 2024

@swift-ci please test Windows platform

Copy link

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! @rintaro and I spent some time today figure out what is going on with Windows build of swiftpm to find this exact problem.

@xedin
Copy link

xedin commented Aug 3, 2024

@swift-ci please test Windows platform

1 similar comment
@xedin
Copy link

xedin commented Aug 3, 2024

@swift-ci please test Windows platform

@compnerd compnerd merged commit a76104d into main Aug 5, 2024
3 checks passed
@compnerd compnerd deleted the eng/windows-dirname-fix branch August 5, 2024 14:36
@hyp
Copy link
Contributor Author

hyp commented Aug 5, 2024

Thanks, I will cherry-pick this into swift 6.

@hyp
Copy link
Contributor Author

hyp commented Aug 5, 2024

swift 6 PR: #480

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