Skip to content

Conversation

@jakepetroules
Copy link
Collaborator

These now go through Foundation rather than Win32 APIs directly. This simplifies Unicode and long path handling in particular.

For realpath I left the POSIX implementation in place for non-Windows for now since it's not clear that has equivalent behavior. touch/setFileTimestamp now differ in that they no longer set atime, but virtually nothing uses atime.

@jakepetroules jakepetroules added the windows Support for the Windows platform label Apr 21, 2025
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules enabled auto-merge (rebase) April 21, 2025 22:07
@jakepetroules jakepetroules force-pushed the win32-api-usage-fsproxy branch from 7c9a5f3 to ab1e889 Compare April 22, 2025 00:55
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules force-pushed the win32-api-usage-fsproxy branch from ab1e889 to 6633142 Compare April 24, 2025 03:07
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules force-pushed the win32-api-usage-fsproxy branch from 6633142 to e42301e Compare April 24, 2025 04:37
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules force-pushed the win32-api-usage-fsproxy branch from e42301e to addb855 Compare April 24, 2025 16:53
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

These now go through Foundation rather than Win32 APIs directly. This simplifies Unicode and long path handling in particular.

For realpath I left the POSIX implementation in place for non-Windows for now since it's not clear that has equivalent behavior. touch/setFileTimestamp now differ in that they no longer set atime, but virtually nothing uses atime.
@jakepetroules jakepetroules force-pushed the win32-api-usage-fsproxy branch from addb855 to 3cc21fb Compare April 24, 2025 20:17
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules merged commit e2f5506 into main Apr 24, 2025
3 checks passed
@jakepetroules jakepetroules deleted the win32-api-usage-fsproxy branch April 24, 2025 20:58
jakepetroules added a commit to jakepetroules/swift-build that referenced this pull request Nov 4, 2025
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 added a commit to jakepetroules/swift-build that referenced this pull request Nov 4, 2025
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 added a commit to jakepetroules/swift-build that referenced this pull request Nov 4, 2025
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 added a commit to jakepetroules/swift-build that referenced this pull request Nov 4, 2025
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 added a commit to jakepetroules/swift-build that referenced this pull request Nov 4, 2025
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 added a commit that referenced this pull request Nov 5, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

windows Support for the Windows platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants