Commit Graph

68 Commits

Author SHA1 Message Date
Daco Harkes 70a56b3947 [deps] Roll dart-lang/native
`dart pub get` will create a `package_graph.json` now. Ensure this
file exists (besides the `package_config.json`).

Change-Id: I6ed5e395f101c298a999f51d61b096659db70930
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428600
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-05-15 03:08:52 -07:00
Danny Tuppeny f24d4d1653 [dartdev] Fix some tests to work under 'dart test'
Now that the SDK uses Pub Workspaces, using the test runner is enabled in Dart-Code. However there are some differences when using 'dart test' that caused some of these tests to fail - this change addresses them:

- Don't use Platform.script because it won't be the source Dart filename
- Make any `args` to `main()` optional
- Add calls to `test()` around some regression tests

I still have a few remaining failures locally, but I'm not yet sure if they're related to the test runner and will troubleshoot them separately.

Change-Id: I01efc5517174ae7e8146892bba1d84cc69029fd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421162
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-04-15 07:45:39 -07:00
Danny Tuppeny c34f79355f [dartdev] Fix analysis test failing on Windows due to drive letter casing mismatches
On the bots, the system temp directory has a lowercase drive letter (`c:\`) but the analyzer normalises the path to uppercase. The output for the error being used in the test contains a complete path so this allows for casing differences.

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

Change-Id: Id85fba7965a64a83783e7eb8e180cac0a5df9a1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
2024-06-20 18:40:15 +00:00
Danny Tuppeny c001d5116a [analyzer] Prioritize errors in analysis_options/pubspec errors when running "dart analyze"
This changes the (non-machine/json) output of "dart analyze" when there are errors in pubspec.yaml/analysis_options.

Before:

```
Analyzing myapp...

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error
  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

After:

```
Analyzing myapp...

Errors were found in pubspec.yaml or analysis_options.yaml which may result in other incorrect errors.

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error

Errors in other files that might be caused by those above.

  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

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

Change-Id: I25ae7b200463f2cd3f2046ea9f5f8ddc5c62cc60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372080
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 17:29:16 +00:00
Ben Konyi 7af23509d1 [ CLI ] Handle improperly formatted package_config.json in warnOnNativeAssets
Fixes https://github.com/dart-lang/sdk/issues/55490

Change-Id: I50a5fa43b79312c0d1236d543ad050de2ee6c9dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364240
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-04-23 20:16:12 +00:00
eliasyishak 4ea4eec023 Update DEPS
R=jacobr@google.com

Change-Id: I70dbe194f519d50f6a0cb244b1f80bd6c1fa9186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360540
Commit-Queue: Elias Yishak <eliasyishak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-02 19:32:22 +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
Vyacheslav Egorov 80d8f1d03f [vm] Make dart run --resident work in SDK checkout
Resident runner used to look either for pubspec.yaml
or .dart_tool/package_config.json to find package root.

However it does not make much sense to look for pubspec.yaml
you can't resolve packages using just pubspec anyway - you
need package_config.json. This was making it impossible
to use resident runner with packages in Dart SDK checkout:
each package contains pubspec.yaml, but package_config.json
is generated at the root of SDK checkout instead.

This CL also removes support for .packages file - we have
deprecated and removed this file in 2022.

R=kustermann@google.com

TEST=manually

Change-Id: I18ce7a1a82bc72bbc944d8ab2d40f40cdb15cc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357620
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-03-19 11:58:05 +00:00
asiva 6ee5474a62 [dartdev/tests] Fix racy tests.
Fix vm service tests which are racy as dds is spawned as an external
process and the testee process might have exited before dds
connects to it.

Change-Id: I514e20c84c6041cb1b65854494698911a34eb50e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352464
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-20 19:14:44 +00:00
Ben Konyi 12e52d8fde Reland "[ CLI ] Migrate to use package:unified_analytics"
This reverts commit b0abe686fc.

Change-Id: I0a94061ade8ccdec84a90e782fa50eb68c1bcc1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338700
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-11-28 19:26:51 +00:00
Ben Konyi b0abe686fc Revert "[ CLI ] Migrate to use package:unified_analytics"
This reverts commit 756675bcdb.

Reason for revert: Breaking analyzer bots

Original change's description:
> [ CLI ] Migrate to use package:unified_analytics
>
> Change-Id: I542fe1e17f728e027c3769d931d13257ef24c496
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317461
> Reviewed-by: Elias Yishak <eliasyishak@google.com>

Change-Id: Ie9ba2955a0661011adbb6786df2e01c7601e06fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338500
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
2023-11-27 21:00:17 +00:00
Ben Konyi 756675bcdb [ CLI ] Migrate to use package:unified_analytics
Change-Id: I542fe1e17f728e027c3769d931d13257ef24c496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317461
Reviewed-by: Elias Yishak <eliasyishak@google.com>
2023-11-27 19:52:42 +00:00
Daco Harkes e1ae1b48ae [vm/ffi] dartdev CLI native-assets
This CL introduces native assets suport for `dart run` and introduces
`dart build` which is similar to `dart compile` but outputs a folder
instead to that native assets can be bundled with an executable.

Change-Id: Ib6cfb95539f0adee46c99e531e440928c3f72f2b
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/+/267340
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-05-30 09:10:28 +00:00
Ben Konyi ffe1c532e5 Revert "Resolve package pubspec of target for relevant dartdev commands"
This reverts commit 645511d7f4.

Reason for revert: Deemed too risky to land so close to the release branch cut
Original change's description:
> Resolve package pubspec of target for relevant dartdev commands
>
> Adds a `--no-pub` flag to those commands
>
> Bug: https://github.com/dart-lang/sdk/issues/50422
> Change-Id: I949605c4ebb4c609eb19159625958317e54523a9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291500
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

Bug: https://github.com/dart-lang/sdk/issues/50422
Change-Id: I465e43c59240e545658dce2e3fd764755d55ca97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293560
Auto-Submit: Ben Konyi <bkonyi@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-04-05 00:43:54 +00:00
Sigurd Meldgaard 645511d7f4 Resolve package pubspec of target for relevant dartdev commands
Adds a `--no-pub` flag to those commands

Bug: https://github.com/dart-lang/sdk/issues/50422
Change-Id: I949605c4ebb4c609eb19159625958317e54523a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291500
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-31 14:03:31 +00:00
Sigurd Meldgaard d5da8dc67d Improve dartdev testing
* Auto-dispose the TestProject (several instances were never disposed)
* Don't rely on package:test by default from the test-project.

Change-Id: I383eb36cbacb341b702f42075af562d20a2be45d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291069
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-27 14:52:23 +00:00
Janice Collins 68353d76a4 Add a flag to disable the new unified_analytics for a single session.
- Adds a new flag, `--suppress-analytics` to the `dart` command to
  disable both the unified and the legacy analytics for a single
  session while deprecating the existing flag, `--[no-]analytics` used
  for disabling the legacy analytics on a single pass.
- Pipelines the flag from `dart` through `dart analyze` and `dart fix`
  to the execution of the analysis server.
- Updates all applicable uses of `dart analyze`, `dart fix`, and the
  analysis_server binary entry points in the SDK to disable analytics
  for the test infrastructure.

Bug: https://github.com/dart-lang/sdk/issues/49445
Change-Id: I1302cad7e04b21454aa7d9e8ee72a876b231377d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287661
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2023-03-16 18:00:57 +00:00
Janice Collins 5b3f387f4d Make dartdev test_all.dart test all and work.
This corrects some tests that just weren't working for myself and
others while disabling a small number that don't work anymore or
are blocked on a bug.

Bug: https://github.com/dart-lang/sdk/issues/51707
Change-Id: Ib537d210e80baa3bb80578f0fcccc063a2029173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288623
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2023-03-14 16:19:08 +00:00
Brian Wilkerson 14ff1f2d35 Generate a diagnostic for language overrides prior to 2.12
Change-Id: Ia10cf89443208ef133dd1ce8d68ee7c6b4129fbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-10 05:27:48 +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
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
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
Sam Rawlins 2316c7291c Move existsSync into try/catch, to fix flake
Fixes https://github.com/dart-lang/sdk/issues/48271

Change-Id: Ie1eb59f0f5ba873822d9c277f00482a7d4cf74cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-05-02 03:37:59 +00:00
Sam Rawlins ed68a37df7 Tidy code in dartdev
Just code I was tidying while investigating a dartdev bug. Complies
better with Effective Dart.

* https://dart.dev/guides/language/effective-dart/design#dont-redundantly-type-annotate-initialized-local-variables
* https://dart.dev/guides/language/effective-dart/design#avoid-abbreviations

Also restrict a utility function to accept a non-nullable String and
return a non-nullable String.

Change-Id: I465a320cbd4fe9f7625119e873f67425b4caf8e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-02-28 23:35:57 +00:00
Ben Konyi 1486443d6e Reland "[ CLI ] Attempt to execute samples generated by 'dart create' templates"
Adds missing `PUB_CACHE` entry to a couple of places where a new process
is spawned.

This reverts commit 7a7c36ab2f.

Change-Id: I198deeb29ab32ca325b4d918b36ab94609a17de1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227560
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-25 20:05:42 +00:00
Ben Konyi 250173e60c [ CLI ] dartdev null-safety migration cleanup
Follow-up to https://dart-review.googlesource.com/c/sdk/+/229948

Change-Id: If5624638eeb629ea025ec04b6a11d23144ea43ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231741
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-02-04 19:23:40 +00:00
Ben Konyi 1c571a12fa [ CLI ] Migrate package:dartdev to null safety
Fixes https://github.com/dart-lang/sdk/issues/47964

TEST=CQ

Change-Id: I4ee57bc5739835824b0052bd9470a0d52ccf161b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229948
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-26 21:16:49 +00:00
Alexander Aprelev f40b06a8ac [dartdev] Make directory cleanup more resilient on Windows.
Processes on Windows can take longer to exit, taking longer for directories they use to become available for deletion. Accommodate this potentially lengthy by trying several times to delete temp directories before failing the test.

Fixes https://github.com/dart-lang/sdk/issues/47700
TEST=run_test on Windows

Change-Id: Id73d6ba3ff981ed59c89ab833f5775eff5375ae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226980
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-01-07 19:12:56 +00:00
Ben Konyi 7a7c36ab2f Revert "[ CLI ] Attempt to execute samples generated by 'dart create' templates"
This reverts commit e59f59d49a.

Reason for revert: Causing timeout failures on pkg-{mac,win}-release

Original change's description:
> [ CLI ] Attempt to execute samples generated by 'dart create' templates
>
> Fixes https://github.com/dart-lang/sdk/issues/47458
>
> Change-Id: Icf3c03c6d1f33ef9be30e4bf826813674e9e9fb7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220883
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=mit@google.com,devoncarew@google.com,bkonyi@google.com

Change-Id: Id27c1f9ec124dad8556e1733220284180302b30e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226561
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-05 17:43:15 +00:00
Ben Konyi e59f59d49a [ CLI ] Attempt to execute samples generated by 'dart create' templates
Fixes https://github.com/dart-lang/sdk/issues/47458

Change-Id: Icf3c03c6d1f33ef9be30e4bf826813674e9e9fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220883
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-04 17:48:56 +00:00
Ben Konyi 78b7fc5ac1 [ CLI / Gardening ] Wait for process to exit before cleaning up test
directory

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

Change-Id: Ifc0783409bdea308ba861f8021489ea8e58022c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224080
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-12-15 01:13:15 +00:00
Ben Konyi c39b243435 [ CLI ] Avoid awaiting on join() calls in test harness
Fixes #47750

Change-Id: I179a9e987cea157257d40d6e840e9f4ff5539877
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221543
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-11-30 16:39:25 +00:00
Ben Konyi 2408d38878 [ CLI / Gardening ] Kill test subprocesses before deleting directories
Previously, if a test timed out and the `tearDown` callback was invoked
to cleanup the temporary project, we would try and cleanup the temporary
directory even if the subprocess hadn't exited. This works fine on most
platforms, but causes an exception to be thrown on Windows as the
subprocess still holds a handle to the temporary directory. Ensuring the
subprocess is killed before deleting the temporary directory will
prevent us from encountering errors on cleanup on Windows.

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

Change-Id: I71599908c31a1b32afed15c1388d228618462506
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220641
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-19 21:14:28 +00:00
Sigurd Meldgaard ecc6ed1b32 Send resolution analytics from dart pub get/upgrade/...
Also enables batched analytics (up to 20 events will be sent together in
one request if they are all issued before control is returned to the
async queue).

Change-Id: Ic23429d4981bc33a34cb19ffc00affdd09dfe511
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217014
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-10-25 12:35:30 +00:00
Konstantin Shcheglov f726874678 Support for --cache in 'dart analyze'.
Bug: https://github.com/dart-lang/sdk/issues/45267
Change-Id: I503227ac59a3562e79d3654c405debaf5d0c764c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-03 18:43:08 +00:00
Devon Carew f6ce7a829f In-line the package:stagehand templates into 'dart create'.
Change-Id: I717f0970314700b123b750fcfe7ed066ba88d2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192944
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-25 18:05:09 +00:00
Konstantin Shcheglov 1712737dea Support for single file analysis in 'dart analyze'.
Bug: https://github.com/dart-lang/sdk/issues/43891
Bug: https://github.com/dart-lang/sdk/issues/43271
Change-Id: Ifb3c0c10eabaabb19777838bccf7851199b8c778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 17:21:50 +00:00
Sigurd Meldgaard e7fdd7b693 Let experimental features specify an example for tooling to have generic
tests.

Bug: https://github.com/dart-lang/sdk/issues/44937
Change-Id: I309e6e4299b09705f653d59c7842a05fdf7cdaa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184790
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-02-23 13:57:29 +00:00
William Hesse 88b6c207e7 [dartdev] Fix analytics test on Windows
The default Process.runSync doesn't expect utf-8 on stdout on Windows.

Fixes: https://github.com/dart-lang/sdk/issues/44981
Change-Id: If80fcaa9ce54fdd64c2c8f40779c646f1c37fdea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184468
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-12 18:37:52 +00:00
Devon Carew ad3c3644a4 Add an initial version of a 'dart language-server' command.
Change-Id: Iffb8dedf7419a421e5282e09b4584e768c47e53f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176485
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 18:14:51 +00:00
Sigurd Meldgaard 8a71e75a46 Detect pubspec presence and dependency on package:test from dart test --help
One shortcoming is that `dart help test` doesn't follow the same rules.
This is harder to address.

Bug:https://github.com/dart-lang/sdk/issues/44369
Change-Id: Idb5b86251ebbe71ecb70292ee93d26b3d71263fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175060
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-01-05 14:09:39 +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
Sigurd Meldgaard ce272daae8 [dart cli]: Use the correct package_config from dart run and dart test
Before `dart run` would always use the package config found by looking up the hierarchy from
whatever we got from getExecutableForCommand.

When that happened to be a precompiled snapshot this would work, because it would be ignored.

But if it would be a dart-file in another package (that would happen if that package is not cached)
we instead should resolve it relatively to the current working directory
(where the pubspec.yaml is also found).

Bug: https://github.com/dart-lang/sdk/issues/44214
Change-Id: Ib2e929c01ddc72babbcff91560236e08429f09f7
TEST=The new package config behavior is tested by the new test in: pkg/dartdev/test/commands/run_test.dart.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172181
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-17 10:20:00 +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
Sigurd Meldgaard 9d132ebba9 Bump pub
New commits:

git log --format="%C(auto) %h %s" 900e796a37fd9f68de9dd183cf4798fe5f055eaa..4ca4767a6c00b2dadecdaee9a4866dae40ef25f2
 4ca4767a Added a dart pub outdated --transitive option (#2731)
 6b145bd6 Deprecate --server argument to `pub publish` and `pub uploader`. (#2697)
 7737023a don't warn if previous prerelease was null safe (#2730)
 62f92838 Improve outdated --mode=null-safety (#2724)
 cc589ec3 Change message for no Latest resolution (#2729)
 656803e9 Require sdk constraint (#2718)
 8309d877 Added test that dev_dependency does not trigger null-safety warnings when publishing (#2727)
 332ea049 Remove warning about mixed mode. (#2723)
 a98a1f23 Simplify null-safety analysis in `pub outdated --mode=null-safety` (#2721)
 5fba2015 Outdated null safety implies prereleases (#2722)
 fb9ec4af Fixed bug in yaml_edit (#2703)

Change-Id: I22a084aee06542e04a272269fb0134f0ac62f779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170690
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-06 15:36:02 +00:00
Paul Berry 7322bc027e Migration: replace pub outdated check with a check on transitive imports.
Instead of running `pub outdated` to see if the user's dependencies
have been migrated yet, the migration tool now examines all of the
transitive import dependencies of the user's code to see if they are
opted in to null safety.  This produces a more accurate result than
`pub outdated`, because it is able to ignore files in transitive
package dependencies that aren't reachable via imports
(e.g. references to `package:analyzer` brought in by `package:test`).

Fixes #44061.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I38465bcbf35e8552f0060b5d51c0f1cfc5d18c7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-11-05 23:05:51 +00:00
Sigurd Meldgaard cef4423445 [Dart CLI] Test analytics
This sets up a framework for testing the analytics that will be sent for
a given command and includes a few tests.


Change-Id: I1c79691d7741d4b0cac6e9cafc943f67ceca6ac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168947
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-10-26 16:00:26 +00:00