Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows paths shouldn't be canonicalized to lower-case #102

Open
nex3 opened this issue Dec 23, 2020 · 2 comments
Open

Windows paths shouldn't be canonicalized to lower-case #102

nex3 opened this issue Dec 23, 2020 · 2 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@nex3
Copy link
Member

nex3 commented Dec 23, 2020

Although most paths on Windows are case-insensitive, it's possible to set certain directories as case-sensitive. This means that canonicalize() as currently implemented—converting all Windows paths to lower case—can cause a valid path to become invalid. It should probably instead match the behavior of other filesystems (including Mac OS which is also sometimes case-sensitive) and leave the case as-is.

Note that this means that, in general, paths cannot be truly canonicalized (in the sense of "guaranteeing that two paths that refer to the same location on disk will have the same string") without actually interacting with the filesystem on Windows (or Mac OS). This should probably be called out in the documentation.

@nex3 nex3 added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 23, 2020
@nex3
Copy link
Member Author

nex3 commented Dec 23, 2020

See sass/dart-sass#1169 where we hit this in practice.

@shuax
Copy link

shuax commented Jan 26, 2024

Have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants