Commit graph

422 commits

Author SHA1 Message Date
Sigmund Cherem e8906e65e7 [3.0 alpha][dart2js] No longer infer the null-safety mode from sources.
This prepares dart2js to default to sound null safety in Dart 3.0.

The compiler no longer infers the default mode based on the input
program, instead uses sound null safety unless
'--no-sound-null-safety' is specified.

On a separate change, we expect to remove the option of disabling
null safety.

Note: this change should also be reflected in the CHANGELOG, but
we've currently not included it to redeuce merge conflicts, as we plan
to land multiple 3.0-alpha changes in a short window of time

Change-Id: Id87498cc5976548ec89d1f36c60674b72406950a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-07 04:02:13 +00:00
asiva 606a64a743 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default.
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
  it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
  null safety mode, the opt out has to be done when generating these
  file.

TEST=ci

Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-06 04:04:23 +00:00
Alexander Thomas 7e0d92d69d [3.0 alpha] Bump version to 3.0.0
Tested: Standard CQ.
Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I329b9940db7309c7e48f17eecd7a66d5b853a484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271922
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-06 02:40:36 +00:00
Devon Carew 4b4b3645b8 [dartdev] uncomment the dependencies: section in the create templates
Change-Id: I7ad57d3a2fd357b368e8d2210a6dfef0fe2ed4a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273543
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-12-05 17:34:03 +00:00
Devon Carew 793367c498 [pkg/dartdev] add windows support for 'dart bug'
Change-Id: Id94a4d9e4a485350cbe37f78d5395e093ccf5892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272741
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-30 20:13:05 +00:00
Devon Carew ccb092a5f4 [dartdev] remove the package:intl dep
Change-Id: Ia884172c15a61d788b175fd7b08239e72b271665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272860
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-11-30 18:00:18 +00:00
Daco Harkes eba9ada49e [pkg/dartdev] Fix bug_linux_test
Makes test pass when there's snapshots in the current processes.

Makes test pass when there's more digits in the Memory column, the
header is aligned right.

Closes: https://github.com/dart-lang/sdk/issues/50583
Change-Id: Ia0445c38795b60a403b8cba26c0444e829955973
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272820
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-30 11:06:51 +00:00
Devon Carew 1dd71b412f [dartdev] contribute a 'dart bug' command
Change-Id: Ib5557711df23d3a3e0485378c04ff6264194717f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269750
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-11-29 16:58:58 +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
Devon Carew 8e70a02f05 [dartdev] updates to the 'dart compiler-server-shutdown' command
Change-Id: I38c268dace6610083051f9ec62fc9c0846d202d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270023
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-11-16 21:14:41 +00:00
Kevin Moore 0210b58d68 dartdev: update generated .gitignore files
No standard Dart package creates build directory
.packages is gone

Change-Id: Ib9859a7147f251c0e6422fa75e0d24c7ab3c6070
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270025
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-11-16 09:14:13 +00:00
Tamir Duberstein 154843a376 Remove analysis server shutdown timeout
See https://fxbug.dev/98703; this shutdown is sometimes taking longer
than the arbitrary 1 second timeout used here. Make the timeout argument
optional and avoid setting it in the analyze command.

This timeout was previously raised in response to issues in fuchsia in
https://dart-review.googlesource.com/c/sdk/+/237780.

Change-Id: Ic896c36a37735bb49d13cde07a95a6fe7837b580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269061
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
Auto-Submit: Tamir Duberstein <tamird@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-11 00:30:10 +00:00
asiva 1a3215fc03 [kernel-service] Fix test (build breakage)
TEST=ci
Change-Id: I3bf933aed20ab6c964a17e4f8a6cda4920069196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268802
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-11-10 17:01:13 +00:00
asiva 47880ca5f7 [kernel-service] - Send diagnostics output to stderr
TEST=ci

Bug:49881
Change-Id: I732d8e0f79a48ad4993762ec93c45dc22ee828b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268102
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-09 19:32:28 +00:00
Devon Carew b31ce2833d [dartdev] update the 'create' template dependencies
Change-Id: I48a1daf1fc347b88a604767c3b5866909c912847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268368
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-11-09 17:09:13 +00:00
Kevin Moore 7043c882c8 pkg/dartdev: fix readme link
Change-Id: Ie0e8c9cb9c98da1d7db5babeca584e0c81b3a515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268607
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2022-11-09 03:12:26 +00:00
Daco Harkes 34628cf00f [test/dartdev] Clean up tests
* Move `project in current directory` into a seperate invocation in a
  temp folder.
* Give an eager and more sensible error message if tests are run with
  a `dart` not in `bin/dart`.

