Commit Graph

143 Commits

Author SHA1 Message Date
asiva ab44b20ab8 Reapply "[VM/dartdev] Switch dartdev to use an AOT runtime." and
Add the fixes that were done after original CL landed.

This reverts commit 97bc401163.

TEST=ci

Change-Id: I26373aecc325e4c0c379c92e779aa301e3a58c5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441700
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-07-24 14:48:03 -07:00
Derek Xu 9b89266f43 [VM] Introduce --profile-startup CLI flag
TEST=pkg/vm_service/test/profile_startup_cli_flag_test

Change-Id: I39bf67bf3157fe5700f1a62822f1dc3159c9bc96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438980
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-07-24 12:04:17 -07:00
Alexander Markov 33ddf2f56f [vm] Fix gcc build
Fix the following error:
```
../../runtime/bin/main_options.cc:642:8: error: variable ‘run_script’ set but not used [-Werror=unused-but-set-variable]
  642 |   bool run_script = false;
      |        ^~~~~~~~~~
```

TEST=ci

Change-Id: I4b554ed604a14e5d8b9043971d9837c82ec840ce
Cq-Include-Trybots: luci.dart.try:vm-gcc-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439980
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-07-11 09:41:22 -07:00
asiva 97bc401163 Revert "[VM/dartdev] Switch dartdev to use an AOT runtime."
This reverts commit 5399dbf6f6.

Reason for revert : Flutter rolls are failing

TEST=ci

Change-Id: I76fede849705514496adbc2ab7f6c262de4103ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439661
Reviewed-by: Jason Simmons <jsimmons@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-07-09 23:08:28 -07:00
asiva 5399dbf6f6 [VM/dartdev] Switch dartdev to use an AOT runtime.
- split the Dart CLI tool out of the VM into it's own embedder which
  runs in AOT mode. The pure Dart VM executable is called 'dartvm' and
  has no Dart CLI functionality in it
- the Dart CLI executable parses the CLI commands and invokes the rest
  of the AOT tools in the same process, for the 'run' and 'test'
  commands it execs a process which runs 'dartvm' to run
- 'dart hello.dart' execs the 'dartvm' process and runs 'hello.dart'
- the Dart CLI is not generated for ia32 as we are not shipping a
  Dart SDK for ia32 anymore (support to execute the 'dartvm' for ia32
  architecture is retained)
- the Dart CLI tool is not built in the internal Dart SDK builds

TEST=ci

Some performance improvement numbers
'dart format pkg/dartdev' goes from 1.17 secs to 0.22 secs
'dart doc pkg/dartdev' goes from 100.2 secs to 66.6 secs
'dart fix pkg/dartdev' goes from 19.3 secs to 14.5 secs

Change-Id: I66984a26cb2ab014b34dc1873f1f3d2884e13518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364202
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-07-04 13:22:13 -07:00
asiva b0838eac58 [dartdev] Fix for issue https://github.com/dart-lang/sdk/issues/60988
Parse and accumulate VM options only for the 'run' and 'test' commands.

TEST=ci

Change-Id: I50a4c7e12d5b212723ce6b17e0c1882b172a3a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437128
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-06-27 10:01:02 -07:00
Ben Konyi 60b217ff2d [ Observatory ] Remove Observatory from the Dart VM
Also cleans up some references to Observatory in various places.

Work towards https://github.com/dart-lang/sdk/issues/50233

TEST=N/A
CoreLibraryReviewExempt: Not modifying public core libraries.
Change-Id: I1f36b4e6f1fd9a59a579d719aafa599906eedb3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429141
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-06-11 15:19:55 -07:00
Derek Xu 0ead16d05b [VM] Make it so that --profile-microtasks is processed by the code in both runtime/bin/main_options.h and runtime/vm/flags.h
TEST=pkg/vm_service/test/timeline_events_for_completed_microtasks_test

Change-Id: Ia544cabc7bfe6e322955d16d3078cab461b803ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425100
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-05-13 14:29:37 -07:00
Derek Xu 2877d78576 Reland "[VM/Service] Record timeline events representing completed microtasks"
This is a reland of commit 22021cc120

I showed some excerpts of Golem results to @mraleph for varying targets
and constant CPU, patch A, and patch B. Those constants being:
  CPU: Intel Xeon
  patch A: revision=115869&patch=20143
  patch B: revision=115876
(example results:
https://golem.corp.goog/Comparison?repository=dart#targetA%3Ddart%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D115869%3BpatchA%3Dderekx-Reland---VM%2FService--Record-timeline-events-representing-completed-microtasks--4%3BtargetB%3Ddart%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D115876%3BpatchB%3DNone)

He said that this change could be relanded as long as the following
"RunTime as Score" regressions of the "dart" target were noted in the
commit message:
  - StreamSingleSubTest: -3.907% (-0.8 noise)
  - ScheduleMicrotaskTest: -12.67% (-0.6 noise)

TEST=pkg/vm_service/test/timeline_events_for_completed_microtasks_test

Original change's description:
> [VM/Service] Record timeline events representing completed microtasks
>
> TEST=pkg/vm_service/test/timeline_events_for_completed_microtasks_test
>
> CoreLibraryReviewExempt: This CL does not include any core library API
> changes, it only modifies the implementation of microtasks (by
> instrumenting them).
> Change-Id: I54d886db9519c73f9e3218a9cc1c46bc9fe9acc3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420221
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

CoreLibraryReviewExempt: This CL does not include any core library API
changes, it only modifies the implementation of microtasks (by
instrumenting them).
Change-Id: Ia7741a9bb9ab948e8d5fff1cf9abe9915e247d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423921
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-04-25 08:51:22 -07:00
Derek Xu 75311aefa8 [VM/Timeline] Add Microtask stream
TEST=runtime/vm/dart_api_impl_test.cc

Change-Id: Icb078489f3600ac0fb8b314ca3bf748f482a687e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422860
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-04-22 07:42:27 -07:00
Ben Konyi dacb2a71a7 [ CLI ] Remove implicit entry into DartDev if VM service is enabled
Related issue https://github.com/dart-lang/sdk/issues/59992

TEST=N/A

Change-Id: Id95a8015b479f4b5ed67ccfd14d9593d11b96a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406640
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-02-03 16:40:40 -08:00
Ryan Macnak 37b7db0653 [io] Limit the IOService to 1 thread when running with --deterministic.
TEST=locally build the SDK twice without RBE
Bug: https://github.com/dart-lang/sdk/issues/56884
Change-Id: I59110f92c737fb1137e12114f6bcaacfd6283347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391463
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-10-22 23:09:20 +00:00
Ben Konyi 6a9a4f0d0c [ CLI ] Support --suppress-analytics before CLI commands and for dart test
Fixes https://github.com/dart-lang/sdk/issues/56842

TEST=pkg/dartdev/test/commands/test_test.dart

Change-Id: I1692352e3847c977c72a948d26be8ef8311ec69e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390900
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-18 15:02:06 +00:00
Ben Konyi 230c7ed90c [ VM ] Exit with error if --disable-dart-dev is provided after a Dart CLI command
Fixes https://github.com/dart-lang/sdk/issues/56592

Fixed: 56592
TEST=regress_56592_test.dart
Change-Id: I3363a27c6a4221a3c5388b3472cee978649c1e39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382700
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-29 20:40:06 +00:00
Ben Konyi 0c547d2833 [ CLI ] Fix DART_VM_OPTIONS usage only resulting in printing of help message
Fixes https://github.com/dart-lang/sdk/issues/55767

TEST=pkg/dartdev/test/commands/compile_test.dart

Change-Id: I6a773acbd9fc21c086fc459c7cb983ea1ff11fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367720
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-22 20:06:49 +00:00
Ben Konyi 6eb85949fd [ VM / DDS ] Add --print-dtd-uri flag and launch DTD from the correct snapshot for AOT
This adds support for printing the DTD connection information to stdout
when --print-dtd-uri is passed.

This change also fixes an issue where DDS would fail to spawn an isolate
with the DTD snapshot when DDS was running in AOT mode. This means the
SDK must be shipped with both AppJIT and AOT DTD snapshots, at least
until dartdev is moved to run from AOT.

Fixes https://github.com/dart-lang/sdk/issues/55034

TEST=run_test.dart

Change-Id: I788ef9bfe76297a8d594992a2aac440ed9e2ecac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358541
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-03-21 19:50:46 +00:00
Ben Konyi 9c78c8f14b [ CLI ] Strip --observe and --enable-vm-service from dartdev argument list
The dart run argument parser was incorrectly parsing any argument following an
option that the VM treats as having a default (e.g., --observe and
--enable-vm-service), resulting in a "File not found ''" error and the
VM failing to start the user program. The following invocations would
fail due to 'foo.dart' being treated as the value for the option to the
left:

- dart run --observe foo.dart
- dart run --enable-vm-service foo.dart

This change strips these two options from the arguments sent to dartdev
as both are handled directly in the VM and are only included in the dart
run argument parser for the help message.

Fixes https://github.com/dart-lang/sdk/issues/55185

TEST=regression test added to run_test.dart.

Fixed: 55185
Change-Id: I1c89fec3ee46296ee4ebb847eb47a7845dfdb399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357360
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-03-13 17:08:39 +00:00
Ben Konyi ce642d040f [ CLI ] Add support for passing VM options to Dart runtimes via DART_VM_OPTIONS
The DART_VM_OPTIONS environment variable allows for users to specify a
set of VM options to be processed by the Dart runtime in a
self-contained executable created by `dart compile exe`.

DART_VM_OPTIONS should be a comma separated list of options and flags
with no whitespace. Options that accept multiple values as a list of
comma separated values are not supported and will result in argument
parsing failing.

Fixes https://github.com/dart-lang/sdk/issues/54281

TEST=compile_test.dart

Change-Id: I1d94ab1b992753a7dd69da722c051c9464d6d1cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353820
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-26 21:07:40 +00:00
asiva 58098d3414 [VM/Service] - Launch dds from vmservice code instead of dartdev code
Currently the dds process is being launched from dartdev and
this causes problems when the dartdev commands 'run' and 'test'
are implemented by spawning child processes (this is needed
to make dartdev an AOT snapshot).
This CL attempts to lauch dds from the service isolate code.

TEST=ci

Change-Id: Iad00a17473a630659f15a5c73be0f5385ea35bdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350688
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-02-22 06:22:12 +00:00
Ryan Macnak b68351fbc3 [vm] Update NULL to nullptr in runtime/bin.
TEST=build
Change-Id: Ie3be570c274b0275a995a0f54b5e6ccdfc77ccd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292287
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-04-12 01:11:05 +00:00
Janice Collins 2f71556f8b Fix --disable-telemetry by adding the necessary handling to the VM
TEST=manual testing
Change-Id: I78e91bd19bb9612010f1b01f4c376d55d2f575a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293440
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-04-04 20:33:30 +00:00
Sigurd Meldgaard 6f2238969e Mark variable as used
Change-Id: I068573a3534816b301fde8628d8f15f8c0286898
Tested: not really tested, should be a noop.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292022
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-30 15:35:41 +00:00
Sigurd Meldgaard fcf60089fd Allow dart run --packages=... and dart --packages=... run
This forwards any `--packages` flag from before a dartdev command name to dartdev, so also eg. `dart --packages=... compile` will now work as expected.

And commands that don't take a --packages flag will complain (eg `dart --packages=... devtools`.

Change-Id: I0448b97aae394cb94541cfa087a6d28908e480e5
Tested: <Tested via pkg/dartdev/test/commands/run_test.dart>
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292020
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-30 13:50:09 +00:00
Derek Xu 50dd8edb7a [CLI] Add help message about --timeline-recorder to dart run --help
TEST=manual testing, CI

Change-Id: I11746e106c44bcef202f6002e10aa6e29381addb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288582
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-14 18:00:43 +00:00
Derek Xu d76ae6dbcb [CLI] Fix handling of --timeline-streams when it is supplied after dart run
--timeline-streams has been listed in the "options implied by --observe"
section of the dart run help messages, but it has been getting ignored.
This CL fixes that problem.

TEST=manual testing, CI

Change-Id: Ib6c2425a2681b61375df186673e0f195e3fae580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288581
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-14 18:00:43 +00:00
Josh Soref 50b94ef9fc Spelling runtime bin
TEST=build VM

Closes: https://github.com/dart-lang/sdk/pull/50862

GitOrigin-RevId: ae54b37666f70f670ee3af11c984c7e9a7e9da26
Change-Id: I459fda0439a1cd368f488a70d84ee6bb915e60bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277761
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-06 07:48:22 +00:00
Ben Konyi 3602351df0 [ VM Service ] Add support for '--[no-]serve-observatory'
To prepare for the eventual removal of Observatory, we plan on disabling
Observatory by default while providing an escape hatch to manually serve
the tool for some period of time before completely removing Observatory
from the SDK. This change adds flags that can be used to configure
whether or not Observatory is served.

Currently, '--serve-observatory' is the default behavior, but will be
changed to '--no-serve-observatory' once tooling is ready to support the
escape hatch behavior.

Part of https://github.com/dart-lang/sdk/issues/50233

TEST=run_test.dart

Change-Id: Ib6d1e1587d9fbd3c61d4a4c75d90635052835844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-11-21 17:47:31 +00:00
Ben Konyi 39168c9ef0 [ CLI ] Fix dart run --enable-experiment
Fixes issue where --enable-experiment options passed after `dart
run` weren't being handled by the VM.

Fixes https://github.com/dart-lang/sdk/issues/50205

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Ia9c585a16756fd4450cfd159a1b9864ebfb6d200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264200
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-18 13:42:32 +00:00
Ben Konyi eff8c305d9 [ Service / Timeline ] Enable Compiler, Dart, and GC timeline streams when --observe is provided
TEST=pkg/vm_service/test_timeline_default_streams_test.dart

Fixes https://github.com/flutter/devtools/issues/3444

Change-Id: I3f772a54a512eb836e3e7279ee8d4d3437473393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255181
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-08-15 21:02:36 +00:00
Ben Konyi b036052077 Reland "[ Service ] Update VM service message to not reference Observatory"
This reverts commit ee5837aa7a.

Updated Intellij plugins have been published which support the new
message.

TEST=CQ

Change-Id: I81f6d878f036991a95cc1f58d3102015e77aa609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237741
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-03-17 23:15:57 +00:00
Ben Konyi 8c484d12fe Reland "[ Service / DDS ] Remove VM service polling logic, add --enable-service-fallback-port support to DDS"
This reverts commit d4f71515c7.

TEST=CQ

Change-Id: I180f9d045870a1ff5f7f3f82b6f4782e18c18cfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-03-15 18:14:42 +00:00
Emmanuel Pellereau d4f71515c7 Revert "[ Service / DDS ] Remove VM service polling logic, add --enable-service-fallback-port support to DDS"
This reverts commit bd8590ba9b.

Reason for revert: breaks google3 (b/224731131)

TEST=Clean revert

Original change's description:
> [ Service / DDS ] Remove VM service polling logic, add --enable-service-fallback-port support to DDS
>
> Polling logic was introduced due to a bug in Fuchsia's network stack
> which could result in the VM service attempting to start the server
> before the network stack was initialized. This issue should be resolved
> now, so this logic is no longer necessary.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: I10f185dfb1be1b0363983f3e0564d65c38c99ea8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235763
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I3016fad25220c4e5479f17294626d79a17bd316a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237360
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
2022-03-15 12:01:30 +00:00
Ben Konyi bd8590ba9b [ Service / DDS ] Remove VM service polling logic, add --enable-service-fallback-port support to DDS
Polling logic was introduced due to a bug in Fuchsia's network stack
which could result in the VM service attempting to start the server
before the network stack was initialized. This issue should be resolved
now, so this logic is no longer necessary.

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: I10f185dfb1be1b0363983f3e0564d65c38c99ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235763
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-03-14 21:44:29 +00:00
Ben Konyi ee5837aa7a Revert "[ Service ] Update VM service message to not reference Observatory"
This reverts commit f9147d933e.

TEST=N/A

Change-Id: Idef34b70f1066ddf79d02588dfba7caeec443e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234325
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-02-24 18:32:14 +00:00
Ben Konyi f9147d933e [ Service ] Update VM service message to not reference Observatory
See https://github.com/dart-lang/sdk/issues/46756

TEST=Existing

Change-Id: Ib71bf00d667369d7438a4547ae444951ec0979df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233504
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-18 20:53:52 +00:00
Ben Konyi dc0b571335 [ VM / CLI ] Remove service flags from VM and the CLI when building in
PRODUCT mode

Fixes https://github.com/dart-lang/sdk/issues/47813

TEST=Manual testing, CQ

Change-Id: I50e57fa653c45c892e748d4e283617200cee0c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-04 19:53:11 +00:00
Ben Konyi 123950ffa9 [ CLI / VM ] Add support for disabling DDS
Allows for tooling (e.g., DAP) to spawn their own DDS instance without
having to disable the CLI.

Fixes https://github.com/dart-lang/sdk/issues/47059

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Ie9a4832d424edae67f32560399d3b0a6ca9f1dc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-16 20:31:45 +00:00
Ben Konyi d2855e703e [ CLI ] Default to printing CLI usage message instead of VM usage
--disable-dart-dev disables this behavior.

Fixes https://github.com/dart-lang/sdk/issues/46411

TEST=pkg/dartdev/test/commands/flag_test.dart

Change-Id: I46b91abc89fc3ec5e06fa7e9aad3939573cff545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209264
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-08-13 23:01:51 +00:00
Ben Konyi cccc0293c5 [ VM ] Send 'dart --help [--verbose]' output to stdout
This is consistent with the majority of other tools and the CLI
behavior.

Fixes https://github.com/dart-lang/sdk/issues/46412

TEST=pkg/dartdev/test/commands/flag_test.dart

Change-Id: I45a3ddc9728e9cc1a273d4d5f11db74cb8104745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204661
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-08-06 16:06:05 +00:00
Zach Anderson f407419d0a [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_
This relands https://dart-review.googlesource.com/c/sdk/+/205633
but without renaming TARGET_OS_IPHONE to DART_TARGET_OS_IPHONE.
It also changes uses of TARGET_OS_IOS to
DART_TARGET_OS_MACOS_IOS to be consistent with the rest of the
VM.

TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.

Change-Id: Ie775c19dd23cfdf5f65e5ebc6ee4ec3a561676fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205860
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-02 19:06:45 +00:00
Slava Egorov 42164cc140 Revert "[vm] Prefix HOST_OS_* and TARGET_OS_* with DART_"
This reverts commit aa9201b76b.

Reason for revert: blocks G3 roll (b/192627187)

Original change's description:
> [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
>
> TargetConditionals.h for XCode 13 defines several
> TARGET_OS_* preprocessor symbols that confuse the
> Dart build. There is probably a more targeted fix
> for this, but renaming the symbols that Dart uses
> will also prevent this problem if more symbols
> are added to the platform headers in the future.
>
> See: https://github.com/dart-lang/sdk/issues/46499
>
> TEST=It builds.
> Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: Ib06ca418c7e9d3b4df62c72c033cd39f462f7667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205790
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-07-02 14:02:02 +00:00
Zach Anderson aa9201b76b [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.
Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-02 06:02:48 +00:00
Ryan Macnak e5bc0f0b86 [vm] Make various arrays const.
TEST=build
Change-Id: I8d3445b87caa979472c9a37df62507f152a4aefb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203202
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-06-14 20:45:18 +00:00
Alexander Aprelev 05e5427800 [io/mac] Ensure FSEventsWatcher::Node is deleted synchronously with Callback that uses it.
This is follow-up to ed82bb6f4c

TEST=tests/standalone/io/file_system_watcher_large_set_test.dart

Change-Id: If02c922eafe1371c6e67196158896b9cb786bfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202312
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-04 14:26:36 +00:00
Ben Konyi 4b96d7a09d [ VM / CLI ] Add support for --[no-]serve-devtools
Fixes https://github.com/dart-lang/sdk/issues/45867

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: I3e575db8298d47b69eb9e120f9792ed60d25c7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199960
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-06-01 20:33:15 +00:00
Ben Konyi b99466d472 Reland "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit 5cbf10febe.

TEST=pkg/dds/devtools_observatory_connection_test.dart

Change-Id: I682d009f784b930094dae9b7d4e9a66efffb6ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198561
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-11 17:55:26 +00:00
Alexander Aprelev bc2cf88bac [io/ssl] Add an option to bypass trusting system cert roots.
Fixes https://github.com/dart-lang/sdk/issues/45912

TEST=manually remove root certificate for pub.dev, confirm that dart is not able to establish https connection in default configuration to pub.dev, confirm that it can connect with the flag.

Change-Id: I51af7994d7cd7371a17877844dc1bf39cd5e54ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198442
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-05-06 02:46:02 +00:00
Ben Konyi 5cbf10febe Revert "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit ef0e4ea107.

Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.

TEST=N/A

Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-05 20:31:07 +00:00
Ben Konyi ef0e4ea107 [ VM / DDS / CLI ] Add DevTools support to the standalone VM
Example output on stdout when DevTools is enabled:

Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
hello world!

vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-03 18:24:09 +00:00
Ben Konyi 7ce8e3ba2e [ DartDev / CLI ] Fixed issue where analytics flags were not being forwarded to the CLI
Forwarding logic seems to have been accidentally removed in
f3fe9dc3b3.

Fixes https://github.com/dart-lang/sdk/issues/44968

TEST=pkg/dartdev/test/analytics_test.dart

Fixed: 44968
Change-Id: Ib3c107233276ca6592247e23268f9af7ede52285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184502
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-02-11 18:45:06 +00:00