Skip to content

Conversation

@jakepetroules
Copy link
Collaborator

This regressed as part of #427, which attempted to simplify API calls in FSProxy to use Foundation rather than bespoke implementations going directly to Win32/POSIX API.

However, standardizingPath on Windows doesn't actually handle 8.3 filenames correctly, and so Swift Build doesn't know (for example) that C:\Users\JAKEPE~1 and C:\Users\jakepetroules are the same path.

Use the canonicalPathKey from URLResourceValues to canonicalize the path appropriately on both platforms, which under the hood uses GetFinalPathNameByHandleW on Windows and realpath on POSIX, matching the previous behavior.

With this change, the androidCommandLineTool test now passes on Windows, which was previously failing due to differences between paths in 8.3 form vs long form.

@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules force-pushed the realpath-windows branch 2 times, most recently from e9ee8fb to 52ede18 Compare November 4, 2025 08:59
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules
Copy link
Collaborator Author

@swift-ci test

This regressed as part of swiftlang#427, which attempted to simplify API calls in FSProxy to use Foundation rather than bespoke implementations going directly to Win32/POSIX API.

However, `standardizingPath` on Windows doesn't actually handle 8.3 filenames correctly, and so Swift Build doesn't know (for example) that C:\Users\JAKEPE~1 and C:\Users\jakepetroules are the same path.

Use the canonicalPathKey from URLResourceValues to canonicalize the path appropriately on both platforms, which under the hood uses GetFinalPathNameByHandleW on Windows and realpath on POSIX, matching the previous behavior.

With this change, the androidCommandLineTool test now passes on Windows, which was previously failing due to differences between paths in 8.3 form vs long form.
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules merged commit 4f60486 into swiftlang:main Nov 5, 2025
144 of 147 checks passed
@jakepetroules jakepetroules deleted the realpath-windows branch November 5, 2025 04:44
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.

2 participants