Closes: https://github.com/dart-lang/sdk/issues/50352
Change-Id: I06b92a925f4e92c93b58bfc7f00197e15f0341de
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266901
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-11-01 17:26:08 +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 72506b826a [ CLI ] Add support for --[no-]sound-null-safety to dart compile {jit-snapshot,kernel}
Fixes https://github.com/dart-lang/sdk/issues/50079

Change-Id: I4a71dab1c9003f13ff74741bc64f3ee239c03195
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262620
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-10-04 17:03:29 +00:00
Ben Konyi c8651ac551 [ CLI ] Force isolate running dart2js to use --no-sound-null-safety
Fixes https://github.com/dart-lang/sdk/issues/50090

TEST=N/A

Change-Id: I5e26a88a8daa107fa684009562c4eb2207f41a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-10-04 16:59:57 +00:00
Sigurd Meldgaard 4f4f446e22 Bump pub to 28a2503d7f4806e6854e3ed0d783f065abfd1b5f
Changes:
```
> git log --format="%C(auto) %h %s" ec35d46..28a2503
 https://dart.googlesource.com/pub.git/+/28a2503d Bump analyzer from 4.7.0 to 5.1.0 (#3582)
 https://dart.googlesource.com/pub.git/+/8dba9574 Crc32c checksum validation and retry of archive downloads (#3546)
 https://dart.googlesource.com/pub.git/+/27da43ec Allow `dart pub add` with existing package, update constraint instead of adding (#3570)
 https://dart.googlesource.com/pub.git/+/2e9338e5  Do resolution before publishing. (#3565)
 https://dart.googlesource.com/pub.git/+/0a487534 Migrate removed command `pub` to `dart pub` in docs & messages (#3506)
 https://dart.googlesource.com/pub.git/+/e2720c27 Fail gracefully when run inside the pub-cache (#3471)
 https://dart.googlesource.com/pub.git/+/a76c1933 Upgrade `package:tar` to 0.5.6 (#3540)
 https://dart.googlesource.com/pub.git/+/c065e559 Remove unnecessary nullability (#3547)
 https://dart.googlesource.com/pub.git/+/8e306f33 Use pub.dev in writing (#3528)
 https://dart.googlesource.com/pub.git/+/08d71024 Use unicode (if available) when drawing file-lists (#3541)
 https://dart.googlesource.com/pub.git/+/a0ca4226 Don't be conservative in upgrade --major-versions without specific pa… (#3539)
 https://dart.googlesource.com/pub.git/+/a59d890e Show file size (#3509)
 https://dart.googlesource.com/pub.git/+/b0ba5cc6 Avoid packageGraph (and therefore getExecutableForCommand) depending on the lock-file (#3533)

```

Diff: https://dart.googlesource.com/pub.git/+/ec35d46261b610e558dfd0d8525ca3fc8387b4b7~..28a2503d7f4806e6854e3ed0d783f065abfd1b5f/
Change-Id: Ia366f75da16982fb9588a0d7aa18e109daea8f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262346
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-10-04 10:11:57 +00:00
Devon Carew ad34feec87 [dart create] suggest using the pubspec repository field
Change-Id: I51e83853d947bc545aced1ae2ae3d048dd7c6b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-09-29 19:13:27 +00:00
Tess Strickland b0c4ddf919 [pkg/dart2native] Avoid overwriting section contents in MachO files.
To create a Dart standalone executable on MacOS, we modify the
dartaotruntime executable to add the snapshot contents, and the
VM looks into the executable on disk to find the snapshot to load.

Previously, we did this by adding a new 64-bit segment load command
with a single section, where the section's file offset and size
describes the inserted snapshot. This meant the Mach-O header size increased by 152 bytes.

Originally, this wasn't an issue as there was plenty of padding, but
later clang updates removed most of this padding, and so writing the
new header actually overwrote the initial contents of the first section
in the file, which happens to be the __text section. In addition, since
the first section's offset was now declared to be within the header,
utilities that strictly validated the Mach-O format, like codesign,
would report errors.

This CL changes it so that we actually reserve space in the
dartaotruntime header using the -add_empty_section flag to the linker.
In addition, we change from using a segment load command to using a
(40 byte) note load command. This is because a segment load command
specifies that the contents should be loaded in memory, but we don't
use that loaded version. Instead, the VM reloads it from the executable
on disk so it can appropriately mmap the different parts of the
snapshot. A note section instead just declares a section of the
executable as arbitrary data that the owner can read from the file
and use as desired, which is semantically closer to our current usage.

This CL also adds a test to pkg/dartdev/test/commands/compile_test to
ensure that corrupting a random part of the snapshot in the executable
causes signature verification to fail.

This CL also reverts CL 256208, thus relanding the clang changes
starting from June that originally raised awareness of the issue by
greatly reduced the amount of padding after the load commands.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: Iee554d87b0eabaecd7a534ca4e4facfefbce6385
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260108
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 08:32:47 +00:00
Michael Thomsen eb2504dea3 Remove emoji from null safety terminal messages. They are not rendering correctly on Windows.
Followup to https://dart-review.googlesource.com/c/sdk/+/257642

Change-Id: Id0193dea51e164f20ccb7a3087cd2995a742f348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259300
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-15 16:41:29 +00:00
Michael Thomsen 0b71ae22fa Fix a few test failures.
Followup to https://dart-review.googlesource.com/c/sdk/+/257642

Fix compile test failing on windows:
https://dart-ci.appspot.com/log/pkg-win-release/unittest-asserts-release-win/21931/pkg/dartdev/test/commands/compile_test

Fix IO tests failing:
https://dart-ci.appspot.com/log/app-kernel-linux-debug-x64/app_jitk-linux-debug-x64/11442/standalone_2/io/stdio_implicit_close_test

Change-Id: Icf8f046a6231168209fd0f0f9ebaa5e00fa5d836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258245
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-08 15:34:03 +00:00
Michael Thomsen 6a274e3fe1 Update CFE compiler output for sound null safety in Dart 3
Fixes: https://github.com/dart-lang/sdk/issues/49924

Change-Id: I9ad951ce8ede57d295508bc6480d10b0204c2579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257642
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-09-08 10:09:23 +00:00
Tess Strickland be4d469e38 [pkg/dart2native] Refactor MachO parsing.
* Move parsing functions to static methods of the classes that
  represent the data being parsed.

* Move calculations for adjusting offsets in load commands into the
  corresponding classes.

* Make function to insert a new payload segment an instance method
  of MachOFile.

* Remove unnecessary abstractions and definitions for MachO load
  commands that we don't need to parse.

These refactorings are being done to make later changes easier to
review, by first lifting the initial refactorings out into a
separate CL.

Issue: https://github.com/dart-lang/sdk/issues/49783
Change-Id: I133eb368cbb9ee0d8e4f3998ba1a0bbe8555b8aa
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256821
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-09-07 11:32:37 +00:00
pq 1519292b7a [dart fix] dry-run individual code run details
Adds details to make applying individual fixes easier.

Example output:

```
3 proposed fixes in 1 file.

foo/baz/main.dart
  annotate_overrides • 1 fix
  prefer_single_quotes • 2 fixes

To fix an individual diagnostic, run one of the following commands:
  dart fix --apply --code=no_duplicate_case_values .
  dart fix --apply --code=unused_imports .

To fix all diagnostics, run:
  dart fix --apply .
```

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


Change-Id: Ibc89388acabe868fe3253d802e03481d853646ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256367
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-25 18:11:40 +00:00
pq 103a2fa642 [dart fix] detect and report un-enabled lints
Change-Id: Ie113348ae442f93ae2ea49afb2ed1b0305a6da03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256245
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-25 04:23:12 +00:00
pq c0e74c4433 [dart fix] report undefined diagnostics
Fixes: https://github.com/dart-lang/sdk/issues/49699

Change-Id: Ia412e4dce51b0887c3cd0d9b6d91f0ace926bea3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-24 20:35:59 +00:00
Michael Richards 8d262e2944 [dartdev] This adds the ability for the Dart CLI to use the Resident Frontend Compiler for faster start times.
Dartdev will use the user's home directory to store the server information and will keep a directory for cached kernel files in each dart package's .dart_tool directory and in the .dart directory for stand alone dart programs.

This functionality is accessed by providing the --resident flag to the Dart CLI, and the server can be manually shutdown with the new shutdown command.

Change-Id: I5231a00b7535266ab0704ca3ae35c039738bd38b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254341
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-08-18 17:01:34 +00:00
pq f4ea96ff2c [dartdev] fix --code support
See: https://github.com/dart-lang/sdk/issues/47219

I'll follow up with tests for error conditions once diagnostic codes are validated by the protocol (see: https://dart-review.googlesource.com/c/sdk/+/255541).

Change-Id: I3318364e952522522608e86bdfdd231839685689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255544
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-18 16:51:54 +00:00
Michael Thomsen c626cb8346 Make package arg to analyzer absolute
Bug: https://github.com/dart-lang/sdk/issues/49646

Change-Id: Ie653b2372ba12992457c25972294c261cb8ea40e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254901
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-16 20:54: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
Danny Tuppeny 09bcc1f4ae [dartdev] [dds] Share DevTools arg parsing with serve_local script
Change-Id: Ia8f95b205fda1201a7ec50805a84d374a6201f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-08-04 20:32:14 +00:00
Ben Konyi 887601b726 [ CLI ] Add better logging to the DartDev isolate
Should make debugging unhandled errors in the CLI easier.

