Skip to content

Conversation

@daveinglis
Copy link
Contributor

The //?/ prefix needs to be added to directories if the length is greater than MAX_PATH - 12, however the PATHCCH_ALLOW_LONG_PATHS to PathAllocCanonicalize would only do that if the path was greater than MAX_PATH. This change uses PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH, which forces it on all the time. Just needed to remove the prefix in a few places as it was making it way out into tests as this is suppose to be transparent to the user.

This also fixes createDirectory() "withIntermediateDirectories: true" for long paths on Windows.

@daveinglis
Copy link
Contributor Author

@daveinglis
Copy link
Contributor Author

@jmschonfeld how do I test this change with a toolchain build?

@daveinglis
Copy link
Contributor Author

@swift-ci test

@jrflat
Copy link
Contributor

jrflat commented Dec 22, 2025

how do I test this change with a toolchain build?

A common approach is to open a test commit on the swift (or swift-corelibs-foundation) repo and include the link to your PR in a swift-ci test comment. CI will then use your PR as the checkout for swift-foundation. I kicked off smoke tests with this PR mentioned above

…ang#1618)

The //?/ prefix needs to be added to directories if the length is
greater than MAX_PATH - 12, however the PATHCCH_ALLOW_LONG_PATHS to
PathAllocCanonicalize would only do that if the path was greater than
MAX_PATH. This change uses PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH, which
forces it on all the time.  Just needed to remove the prefix in a few
places as it was making it way out into tests as this is suppose to be
transparent to the user.

This also fixes createDirectory() "withIntermediateDirectories: true"
for long paths on Windows.
@daveinglis daveinglis force-pushed the fix_long_window_paths branch from 02284d1 to a66e660 Compare December 22, 2025 18:23
@daveinglis
Copy link
Contributor Author

@swift-ci test

1 similar comment
@daveinglis
Copy link
Contributor Author

@swift-ci test

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