Skip to content

Conversation

daveinglis
Copy link

@daveinglis daveinglis commented Sep 16, 2025

  • FileManager handles long file name prefixes on Windows correctly.
    This keeps any UNC long file prefix (\\?\) out of
    URL that were relative and then resolved to absolute urls.

@daveinglis
Copy link
Author

@swift-ci test

@jakepetroules
Copy link
Contributor

Could we add tests for this?

@daveinglis
Copy link
Author

test added

@daveinglis
Copy link
Author

@swift-ci test

@daveinglis daveinglis force-pushed the strip_unc_lf_preifx branch 3 times, most recently from 82bf6bf to 88dcf1b Compare September 18, 2025 15:42
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@swift-ci test linux

@daveinglis
Copy link
Author

@swift-ci test

Copy link
Contributor

@parkera parkera left a comment

Choose a reason for hiding this comment

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

Let's identify the user level API this is supposed to change - this CF API should not be used directly, and in any case is all eventually being replaced by Swift code.

@daveinglis
Copy link
Author

So the swift API that would be affected was going to have this as well (FileManager.currentDirectoryPath - see swiftlang/swift-foundation#1479) but that PR also cause the NSURL test to fail so it was reverted (swiftlang/swift-foundation#1512) until a fix could be put in place (this).

@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@parkera Is my last comment clear on where this prefix is originating from? I would like to resurrect this (swiftlang/swift-foundation#1479) foundation change that was reverted once this goes in.

- FileManager handles long file name prefixes on Windows correctly.
  This keeps any UNC long file prefix (\\?\) out of
  URL that were relative and then resolved to absolute urls.
@daveinglis daveinglis changed the title Strip any UNC long path prefix from _wgetcwd Use FileManager API to get current working directory Oct 15, 2025
@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@swift-ci test windows

@daveinglis
Copy link
Author

@parkera @jmschonfeld are we good with the latest changes?

Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

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

This LGTM (since as you mentioned there's an existing test that validates the behavior here). Have you been able to test this with your original swift-foundation change to confirm that if we reintroduce the swift-foundation change that the tests here still succeed?

@daveinglis
Copy link
Author

Just tried it, so far so good 👍

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.

4 participants