Related issue: https://github.com/flutter/flutter/issues/106753

Change-Id: I6cfc88a52c0af756c0d7a00fc1a2edcf61b86538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252464
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-07-25 14:44:59 +00:00
Anis Alibegić 40e18905f2 Fixed various typos in a lot of files
Closes https://github.com/dart-lang/sdk/pull/49478

TEST=Manual

GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-07-25 12:21:59 +00:00
Danny Tuppeny 027618092a [dartdev] Fix flakey LSP server test
This test was written to assume that the stdout stream would deliver LSP headers and body in separate "packets", but wasn't guaranteed to be the case. The failure at https://dart-ci.appspot.com/log/pkg-linux-release/unittest-asserts-release-linux/19779/pkg/dartdev/test/commands/language_server_test shows that both header+body arrived together which caused the test to fail.

These changes buffer the output until the complete message is available and then return the body of the message.

Change-Id: I5a5ec49fdca667ae351e602ca2d589fd2ab06ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251548
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-15 17:44:30 +00:00
Ben Konyi cc92eb0a7f [ CLI ] Fix LateInitializationError in DartDev when passed an invalid flag
`log` was previously initialized after argument parsing had already
taken place, which caused an exception when an invalid flag was passed
to DartDev as `log` was referenced in the `dart fix` command
description, which is accessed when building the usage message.

Also fixes a minor test failure related to usage line lengths not being
set correctly for `dart devtools`.

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

Fixed: 49437
Change-Id: Ib367677db5f34d7b6da31e51dbe717c954298ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251241
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-07-12 18:22:42 +00:00
Lasse R.H. Nielsen 3fc0bf7e59 Retire the 2.17 language feature experiment flags.
Remove them from tests.
(They should have been removed from tests before launcing 2.17.)

Change-Id: I546f6cb90fdf9e6ed1bb560f3715f9db163b7c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250384
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-07-11 13:02:22 +00:00
Ben Konyi c50236ff9c [ CLI ] Ensure training arguments aren't parsed by the CLI for JIT snapshots
TEST=test/commands/compile_test.dart

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

Change-Id: I15462eb617de2dca042ee445b85084b8b8602f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249340
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-06-24 14:26:39 +00:00
Sam Rawlins 567b45fb1d Add the enable-experiment flag back to DAS
Bug: https://github.com/dart-lang/sdk/issues/48960
Change-Id: I6576f45e63e28902986db844df49a06a71385704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245202
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-06-16 16:26:39 +00:00
Ahmed Ashour 85700570f6 Fix typos
Fixes #49241

TEST=ci

Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-15 11:08:28 +00:00
pq 8d9009d610 fix path normalization for windows
See: https://github.com/flutter/flutter/issues/105641#issuecomment-1150497628

Change-Id: I176467d5885feab1c44892ea9140f619e30df223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247608
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-06-09 03:00:02 +00:00
Jaime Wren 128a7e1641 Modify dartdev language-server to call the server snapshot
This change also modifies the Dart Analysis Server to default to use the LSP protocol

Change-Id: I73a1ceae9a05bc8e5af219e4f28df959c054d4c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247461
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-07 21:31:02 +00:00
pq 467a1b05c0 dart fix for single files
Fixes: https://github.com/dart-lang/sdk/issues/43892

Change-Id: If1dca6bdef59e9de6dfd74e9774f61072651166d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246160
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-06 17:42:14 +00:00
Jaime Wren 6c210bbc57 Revert "Modify dartdev language-server to call the server snapshot"
This reverts commit 1598182907.

Reason for revert: The snapshot for the DAS needs to have the default set before this change can land.  Will work with Analyzer folks in the morning to put together a new PR.

Original change's description:
> Modify dartdev language-server to call the server snapshot
>
> Change-Id: I6fc7b2c1e55089fa0bf88633733c51ff768e699b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246059
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Jaime Wren <jwren@google.com>

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

Change-Id: I848f4ad08405fee5aeb0d2eb166f95390e81bb3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246840
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-02 05:13:26 +00:00
Jaime Wren 1598182907 Modify dartdev language-server to call the server snapshot
Change-Id: I6fc7b2c1e55089fa0bf88633733c51ff768e699b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246059
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2022-05-31 21:40:44 +00:00
Devon Carew f7c46f145c [pkg] prefer 'any' deps for package dev dependencies
Tested: CI validation
Change-Id: If65cc156130a65ffe00c6f1660ac320e2921afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246053
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-05-27 01:34:59 +00:00
Danny Tuppeny 3790378936 [dartdev] Fix test expectation when analysis results include warnings
Fixes https://github.com/dart-lang/sdk/issues/49098.

Change-Id: I930182207b51f44b7c371c4d38db440700e31514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-25 20:57:58 +00:00