Commit graph

124 commits

Author SHA1 Message Date
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
Ben Konyi 848121e6d4 Reland "[ CLI ] Improved consistency of -D and --define across tools and commands"
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`

Remaining improvements:
- Add support for providing multiple comma separated values for `dart
  run`, `dart`, and `dart2js`

Related issue: https://github.com/dart-lang/sdk/issues/44562

TEST=Updated CLI tests and added new dart2js tests.

This reverts commit e49937769f.

Change-Id: I5f9275b829665eb5e8695403d67f230e752ab0e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183180
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-05 23:53:28 +00:00
asiva ac520f984d [ VM / CLI ] Add --verbosity to VM options
The verbosity option allows for specifying the CFE output verbosity

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

TEST=existing tests compile_test.dart and run_test.dart have new tests

Change-Id: I3d4e50811f84650aacf774ddb370a6eb765b9b24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181100
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-01-26 03:01:58 +00:00
Ben Konyi e49937769f Revert "[ CLI ] Improved consistency of -D and --define across tools and"
This reverts commit e83e78431f.

Reason for revert: Failing on SIMARM and AOT bots

Original change's description:
> [ CLI ] Improved consistency of -D and --define across tools and
> commands
>
> - Added support for --define to the VM and dart2js
> - Added support for -D and --define for `dart run` and `dart compile js`
>
> Remaining improvements:
> - Add support for providing multiple comma separated values for `dart
>   run`, `dart`, and `dart2js`
>
> Related issue: https://github.com/dart-lang/sdk/issues/44562
>
> TEST=Updated CLI tests and added new dart2js tests.
>
> Change-Id: I9379c7aee1eab377adb3438393d9ad79c4938cc4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178262
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I1c594ae7db551619cc3191ff7f832c4fc61a4171
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179081
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-14 01:05:29 +00:00
Ben Konyi e83e78431f [ CLI ] Improved consistency of -D and --define across tools and
commands

- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`

Remaining improvements:
- Add support for providing multiple comma separated values for `dart
  run`, `dart`, and `dart2js`

Related issue: https://github.com/dart-lang/sdk/issues/44562

TEST=Updated CLI tests and added new dart2js tests.

Change-Id: I9379c7aee1eab377adb3438393d9ad79c4938cc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178262
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-13 23:33:17 +00:00
Sigurd Meldgaard f3fe9dc3b3 Reland "Improve handling of disable-dartdev-analytics"
This is a reland of 58860f4814

Original change's description:
> Improve handling of disable-dartdev-analytics
>
> This is second try of https://dart-review.googlesource.com/c/sdk/+/171284
> that was reverted to to faulty logic in main_options.
>
> Some other refactorings are piggy-backed along.
>
> TestProject.runSync no longer takes a 'command' argument. It was anyway
> often not an argument.
>
> Also stop the messy handling of pub arguments. It is no longer needed.
>
> BUG: https://github.com/dart-lang/sdk/issues/44135
> Change-Id: I49abf5810d9ea262409ba9d93f0471037cb8a753
> TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.
> TEST=Furthermore manual test that the --no-analytics flag is passed to dartdev.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174261
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

Change-Id: I725662f578d061f87171ceffe9aff3de83688f58
TEST=Furthermore run the vm-kernel-precomp-obfuscate-linux-release-x64-try trybot
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174473
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-12-04 14:22:10 +00:00
Sigurd Meldgaard 97baa6efd1 Revert "Improve handling of disable-dartdev-analytics"
This reverts commit 58860f4814.

Reason for revert: Broke bots. Will investigate.

Original change's description:
> Improve handling of disable-dartdev-analytics
>
> This is second try of https://dart-review.googlesource.com/c/sdk/+/171284
> that was reverted to to faulty logic in main_options.
>
> Some other refactorings are piggy-backed along.
>
> TestProject.runSync no longer takes a 'command' argument. It was anyway
> often not an argument.
>
> Also stop the messy handling of pub arguments. It is no longer needed.
>
> BUG: https://github.com/dart-lang/sdk/issues/44135
> Change-Id: I49abf5810d9ea262409ba9d93f0471037cb8a753
> TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.
> TEST=Furthermore manual test that the --no-analytics flag is passed to dartdev.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174261
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

TBR=bkonyi@google.com,sigurdm@google.com,jonasfj@google.com

Change-Id: I754bcebdcfc595158b04d431662b65bf25f5b89d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174466
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-12-01 13:11:16 +00:00
Sigurd Meldgaard 58860f4814 Improve handling of disable-dartdev-analytics
This is second try of https://dart-review.googlesource.com/c/sdk/+/171284
that was reverted to to faulty logic in main_options.

Some other refactorings are piggy-backed along.

TestProject.runSync no longer takes a 'command' argument. It was anyway
often not an argument.

Also stop the messy handling of pub arguments. It is no longer needed.

BUG: https://github.com/dart-lang/sdk/issues/44135
Change-Id: I49abf5810d9ea262409ba9d93f0471037cb8a753
TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.
TEST=Furthermore manual test that the --no-analytics flag is passed to dartdev.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174261
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-12-01 10:25:55 +00:00
Ben Konyi b0ccaf75a3 [ VM / CLI ] Fix issue where trying to snapshot a non-existent script would cause an assertion failure
Passing --snapshot should result in the CLI being bypassed (`dart compile`
should be used otherwise). Check to see if this option is provided when
attempting to parse the script name and always populate script_name in
that case.

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

TEST=Added regression test to the CLI package to exercise this path.

Fixed: 43785
Change-Id: Ifb67a5880f6b83c54e6deb6b0785b61fdcfc0ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172820
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 20:01:04 +00:00
Sigurd Meldgaard 5cbb25f753 Revert "Improve handling of disable-dartdev-analytics"
This reverts commit cda994ffc8.

Reason for revert: This stopped all sending of analytics from dartdev.

The added flag in dartdev had an implicit default value of 'false' -> no analytics would be sent.

Also the main_options.cc change was broken and did not pass the argument on to dartdev.

This failed to be caught by tests because all test are run with analytics off, and that happened implicitly.

Original change's description:
> Improve handling of disable-dartdev-analytics
>
> Some other refactorings are piggy-backed along.
>
> TestProject.runSync no longer takes a 'command' argument. It was anyway
> often not an argument.
>
> Also stop the messy handling of pub arguments. It is no longer needed.
>
> BUG: https://github.com/dart-lang/sdk/issues/44135
> TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.
>
> Change-Id: Ib5a1a29841a5fdb28663b7f60c5d6fc31ba252d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171284
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Jensen <jonasfj@google.com>

TBR=kustermann@google.com,bkonyi@google.com,sigurdm@google.com,jonasfj@google.com

Change-Id: I92ef65b16cdb75fb2475faf9f522fda62e181bab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171941
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-11-13 14:30:46 +00:00
Sigurd Meldgaard cda994ffc8 Improve handling of disable-dartdev-analytics
Some other refactorings are piggy-backed along.

TestProject.runSync no longer takes a 'command' argument. It was anyway
often not an argument.

Also stop the messy handling of pub arguments. It is no longer needed.

BUG: https://github.com/dart-lang/sdk/issues/44135
TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.

Change-Id: Ib5a1a29841a5fdb28663b7f60c5d6fc31ba252d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171284
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-13 08:40:06 +00:00
Ben Konyi 267db1871c [ VM ] Fix memory leak in main_options.cc
Caused by changes in ffc36db613 which
removed memory cleanup.

TEST=Existing tests surface the problem with ASAN enabled.

Change-Id: I4880a459e5421c754574778ad097984f2e47d885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-04 22:33:27 +00:00
Ben Konyi ffc36db613 [ CLI / VM ] Add --enable-experiment support for 'dart compile', change
where --enable experiment is accepted

