Commit Graph

379 Commits

Author SHA1 Message Date
Daco Harkes b6e952b50c [test] Add a test testing the test environment
Bug: https://github.com/dart-lang/native/issues/1447
Change-Id: I0dd6d659a0fde1c6b0e3cc0dc81e2f01b7146f32
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/+/381982
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-23 15:18:31 +00:00
Ben Konyi e9be5dc4aa [ CLI ] Fix issue where 'dart build' would fail to find the 'dart' when run from PATH
Fixes https://github.com/dart-lang/sdk/issues/56080

Change-Id: I301b6959e372c2ad8b72ce055645b5affce5516e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376860
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-07-22 13:57:56 +00:00
Daco Harkes 7d4280022c [native_assets] Stop running link hooks in JIT mode
Note that the `add_asset_link` example project has it's build hook
`exit(nonZero)` because the project only works with link hooks
enabled.
Therefore, the test expectations for `dart run` is that it fails, and
for `dart build` that it succeeds.

Bug: https://github.com/dart-lang/native/issues/1252
Change-Id: I8566d1289a079078586a2e6149f5b77e641618f9
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/+/375100
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-07-10 11:28:47 +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
Daco Harkes 9588927faf [vm] Native asset relative path resolution with symlinks
This CL moves native assets resolution to the embedder.

The Dart VM looks up the asset path (for example
`['relative', 'foo.so']`) with the asset id. The embedder defines
callbacks for asset loading, and returns a handle to the dylib.
Then the VM calls the embedder again with `dlsym` to lookup the symbol.

The Dart VM & kernel compiler are responsible for the asset id to
asset path mapping. The kernel compiler compiles it into the snapshot
and the VM looks it up in the snapshot.

Relative paths are resolved relative to the isolate script uri (kernel
snapshot, jit snapshot, aot snapshot, or `dart compile exe` result).
The embedder is responsible for remembering the script uri it set when
spawning the isolate group.

This CL does not add `dlclose` or `dladdr` embedder callbacks yet.
Bug: https://github.com/dart-lang/sdk/issues/55521
Bug: https://github.com/dart-lang/sdk/issues/55966

TEST=pkg/dartdev/test/native_assets/build_test.dart
TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55410
Bug: https://github.com/dart-lang/sdk/issues/55523
Bug: https://github.com/dart-lang/sdk/issues/55207
Change-Id: I75ec4a368c5fb3d2f76b03771e796ff56bcac941
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361881
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-12 16:45:19 +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
Moritz ec4e420698 Add link.dart hook
Adding a linking script support, see go/resource-shaking. The goal is to run a `link.dart` script after kernel compilation complimentary to `build.dart` running before.

Change-Id: Iadc8648ae5fa2e823b6541c5bc08617bb860a017
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/+/338380
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-05-08 16:04:12 +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 aa4aa6975d [CLI] Add ResidentCompilerInfo class
TEST=test case added to
pkg/dartdev/test/resident_frontend_utils_test.dart

Issue: https://github.com/dart-lang/sdk/issues/54245
Change-Id: I5b1d5227657cb9c17d6c4e84be9e23d36c04571f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-12 21:23:59 +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
Sigurd Meldgaard bc555a8ddb Don't run file named <command> with `dart <command>
Bug: https://github.com/dart-lang/sdk/issues/55370
Change-Id: I32561ea3f410495540b7cc3810b6635396d884de
Tested: In pkg/dartdev/test/no_such_file_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361363
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-04-05 15:16:39 +00:00
Derek Xu be04ce25ca [CLI] Ensure that resident frontend compilers never try to compile kernel files or snapshots
Refer to the magic numbers in https://github.com/dart-lang/sdk/blob/main/runtime/bin/dartutils.cc

TEST=pkg/dartdev/test/resident_frontend_utils_test.dart, manual testing

Issue: https://github.com/dart-lang/sdk/issues/54245
Fixes: https://github.com/dart-lang/sdk/issues/49694
Change-Id: I3ba67f4a68898c3f8b24d19a7516e3d8713d886d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359921
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-03 19:38: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
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
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
Daco Harkes d243eb1254 [deps] Roll dart-lang/native
https://github.com/dart-lang/native/pull/1018
https://github.com/dart-lang/native/pull/1019

Change-Id: I0371ebbbba872bf90514f0f2e255957f6a89c8c5
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/+/357605
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-03-19 14:58:26 +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 58098d3414 [VM/Service] - Launch dds from vmservice code instead of dartdev code
Currently the dds process is being launched from dartdev and
this causes problems when the dartdev commands 'run' and 'test'
are implemented by spawning child processes (this is needed
to make dartdev an AOT snapshot).
This CL attempts to lauch dds from the service isolate code.

TEST=ci

Change-Id: Iad00a17473a630659f15a5c73be0f5385ea35bdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350688
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-02-22 06:22:12 +00:00
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
Devon Carew b6799fed19 [deps] rev crypto, dartdoc, ecosystem, lints, native, sse
Revisions updated by `dart tools/rev_sdk_deps.dart`.

crypto (https://github.com/dart-lang/crypto/compare/c954015..f059196):
  f059196  2024-02-08  Kevin Moore  Test dart2wasm (dart-lang/crypto#162)

dartdoc (https://github.com/dart-lang/dartdoc/compare/457c34e..f152c01):
  f152c013  2024-02-08  Sam Rawlins  Tidy spacing in templates (dart-lang/dartdoc#3652)
  d0c53b9f  2024-02-07  Sam Rawlins  Change all late final Iterable fields to Lists (dart-lang/dartdoc#3649)
  8c9c7790  2024-02-06  Sam Rawlins  Remove unnecessary ExtensionTarget mixin (dart-lang/dartdoc#3648)
  d2f90c5a  2024-02-06  Sam Rawlins  Fix the 'serve testing-package' task to generate docs (dart-lang/dartdoc#3647)

ecosystem (https://github.com/dart-lang/ecosystem/compare/7d8ec47..3e4f286):
  3e4f286  2024-02-08  Moritz  Add ignore flag for `publish.yaml` (dart-lang/ecosystem#237)

lints (https://github.com/dart-lang/lints/compare/90a61e4..ead7708):
  ead7708  2024-02-08  Devon Carew  add library_annotations; remove package_prefixed_library_names (dart-lang/lints#179)

native (https://github.com/dart-lang/native/compare/876f9a1..cb9bd7e):
  cb9bd7ef  2024-02-09  Daco Harkes  Build hook spec (dart-lang/native#955)

sse (https://github.com/dart-lang/sse/compare/e483b14..af7d8d0):
  af7d8d0  2024-02-09  Ilya Yanok  Make `SseConnection` extend `StreamChannelMixin<String>` (dart-lang/sse#102)

Change-Id: I2e85dbfae00eea8de7b6f7efce1993bf00e243f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352046
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2024-02-13 00:30:32 +00:00
kzrnm 72aceb7732 dart analyze --format=json print a machine readable output
`dart analyze --format=json` has extra output, which must be removed before it can be read by the machine.


R=dacoharkes@google.com, fishythefish@google.com, scheglov@google.com

Bug: https://github.com/dart-lang/sdk/issues/54877
Change-Id: I8047a987b65eb8309ef33603cdaf401a400d550b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351840
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Kzrnm <gengesa@gmail.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-12 17:03:31 +00:00
Ben Konyi 5a38644295 [ CLI ] Update dart compile {exe, aot-snapshot} to allow for compilation from kernel
Also updates `dart compile kernel` to use `gen_kernel_aot.dart.snapshot`
instead of the VM's `--snapshot` flag.

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

Change-Id: Ifa6afed2428e41fdcff97183f3f3a2ddefec5042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349280
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-07 02:39:02 +00:00
Daco Harkes f4c3572c18 [deps] Rev native packages.
`package:ffi` has moved from dart-lang/ffi to dart-lang/native.
Stop pulling in dart-lang/ffi and update the revision for
dart-lang/native to include a revision with `package:ffi`
`tools/generate_package_config.dart` should automatically update
the toplevel `.dart_tool/package_config.json` to point to the new
checkout location the Dart SDK.

Also rolls breaking change in native_assets_cli:
https://github.com/dart-lang/native/pull/885

And rolls the move of the test projects:
https://github.com/dart-lang/native/pull/938

Change-Id: Ibc1c88026487bece2580a7d3d4ceb7ee50cd76d0
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346761
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-01-26 16:12:29 +00:00
Martin Kustermann 19caeb8604 [dart2wasm] Make dart compile exe use .unopt.wasm instead of .wasm.unopt
* It had already the assumption there's a `.` in the name but didn't
  check for it
  => Validate that the output file ends with `.wasm`

* Make the unoptimized wasm (if emitted) be `.unopt.wasm`
  => It's a wasm file, so it should have a .wasm extension

This is a step towards making flutter use `dart compile wasm`
directly without the AOT snapshot of pkg/dart2wasm/bin/dart2wasm
and wasm-opt separately. Which will allow removing of the duplicated
wasm-opt flag list in flutter.

Change-Id: I685bb1aaa9d95ab43936bab68add916a642eb296
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347280
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-19 09:53:08 +00:00
Ben Konyi 232f5d9325 [ CLI ] Fix devtools_test.dart on Windows
Fixes https://github.com/dart-lang/sdk/issues/54666

Change-Id: I7a2dd434734b92bd0554e2481f129da1d83f39bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347142
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-01-19 00:27:23 +00:00
Ben Konyi 8db4393f1e [ CLI ] Start DDS instance if VM service URI passed to dart devtools doesn't have a DDS connection
This is can happen if a Dart or Flutter application is started in a
non-standard way (e.g., not through the `dart` or `flutter` CLI
tooling). Developers using custom embedders need to use `dart devtools`
to start a DevTools instance, so it's a good opportunity to check for a
DDS instance and launch DDS for the target application if one isn't
found.

Change-Id: I817ca0951c7839e8e9a0d1c78756caa45381cea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346820
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-18 16:28:37 +00:00
Ben Konyi 3c42222b7e [ CLI ] Add tooling-daemon command to support launching the Dart Tooling Daemon (DTD)
This change includes the following:
 - A new `tooling-daemon` CLI command to launch DTD
 - Minor refactoring of package:dtd_impl to better match expected
   Dart package structure
 - Updated build rules to create dart_tooling_daemon.dart.snapshot

Change-Id: Idd91bc4ce64ce790db5bad323a50d9cf65523dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344800
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-08 17:07:55 +00:00
Parker Lougheed 5592a0fd5f [dartdev] Roll pub to a3689f03168c896dd1cb0db8a60c568b38ee16bf
It's been a few months since pub was updated and there are some good enhancements that would benefit from larger testing. Happy to close this if pub hasn't been updated in a while on purpose though!

Diff: https://github.com/dart-lang/pub/compare/1779628b386819675130f14326f1e8812901c48f...a3689f03168c896dd1cb0db8a60c568b38ee16bf/
Change-Id: I69ee1fcf8df8ed61fffa7729c36a214cb1871230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345101
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2024-01-08 10:40:37 +00:00
Ben Konyi 98df4cb81d [ CLI ] Fix error message for dart compile {exe,aot-snapshot} on IA32
We should have been printing an unsupported error instead of a missing
SDK artifact error.

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

Change-Id: Ibe8b5d01338423696b013e64bb9ccffd3d2ea3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344240
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-01-02 17:34:35 +00:00
Moritz 182a20f835 Fix failing tests in pkg:native
Rev the import and fix the tests in pkg:dartdev to reflect recent refactorings.


Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try

Change-Id: If3df36284b1a324cbdc94b709008891b1f3d756f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341221
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2023-12-13 11:00:41 +00:00
Ben Konyi afb529a671 [ CLI ] Fix analytics_test
--analytics doesn't enable analytics (it's no longer a valid VM flag), so
we're safe to remove related tests.

Change-Id: I50bfb7c6da8c2596b9f95969d6a5b6927e15a900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341400
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-12-12 18:45:51 +00:00