-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Isolate.resolvePackageUri has inconsistent behavior when called from a script launched via relative path #32901
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
Comments
This blocks dart-lang/dartdoc#1668. |
The behavior is correct, but it might not be useful. The location of the I think we should just decide that the path of the |
@lrhn Resolving to an absolute file URI would work for me. Also I'll mention that I don't think returning null here is correct on Windows -- no matter what we decide, that should be fixed. |
Returning |
The returning null on Windows is still a blocking bug for Dartdoc under Dart 2.0. |
I get null on Macos if I am in a directory below the $ cd bin/
$ pwd
/tmp/resolve/bin
$ dart `pwd`/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///tmp/resolve/lib/test.dart
$ dart resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///private/tmp/resolve/lib/test.dart
$ dart --preview-dart-2 `pwd`/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///tmp/resolve/lib/test.dart
$ dart --preview-dart-2 resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: null The second example returns |
I am able to reproduce the behavior that @srawlins reports on linux too. |
https://dart-review.googlesource.com/c/sdk/+/56622 should fix this. |
Uh oh!
There was an error while loading. Please reload this page.
When running in the VM with preview-dart-2, resolvePackageUri sometimes doesn't resolve to a file URI correctly unless the script was launched with an absolute path.
demo:
I believe all four runs of the program should have the same output.
(edit: refined example for clarity)
The text was updated successfully, but these errors were encountered: