-
Couldn't load subscription status.
- Fork 1.7k
Closed
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Description
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:
/tmp/resolve
$ cat pubspec.yaml
name: resolvedemo
version: 0.1.0
/tmp/resolve
$ pub get
Resolving dependencies...
Got dependencies!
/tmp/resolve
$ cat bin/resolve.dart
import "dart:isolate" show Isolate;
main() {
Uri theUri = Uri.parse('package:resolvedemo/test.dart');
print('theUri: $theUri');
Isolate.resolvePackageUri(theUri).then((u) => print ('resolved Uri: $u'));
}
/tmp/resolve
$ dart `pwd`/bin/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///tmp/resolve/lib/test.dart
/tmp/resolve
$ dart bin/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///tmp/resolve/lib/test.dart
/tmp/resolve
$ dart --preview-dart-2 `pwd`/bin/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: file:///tmp/resolve/lib/test.dart
/tmp/resolve
$ dart --preview-dart-2 bin/resolve.dart
theUri: package:resolvedemo/test.dart
resolved Uri: lib/test.dart
/tmp/resolve
$
I believe all four runs of the program should have the same output.
(edit: refined example for clarity)
srawlins
Metadata
Metadata
Assignees
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)