Adds --enable-experiment support for:
  - dart compile aot-snapshot
  - dart compile jit-snapshot
  - dart compile js
  - dart compile exe
  - dart compile kernel

Also changes --enable-experiment from a top level CLI flag to a
per-command flag. --enable-experiment flags will now only be
interpreted by the VM if:

1) They are provided before a CLI command (e.g., dart
--enable-experiment=non-nullable analyze) or

2) They are provided with an explicit or implicit run command (e.g.,
dart --enable-experiment=non-nullable foo.dart or dart
--enable-experiment=non-nullable run foo.dart or dart run
--enable-experiment=non-nullable foo.dart)

This should make it more generally clear where --enable-experiment is
accepted and what subcommands can accept the flag. Prior to this change,
providing --enable-experiment anywhere, even for commands without
experiment support, would not raise an error.

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

Change-Id: I5ec48b2dd2bb6db5526185dae2edbca95ef24d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169902
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-04 00:34:26 +00:00
Ben Konyi 7f723f4166 [ VM / CLI ] Fix issue where VM flags would be parsed from the option
list for a script.

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

Change-Id: I6f0860e0a43055aaab775a28baa660d60fb1c47e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169782
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-30 23:25:22 +00:00
Alexander Aprelev 340f78eab3 [vm/io] Add a test for nonblocking ssl certification evaluation.
This is follow-up to a6dafabb88.

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

Change-Id: I4da732ab08235a1f549d45c7fa5fb87db672e2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166701
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-10-12 15:06:52 +00:00
Ryan Macnak 30897929fc [vm] Fix warnings in GCC 9.3.0 and XCode 12.0.
Bug: https://github.com/flutter/flutter/issues/66203
Change-Id: Ifff0c211e2ecdcb56d62c273a471fc05bbae9c37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161602
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-21 22:02:32 +00:00
Ben Konyi fe85812e27 [ VM / DartDev ] Fix --disable-service-auth-codes not being recognized by DDS
The VM and dartdev were not forwarding --disable-service-auth-codes to
the DDS instance, resulting in auth codes always being enabled.

Change-Id: Ib23bfeb7c64a51fb1229f049a4b61cb1ce5018de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163261
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 17:23:31 +00:00
Ben Konyi f0d88cc96d Reland "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit ed120c3c80.

Change-Id: I445f4bb2dafaad3ce2daa3ae42efe1723f9b1abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 15:20:14 +00:00
Ben Konyi ed120c3c80 Revert "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit 0ea18ffb36.

Reason for revert: Tree is on fire

Original change's description:
> [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
> 
> This change does the following:
>   - The DDS URI will be reported by the VM as the VM service URI. If DDS
>     disconnects, the VM service URI will be reported instead. This only
>     impacts the standalone VM.
>   - Updated the service protocol to 4.0 and removed the following
>     deprecated functionality:
>       - Client synchronization RPCs (these now live in DDS)
>       - getWebSocketTarget (no longer needed as the VM service no longer
>         tries to redirect web socket clients to DDS)
>   - Regenerates package:vm_service based on the new spec, prepare for
>     5.0 release
> 
> Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I6a16e9fa7ceb18555d6424a169cfa811d3833419
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-26 16:08:27 +00:00
Ben Konyi 0ea18ffb36 [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
This change does the following:
  - The DDS URI will be reported by the VM as the VM service URI. If DDS
    disconnects, the VM service URI will be reported instead. This only
    impacts the standalone VM.
  - Updated the service protocol to 4.0 and removed the following
    deprecated functionality:
      - Client synchronization RPCs (these now live in DDS)
      - getWebSocketTarget (no longer needed as the VM service no longer
        tries to redirect web socket clients to DDS)
  - Regenerates package:vm_service based on the new spec, prepare for
    5.0 release

Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-26 14:55:15 +00:00