Commit Graph

325 Commits

Author SHA1 Message Date
Brian Wilkerson 0dd4a95b3c Display correct line and column offsets for context messages
The line and column offsets for the context messages were being computed
based on line information for the file in which the diagnostic was being
reported, which can be different than the file pointed to by the context
message. This ensures that we use the right line info.

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

Change-Id: I6dbc95bde5aeb1abc70d90767dc59082982a5a96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-19 09:23:59 -07:00
Daco Harkes 245498232c [deps] Roll dart-lang/native
`package:native_assets_cli` has been split up and
`package:native_assets_builder` has been renamed.

Change-Id: Ic9d5c21bb3c7ecf7924fdee6b4281153ad37fac5
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/+/425504
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-05-01 02:18:11 -07:00
Sam Rawlins 06f5db3480 dartdev: Enforce strict-raw-types
Change-Id: I593497edfbb05f0b524de4d18dc87ef7d1efdd2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425583
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-04-30 14:06:44 -07:00
Daco Harkes 108e40f31b [deps] Roll dart-lang/native
Change-Id: I418ca4177b64ec566d6e5afa876f6ab23c77a4f9
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/+/425040
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-04-29 05:54:11 -07:00
Ivan Inozemtsev c5dc292196 Remove --experimental-cross-compilation flag
The cross compilation will be supported in 3.8.

Change-Id: Icedd1fe51198558b5a62fc431d4699e63557a2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424442
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-04-24 08:40:58 -07:00
Derek Xu 9d2f622f38 [dartdev] Introduce dart run --resident --quiet
Fixes: https://github.com/dart-lang/sdk/issues/56865
Change-Id: I1a88ba40351ed1b42bb1a800b384a00eb7548225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418740
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-04-07 11:49:24 -07:00
Ivan Inozemtsev 9c88769967 Dartdev cross compilation support
- Add `target-arch` option to `dart compile exe|aot-snapshot`
- Add artifacts cache in `~/.dart`, and download gen_snapshot and
  dartaotruntime from cloud storage if necessary

I've manually built an aot snapshot and exe on macOS ARM64 for Linux
X64, copied them over to a linux machine, and made sure they work.

Change-Id: I74dd581ecb573ff4069a2fe19f9d04aaa352538e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417801
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-04-02 08:14:28 -07:00
Nate Biggs 237742feab [dart2js] Remove '--no-sound-null-safety' flag and make '--sound-null-safety' flag a no-op with warning.
Change-Id: I0225f9306aa2a84494f3fc17c9f7191214404249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406081
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-03-03 15:46:16 -08:00
Daco Harkes 98e29db45c [native_assets] Disable experiment on stable and beta channel
We want to avoid users passing `--enable-experiment=native-assets` on
stable and beta, as we'd like to move fast and break things on the
experiment. This aligns the experiment with how the experiment is
working in Flutter: main and dev branch only.

Before this CL, dartdev did not check experiment flags. Unknown
experiments would fail in the VM. After this CL, dartdev checks the
experiment flags and errors out early.

Change-Id: I875ea3272f4b67342da19ea2e4be329a4b380573
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406660
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-02-04 03:36:43 -08:00
Daco Harkes b693194f41 [native assets] Don't fail early on invalid package config
Bug: https://github.com/dart-lang/sdk/issues/59992
Change-Id: If7aff2aeecbab347f5bcb997e6fd6043e8818e1b
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-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-01-28 08:19:39 -08:00
Derek Xu fc95268a36 [ResidentFrontendServer] Cache the compiler options that were last used
to compile every entrypoint

This is necessary to ensure that the options used when performing
compilation during expression evaluation or hot reload match the options
that were used to compile the running program before it was started.

TEST=test case added to pkg/dartdev/test/commands/run_test.dart, CI

CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: If11207e090d9b02d5a6a8396e09dc90d0c874f58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-01-08 14:51:12 -08:00
FMorschel 1c4d7e1d4d [DAS] Fixes multiple fixes for insertions in multi-file library
Merges the test in https://dart-review.googlesource.com/c/sdk/+/401840 that is related to https://dart-review.googlesource.com/c/sdk/+/401180, but in the LSP handler where it can be more easily debugged.

R=pquitslund@google.com

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

Change-Id: I03874be3671dfbfa65a2f0b9f3916ecafcad9400
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401865
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-06 13:50:12 -08:00
Derek Xu 26fdfabf14 [VM/Service] Use the resident frontend server for expression evaluation when it's available
TEST=tests added to pkg/vm_service/test

CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes within
sdk/lib/vmservice/.
Change-Id: I191bb7f3ec3abf1f42405a43ce72016796bc43f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394523
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-12-20 09:00:17 -08:00
pq 6456180562 [dart fix] failing test for fixes in parts
Bug: https://github.com/dart-lang/sdk/issues/59572
Change-Id: I6d70f5801b7e7f27ad944a1335b7f0aeba857e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401180
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-19 13:05:48 -08:00
Derek Xu 6eae080b55 [ResidentFrontendServer] Make ResidentFrontendCompiler handle dill caching instead of dartdev
TEST=modified the "kernel cache respects directory structure" test case
in `pkg/dartdev/test/commands/run_test.dart`, CI

Change-Id: I93ebfd8860904988f36f4232b5461e5c6e64884d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-12-03 19:17:51 +00:00
Derek Xu 0ac63b6d79 [package:frontend_server] Move ResidentCompilerInfo and sendAndReceiveResponse from package:dartdev to package:frontend_server's resident_frontend_server_utils.dart
Change-Id: Ie3c8ac69413d55e510d86c5b20f059d5d5301ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-11-28 16:18:52 +00:00
asiva 0b38e4b189 [dartdev] Add 'compile js-dev' command in the Dart cli tool.
Added the option 'js-dev' to the compile command to allow compilation
of Dart sources using DDC. This ensures that tools will not be reaching
into the internal implementation details of a Dart SDK to run DDC.

TEST=unit tests added in compile_test.dart

Change-Id: I3c670b43a989dfa60c75622fdbc1b7f99b399293
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392202
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-10-29 20:54:59 +00:00
Ben Konyi 6a9a4f0d0c [ CLI ] Support --suppress-analytics before CLI commands and for dart test
Fixes https://github.com/dart-lang/sdk/issues/56842

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

Change-Id: I1692352e3847c977c72a948d26be8ef8311ec69e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390900
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-10-18 15:02:06 +00:00
Devon Carew d27e14496f Bump args to 09c0fca1785c9df39288a48f767994eed80bed40
Changes:
```
> git log --format="%C(auto) %h %s" e623652..09c0fca
 https://dart.googlesource.com/args.git/+/09c0fca Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group (286)
 https://dart.googlesource.com/args.git/+/9cdc872 Add argument name when throwing a `ArgParserException`. (283)

```

Diff: https://dart.googlesource.com/args.git/+/e623652744c82533829f2e62b1aba1a6cf06e291..09c0fca1785c9df39288a48f767994eed80bed40/
Change-Id: I804c86db060b3c83acd34c00dd76953c6f28f70a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388744
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-10-10 16:06:10 +00:00
Ben Konyi 12d9f40961 Reapply "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 9f5246e8c6.

TEST=Existing tests

Change-Id: I658290f248d8b26c05f24b7125c3ba71de318bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385121
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-09-26 15:29:05 +00:00
Ben Konyi 9f5246e8c6 Revert "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
This reverts commit 81b9957bdd.

Reason for revert: Breaking multiple configurations.

Original change's description:
> [ CLI ] Don't disable DDS when --disable-dart-dev is provided
>
> Fixes https://github.com/dart-lang/sdk/issues/56605
> Fixes https://github.com/dart-lang/sdk/issues/54841
>
> TEST=N/A
>
> Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>

Change-Id: I5c6cb302d8160f19bad437341cdcd80bcc08d921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384881
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-09-12 01:15:27 +00:00
Ben Konyi 81b9957bdd [ CLI ] Don't disable DDS when --disable-dart-dev is provided
Fixes https://github.com/dart-lang/sdk/issues/56605
Fixes https://github.com/dart-lang/sdk/issues/54841

TEST=N/A

Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-09-11 18:01:25 +00:00
Martin Kustermann 0e620b27a0 [dart2wasm] Align test outcomes of dart2wasm across configurations
Aligns exit codes of

  * `dart compile wasm` and
  * `pkg/dart2wasm/tool/compile_benchmark`

Also make them use exit codes recognized by the test runner to
distinguish CFE crashes, CFE compile-time-errors and other failures.

Also update status file entries to from D8 specific entries
to JS commandline shell entries

=> Step towards aligning D8 & JSC test results

Change-Id: I1acb8803f5db7c732ad546d5989b1c555583e7c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383660
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-09-05 11:22:18 +00:00
asiva 27cbf50a26 [VM/FFI] Add a test case for issue dartbug.com/56064
Adding a test case for issue dartbug.com/56064 which needs to be cherry
picked into the stable release. The fix was done in
https://dart-review.googlesource.com/c/sdk/+/368341

TEST=new test being added

Change-Id: I4e58ef5a33c335ba91b639ce4fcebd052969e07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374143
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-07-02 22:09:59 +00: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
Vyacheslav Egorov 945153584c [dartdev] Add --depfile option to dart compile
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.

To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.

TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com

Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-23 12:58:29 +00:00
Ben Konyi 0c547d2833 [ CLI ] Fix DART_VM_OPTIONS usage only resulting in printing of help message
Fixes https://github.com/dart-lang/sdk/issues/55767

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

Change-Id: I6a773acbd9fc21c086fc459c7cb983ea1ff11fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367720
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-22 20:06:49 +00:00
Sigurd Meldgaard 57a7ad165e Bump pub to 84895ca4c52df5ecc7dd4d439365c3045b7c2165
Changes:
```
> git log --format="%C(auto) %h %s" e184bfc..84895ca
 https://dart.googlesource.com/pub.git/+/84895ca4 Fix fast path check of ensureUpToDate (4271)
 https://dart.googlesource.com/pub.git/+/89e386bc Rewrite `getExecutableForCommand` tests to test with an external process. (4268)
 https://dart.googlesource.com/pub.git/+/7ab4020e Connect to _PUB_TEST_DEFAULT_HOSTED_URL instead of pub.dev when testing (4270)
 https://dart.googlesource.com/pub.git/+/c2592b3e Use lint unreachable_from_main to avoid dead code (4244)
 https://dart.googlesource.com/pub.git/+/a87b84dc Allow invoking `getExecutableForCommand` everywhere in workspace (4257)
 https://dart.googlesource.com/pub.git/+/a284c9b3 Remove debug logging statements (4267)

```

Diff: https://dart.googlesource.com/pub.git/+/e184bfc725793cbbf222fa8d8f96da10c40af24a..84895ca4c52df5ecc7dd4d439365c3045b7c2165/
Change-Id: I1eacbe85bd1016099575af06751205a94f988b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367000
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-05-17 08:50:30 +00:00
Ben Konyi 5f3cd4afe3 [ CLI ] Implicitly set --mark-main-isolate-as-system-isolate for dart test
Fixes https://github.com/flutter/flutter/issues/143170

TEST=test_test.dart

Change-Id: I98044ab2362adcdd55c4f6def0752a755b1385b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366040
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-05-10 19:28:45 +00:00
Michael Thomsen 138573ebfd Update compile status output
Fixes https://github.com/dart-lang/sdk/issues/55526

Change-Id: I30515a7e104f62fc43f6abc018cbb0614b2ed5e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365462
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-05-06 17:46:41 +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
Derek Xu defa4d76a3 [CLI] Account for SDK version changes that happen between when resident frontend compilers are started and when they are used
TEST=test case added to pkg/dartdev/test/commands/run_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Fixes: https://github.com/dart-lang/sdk/issues/55349
Change-Id: Ic3db064d0975e6b999beefed8b6fc32d2c603cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362522
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-17 20:48:55 +00:00
Derek Xu 48e13f6078 [CLI] Introduce shutDownOrForgetResidentFrontendCompiler utility
function

TEST=test cases added to
pkg/dartdev/test/commands/compilation_server_test.dart and
pkg/dartdev/test/commands/run_test.dart

This CL factors out shutDownOrForgetResidentFrontendCompiler from the
CompilationIssue.serverError handling code in RunCommand. This CL also
changes the error handling logic of `dart run --resident` and
`dart compilation-server shutdown` to stop them from displaying
unactionable errors to the user, and instead have them handle those
errors more gracefully.

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I214392911dbb44e3273ffd36f8f59f791b33494c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362520
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-12 21:23:59 +00:00
Alexander Markov af876893d1 [vm] Unsound mode cleanup: remove canonical type erasure
Canonical type erasure was used when running without sound null
safety. VM no longer supports unsound mode, so canonical type erasure
can be dropped.

This is a preparation to switching platform kernel file from
nnbd-agnostic mode to null-safe.

Also
* pkg/vm/test/modular_kernel_plus_aot_test.dart is migrated to
  sound mode;
* test cases for unsound mode are removed from
  pkg/dartdev/test/commands/compile_test.dart.

TEST=ci

Change-Id: I2ed0b84cffd650bbaecf4ee99f23da2fdc09de71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362162
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-04-12 15:42:47 +00:00
Ben Konyi 802c80458e [ CLI ] Support --enable-asserts for aot-snapshot and exe compile modes
Fixes https://github.com/dart-lang/sdk/issues/53343

TEST=compile_test.dart

Change-Id: Ic99988fe253b8c6dd2a03121ba7d0a525633c7cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361960
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-04-09 17:58:02 +00:00
Derek Xu c490c4bd4c [CLI] Make passing --resident a prerequisite for passing --resident-compiler-info-file
TEST=test case added to
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I3d982a8d85b63fed8510144bade71e2c95ced121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359581
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-02 22:07:47 +00:00
Derek Xu 1ea64da84b [CLI] Replace --resident-server-info-file option with --resident-compiler-info-file option
For backwards compatibility reasons, the arg parser will still understand --resident-server-info-file, but it will not print a help message for it.

TEST=pkg/dartdev/test/commands/compilation_server_test.dart and
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I59a1a7c495194ff3c48de7fb65255de5d9f150f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359660
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-02 22:07:47 +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
Derek Xu 889bd483d4 [CLI] Make --resident-server-info-file option handle relative paths correctly
TEST=Test cases added to pkg/dartdev/test/commands/run_test.dart and
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: Iebd20c82dd9aeac44fd9ec76206a5a3a15403829
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358543
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-20 22:42:19 +00:00
Johnni Winther 4b21f58d39 [cfe] Don't emit warnings on null-aware access on non-nullable
Change-Id: I94f3011f69330f5b2d8998f29eb9511517e1fffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357301
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-03-20 14:04:29 +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
Kenzie Schmoll 408918d6f5 [dds] Start DTD from DevTools server if it is not already started.
Fixes https://github.com/dart-lang/sdk/issues/54937.

Tested: pkg/dartdev test for `dart devtools` command, and new `dtd_test.dart` in pkg/dds.
Change-Id: I530ba2fe4d5809082378b61c282ba7856974e21e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354460
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-03-18 21:50:09 +00:00
asiva 1a5db159f2 [VM/dartdev] Remove all unsound null safety tests running on the VM
1. Remove all unsound null safety tests on the VM
2. Do not pass the --sound-null-safety flag on VM runs as it is the
   default and this option is going to be removed soon.

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

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

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

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

TEST=regression test added to run_test.dart.

Fixed: 55185
Change-Id: I1c89fec3ee46296ee4ebb847eb47a7845dfdb399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357360
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-03-13 17:08:39 +00:00
Ben Konyi 0728ffbf53 [ CLI ] Add --write-service-info flag to dart run
This was already a valid VM option, but since it wasn't listed as an
option for the `dart run` command, it was treated as an unexpected
argument when provided after the `run` command.

Change-Id: If05c3e4c8465ab0b5a088a9c5f4cf5386c231f42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354981
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-28 21:38:27 +00:00
Ben Konyi ce642d040f [ CLI ] Add support for passing VM options to Dart runtimes via DART_VM_OPTIONS
The DART_VM_OPTIONS environment variable allows for users to specify a
set of VM options to be processed by the Dart runtime in a
self-contained executable created by `dart compile exe`.

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

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

TEST=compile_test.dart

Change-Id: I1d94ab1b992753a7dd69da722c051c9464d6d1cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353820
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-26 21:07:40 +00:00
asiva 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
kzrnm 47c93a9396 Fix path on Windows test
R=kustermann@google.com, mit@google.com, rmacnak@google.com

Bug: https://github.com/dart-lang/sdk/issues/54903
Change-Id: I132ef3385cdde03ab73df194414a38f9fd9927a9
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try,pkg-linux-release-arm64-try,pkg-linux-debug-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Kzrnm <gengesa@gmail.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-14 00:27:52 +00:00
Dan Chevalier 03f797a85a Solidify dtd lifecycle
- devtools server can now take the dtd uri as a parameter on startup
   - dtdUri is passed to the server handler so that devtools can request it.
- FileService is implemented inside the Dart Tooling Daemon (dtd_impl)
    - Added FileService.setProjectRoots
    - Added unit tests and rpc exceptions
- on startup dtd now prints { uri, secret } so that the caller has the secret that allows them to call FileService.setProjectRoots

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

Change-Id: I7a66aca2f8f06f6a611a46c727a9d5c2485fbe3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346922
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-13 16:17:18 +00:00