Skip to content

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jul 15, 2021

fix #18142 (and this was also needed in another PR)

follows cygwin convention which is the most reasonable way to convert C:\foo to a unix path

# permissions), it'll abort iteration and there would be no way to
# continue iteration.

proc nativeToUnixPath*(path: string): string =
Copy link
Contributor

Choose a reason for hiding this comment

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

As I (and others) have mentioned elsewhere, this is not a function that should be used. It cannot accurately translate paths without either a loss of information, or ambiguity. Windows has a couple of different path types and using a function that attempts to convert them all to some standard format is not going to work. Please stop pushing this.

Copy link
Member Author

@timotheecour timotheecour Jul 17, 2021

Choose a reason for hiding this comment

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

It cannot accurately translate paths without either a loss of information, or ambiguity.

cygwin works just fine, which is almost what I'm doing. future work will follow more closely what cygpath does, so that a spec is followed, you can't argue with that (I'm currently almost doing the same except for 2 edge cases).

@Araq
Copy link
Member

Araq commented Jul 16, 2021

The Nim doc generator should avoid nativeToUnixPath and get fixed differently.

@Araq Araq merged commit 923a1c6 into nim-lang:devel Jul 17, 2021
@Araq
Copy link
Member

Araq commented Jul 17, 2021

Sorry, I didn't realize this is an internal API.

@timotheecour timotheecour deleted the pr_fix_18142_nativeToUnixPath_support_abs branch July 17, 2021 06:58
@timotheecour timotheecour added the TODO: followup needed remove tag once fixed or tracked elsewhere label Jul 17, 2021
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review (please take another look): ready for next review round TODO: followup needed remove tag once fixed or tracked elsewhere

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nim doc doesn't work across windows partitions

3 participants