[dart-lang/sdk] b32e31: [vm] Introduce --script_uri_override to support Pl...

0 views
Skip to first unread message

jensjoha

unread,
9:35 AM (6 hours ago) 9:35 AM
to com...@dartlang.org
Branch: refs/heads/main
Home: https://github.com/dart-lang/sdk
Commit: b32e31362013fbd2169a8be9765ce23a34f63063
https://github.com/dart-lang/sdk/commit/b32e31362013fbd2169a8be9765ce23a34f63063
Author: Jens Johansen <je...@google.com>
Date: 2026-06-11 (Thu, 11 Jun 2026)

Changed paths:
M pkg/dartdev/lib/src/commands/run.dart
M pkg/dartdev/lib/src/vm_interop_handler.dart
M pkg/dartdev/test/commands/run_test.dart
M runtime/bin/dartdev.cc
M runtime/bin/main_impl.cc
M runtime/bin/main_options.h

Log Message:
-----------
[vm] Introduce --script_uri_override to support Platform.script in dart run -r

If a script uses `Platform.script` running it with as `dart
<script.dart>` and `dart run <script.dart>` would give the correct
script ("<script.dart>"), but running it with `dart run -r
<script.dart>` would report a dill file in the temp directory which is
not only surprising, but also breaking and for instance running the CFEs
strong_suite.dart via `dart run -r` didn't work.

This CL introduces --script_uri_override to the VM and makes the
resident compiler setup pass it so that when running `dart run -r
<script.dart>`, even though the vm is actually launched from a dill file
that resides in temp, `Platform.script` will actually return
`<script.dart>` - and running the CFEs strong_suite.dart via `dart run
-r` now actually works.

Tested: Added pkg/dartdev/test/commands/run_test.dart and manual testing.
Change-Id: Ia65c01834485fe06af63584baf0448dd5b9ffdb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510343
Reviewed-by: Slava Egorov <veg...@google.com>
Commit-Queue: Jens Johansen <je...@google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/dart-lang/sdk/settings/notifications
Reply all
Reply to author
Forward
0 new messages