-
Notifications
You must be signed in to change notification settings - Fork 34
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
Paths are treated as case sensitive on windows for packageOf
#1545
Comments
Fwiw here is an example test that would fail: test('packageOf, windows paths capitalization', () {
var configBytes = utf8.encode(json.encode({
'configVersion': 2,
'packages': [
{'name': 'foo', 'rootUri': 'file:///C:/Foo/', 'packageUri': 'lib/'},
]
}));
var config = parsePackageConfigBytes(configBytes as Uint8List,
Uri.parse('file:///C:/tmp/.dart_tool/file.dart'), throwError);
expect(config.version, 2);
expect(config.packageOf(Uri.parse('file:///C:/foo/lala/lala.dart'))!.name,
'foo');
}); |
…137) - validates the behavior of https://github.com/dart-lang/package_config/issues/136 today (but does not change it) - removes build_runner deps for testing, there is no need to use it for such a small package - fixes a bug in discovery_test.dart that was probably landed due to inability to run tests
This is a tricky issue. If we start treating The Let's assume we bite the bullet and ask the operation system. If a path exists, we can ask the directory whether it's case sensitive (somehow) and use that information to to determine whether the following path segments are equivalent. That requires knowing the case normalization algorithm. Which is non-trivial. Doing any of this would make And then we still need to figure out which functions are affected by this. Reading actual files is not an issue. We try to read files like The The I don't think we ever need to compare two Maybe that is it. The And then we remember that MacOS is also not case sensitive by default. Maybe all our Mac developers have chosen to mount their source file systems as case-sensitive. (Should All in all, I don't think it's reasonable to fix this properly. A more hacky approach (ASCII-only case insensitivity perhaps) may be viable, but not necessarily sufficient. |
…art-lang/package_config#137) - validates the behavior of https://github.com/dart-lang/package_config/issues/136 today (but does not change it) - removes build_runner deps for testing, there is no need to use it for such a small package - fixes a bug in discovery_test.dart that was probably landed due to inability to run tests
Paths are not case sensitive on windows, but this package treats them as if they are in the
packageOf
function.In particular, this is annoying because:
canonicalize
function frompackage:path
will lower case everything on windows.These are essentially incompatible - a package config created from pub will not be able to find the containing package for any file URI whose path has been canonicalized.
The text was updated successfully, but these errors were encountered: