Commit Graph

892 Commits

Author SHA1 Message Date
Robert Nystrom 1345cdf399 Roll dart_style 3.1.0 into the SDK.
Change-Id: I6392327cadce5194dabaa719bff945868a690225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419990
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2025-04-10 23:55:02 -07:00
Daco Harkes edde8133b7 [deps] Roll dart-lang/native
The dart-lang/native packages do no longer have path dependencies in
them. So instead of rewriting those paths in the tests, write
dependency overrides into the test projects.

To simplify path handling, use absolute paths in the dependency
overrides.

Change-Id: I0db8529543a280fe937465e9a9c9aa4bb8fd0ee1
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/+/420900
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2025-04-08 23:37:10 -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
Daco Harkes 17558d5f9d [native assets] Support user-defines from pubspec
Change-Id: I9978bbb3bae0170b76f9419e18f4b18f75dab577
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/+/420700
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2025-04-07 09:58:40 -07:00
Daco Harkes 8e71bac222 [deps] Roll dart-lang/native
Change-Id: Iafb418d4769de9d4fdf000e29de51bfcdef5b67b
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/+/420661
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2025-04-07 09:58:40 -07:00
Ivan Inozemtsev 2d80285a45 SDK Cache fixes for dartdev cross compilation
- Use `signed` stage only for executables (dartaotruntime is not signed)
- Ensure user-executable bit only for executables
- Fix Windows path issue (https://github.com/dart-lang/sdk/issues/60462)

Change-Id: I012c6df34174e292979610dabf1e9a5f486ef39e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420101
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-03 06:50:10 -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
Daco Harkes 90aecc4fe8 [deps] Roll dart-lang/native
Change-Id: Ic8a01cf2cd93d0f4ad89478efc0d412b2ab39039
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/+/418580
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2025-03-31 02:34:09 -07:00
Sigurd Meldgaard 2fe05bd568 Reland "Migrate to use pub workspace"
This is a reland of commit b9b77058a9

Original change's description:
> Migrate to use pub workspace
>
> Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
>
> All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
>
> All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
>
> Bug: https://github.com/dart-lang/sdk/issues/56220
> Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
> Tested: relies on CQ of existing tests. Should have no effect on functionality
> CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I29afabade2d2447dea05121cb87ff50bb21a4b76
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `//
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415561
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-20 06:19:16 -07:00
Ömer Ağacan 55d57541cb [dart2wasm] Fix --extra-compiler-option parsing
Don't split the `--extra-compiler-option` values by commas, to allow
passing `-D`/`--define` flags like `-DFOO=a, b` as one argument.

Fixes the dart2wasm failure in #60346.

Change-Id: I9c621f93d4bcd4e35926e495735c8d15a3bac212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-19 05:36:17 -07:00
Ömer Ağacan f4b41f0902 [dart2wasm] Fix handling of --define/-D
When parsing `--define` or `-D` arguments don't split the the value by
commas.

This is consistent with how dart2js handles `-D`, but inconsistent with
how VM handles it.

Example:

    void main() {
      print(const String.fromEnvironment("FOO"));
    }

When compiled with `dart compile js -DFOO="a, b"` and run, dart2js
prints

    a, b

VM prints (when compiled to exe)

    a

Between these two, I think dart2js' behavior is more common, so we
follow dart2js.

Also update compile_benchmark to avoid splitting a single argument "a b"
into "a" and "b" when parsing the arguments and then splicing them back
before calling `dart2wasm`.

Also update the test runner and ddc batch mode argument parser to handle
splitting quoted arguments in `// dart2jsOption = ...` and the same
options for ddc and dart2wasm, by moving dart2js's `splitLine` to a new
library and reusing it in the test runner and ddc.

Fixes https://github.com/flutter/flutter/issues/164873.

See also https://github.com/dart-lang/sdk/issues/60341 for relevant
future work.

Change-Id: Idbdf69072fa212c8e4a390990577eb5a57b49e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-03-18 04:11:41 -07:00
Sigurd Meldgaard 6c4de1ab7e Revert "Migrate to use pub workspace"
This reverts commit b9b77058a9.


Revert "Add missing sample pubspec to workspace"

This reverts commit 892ea15ac7.


These seem to break the engine.

Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 09:08:20 -07:00
Sigurd Meldgaard b9b77058a9 Migrate to use pub workspace
Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.

All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.

All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 05:21:40 -07:00
Daco Harkes ecb620191c [deps] Roll dart-lang/native
Change-Id: I9ca6b437c06320ad9436d19050571fa6844f1b2f
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/+/414980
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2025-03-12 10:41:42 -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
Sam Rawlins 539840f91c dartdev: Simplify some JSON-parsing code; remove dead code
* In `_handleServerResponse`, use if-case with map patterns to avoid
  casts and null checks and repeatedly fetching map values.
* Remove the castStringKeyedMap utility. After some other changes,
  most call-sites passed in a Map, so then half of the utility is not
  used. In the others, it seemed simplest to use `as Map` and `.cast()`
  inline.
* Change some `dynamic` local variables to be `Object?` instead.
* Replace `DartdevCommand.project` getter and `_project` field with a
  single final field.
* Remove unused properties from `Project` and unused `PackageConfig`
  class.
* Remove associated tests.

Change-Id: I1f626ecc0e6e4d27ef24f65959fd4cb54fb5fc92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412980
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-02-28 14:54:14 -08:00
Sam Rawlins b42700fb21 DAS plugins: Print plugin pub-related crash information to terminal; stop analyzing
Change-Id: Id7f3d9957c52239210029b3b5c3e6f58d96a4d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413000
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-28 14:38:48 -08:00
asiva 1e148e651b Fix issue that was found with the flutter rolls (unable to locate
the dds snapshot)


Reland "[SDK] Switch dds and dtd to use an AOT snapshot"

This reverts commit 11ab2dfe2f.

Reason for revert: Fixes the problem that is causing Flutter G3 roll to fail.

TEST=ci

Original change's description:
> Revert "[SDK] Switch dds and dtd to use an AOT snapshot"
>
> This reverts commit 6450d76f1f.
>
> Reason for revert: Breaking Flutter G3 roll
>
> Original change's description:
> > [SDK] Switch dds and dtd to use an AOT snapshot
> >
> > TEST=ci
> >
> > Change-Id: Ib65ca1d1a05d3bc7b5f5cab25d90fc459ec8d853
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387133
> > Reviewed-by: Ben Konyi <bkonyi@google.com>
> > Commit-Queue: Siva Annamalai <asiva@google.com>
>
> Change-Id: I9985919063cacfc8673b3e2946eaa163e90c9cc3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411200
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I5ec8e58f905b4ad1d22d507acd8e22e676dc5532
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410921
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-02-25 14:32:41 -08:00
Moritz c4c805da60 [native assets] Single SoT for package name on Dart build
Do not use the folder name as a proxy for the package name.

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
Change-Id: I17664ea88a4e317d994d93ae84a5584078e5f94d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410360
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Moritz Sümmermann <mosum@google.com>
2025-02-21 08:30:28 -08:00
Ben Konyi 11ab2dfe2f Revert "[SDK] Switch dds and dtd to use an AOT snapshot"
This reverts commit 6450d76f1f.

Reason for revert: Breaking Flutter G3 roll

Original change's description:
> [SDK] Switch dds and dtd to use an AOT snapshot
>
> TEST=ci
>
> Change-Id: Ib65ca1d1a05d3bc7b5f5cab25d90fc459ec8d853
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387133
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I9985919063cacfc8673b3e2946eaa163e90c9cc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411200
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-02-20 15:17:16 -08:00
asiva 6450d76f1f [SDK] Switch dds and dtd to use an AOT snapshot
TEST=ci

Change-Id: Ib65ca1d1a05d3bc7b5f5cab25d90fc459ec8d853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387133
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-02-13 09:11:38 -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
Sam Rawlins 8ed5503eeb dartdev: Add comment about analysisFinished.
Change-Id: Iefd2daa478e0b8426e9d8786c169fd8cbdd5e5c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-24 07:47:28 -08:00
asiva 98aa84290b [dartdev] Switch 'compile js-dev' to use VmInteropHandler.run
TEST=ci

Change-Id: I9a19b6d746ab8d87a2d7993b89fdf62ed06edaab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405540
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-01-23 08:56:59 -08:00
Daco Harkes e78459bf90 [deps] Roll dart-lang/native
Change-Id: I77c3928e03a688443a2bb9c67c350b72a7ddd192
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/+/405360
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-01-22 10:38:58 -08:00
asiva 1a486499bf [dartdev] Fix ia32 invocation of dart2js from 'compile js' command.
TEST=ci

Change-Id: I5b7a180cdadeb9a78038af8dc0631fad7b757a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405260
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-01-21 14:18:08 -08:00
Mohamed Abdelaal 9b7bb9df90 Fix "the the" typo
Closes https://github.com/dart-lang/sdk/pull/59926

GitOrigin-RevId: cb37bca473b0c177b876a0f4e75858cd1862e699
Change-Id: I6827241b22e99db455945afcdfbaee0450999ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404923
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-21 14:08:20 -08:00
Daco Harkes e1eade612a [deps] Roll dart-lang/native
This CL refactors the native assets implementation in Dartdev:

* It introduces a `DartNativeAssetsBuilder` that wraps all logic.
* The code now explicitly searches for a package config, and invokes
  `pub get` if that file does not exist but a pubspec does.
  (For most `dartdev` commands, `pub get` was already running later
  implicitly.)
* The code now explicitly searches for a `runPackageName` and skips
  building native assets if a package name cannot be found.

Change-Id: Ib5562fc64c3a756c99fee2e2daa763eb6fb1e855
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/+/404583
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-01-21 13:09:32 -08:00
Daco Harkes 762a4c7e91 [deps] Roll dart-lang/native
This CL goes part of the way to support pub workspaces with native
assets.

This CL makes the `runPackageName` explicit in every invocation. This
ensures not too many native assets are built.

Moreover, this CL also makes `packageLayout` explicit, ensuring the
right packages config file is used.

A follow up PR should fix the checks w.r.t. the experiment not being
enabled.

For more info see:
https://github.com/dart-lang/native/pull/1911

TEST=pkg/dartdev/test/native

Change-Id: I3c3123526e320abb8bb094116e58bb4340c4c052
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/+/405141
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-01-20 10:37:34 -08:00
asiva da6dc03a15 [dartdev] switch the analysis server to use VMInteropHandler instead of
spawning an isolate (higher memory footprint)

Change-Id: I74bcb382c6269183beb4b8f2fcd04aee10eaa549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404921
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-01-17 10:58:12 -08:00
asiva 7b25ce88d3 [dartdev] Use VmInteropHandler for invoking sub commands
Use VmInteropHandler for invoking sub commands instead of running them
in an isolate. Running sub commands in an isolate causes an increased footprint.
Changing this to use VmInteropHandler avoids the additional memory footprint.

Commands that need to use an AOT runtime for execution now exec the AOT
runtime and run the command.

TEST=ci

Change-Id: Ic96845b19951170effea3dd3619f798e2c72968a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-01-16 09:15:01 -08:00
Sigurd Meldgaard afcfe1e133 dart create: Stop progress before exiting with error
Otherwise the progress gizmo just keeps spinning, and dartdev never exits.

Change-Id: I53aa04a214354f3a5b085fa9d7bb562131f8ab95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403990
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-01-16 05:01:33 -08:00
Daco Harkes ac9acf5165 [deps] Roll dart-lang/native
Change-Id: I556a179784952cf12ff97da155d0f5596f91b500
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/+/403985
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-01-14 04:54:20 -08:00
Devon Carew 9ab2316d32 refactor dartdev deps
Change-Id: I6bf49395abd39bea20acd8bc1c39c8db4fdabaaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2025-01-09 09:03:32 -08:00
Liam Appelbe 9b631bf333 [deps] Roll dart-lang/native
Change-Id: I4a37c01fefdf00e128b7b2716ac893b3aed10171
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/+/403585
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-01-08 20:05:37 -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
Michael Thomsen 71f18e8a0c Update dartdev readme
Change-Id: I087c78a95b89d365df148ab8eee8a3314f61ce40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398641
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Michael Thomsen <mit@google.com>
2025-01-06 08:35:42 -08:00
Ben Konyi 7783e61a02 Revert "[dartdev] Use VmInteropHandler for invoking sub commands"
This reverts commit 08252fc9e9.

Reason for revert: https://github.com/dart-lang/sdk/issues/59784

Original change's description:
> [dartdev] Use VmInteropHandler for invoking sub commands
>
> Use VmInteropHandler for invoking sub commands instead of running them
> in an isolate. Running sub commands in an isolate causes an increased footprint.
> Changing this to use VmInteropHandler avoids the additional memory footprint.
>
> Commands that need to use an AOT runtime for execution now exec the AOT
> runtime and run the command.
>
> TEST=ci
>
> Change-Id: If7aed1cab2fec9d9940bd562ad5aa9c4e9a6ac7f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398604
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Brian Quinlan <bquinlan@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I82a997d49a7d52e1fdaa7d75f509603ebe5e51dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401901
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-12-20 11:12:00 -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
Daco Harkes 85f689811f [deps] Roll dart-lang/native
Change-Id: I38b68ed5b6d4497e36463b7be16258d2e7a7c0d0
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/+/402100
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-12-20 08:49:58 -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
Daco Harkes c2abea3155 [deps] Roll dart-lang/native
Change-Id: I3fc1f2be91d1bbbe1af8b9c4585671db8e86efea
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/+/400300
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-12-18 02:09:52 -08:00
asiva 08252fc9e9 [dartdev] Use VmInteropHandler for invoking sub commands
Use VmInteropHandler for invoking sub commands instead of running them
in an isolate. Running sub commands in an isolate causes an increased footprint.
Changing this to use VmInteropHandler avoids the additional memory footprint.

Commands that need to use an AOT runtime for execution now exec the AOT
runtime and run the command.

TEST=ci

Change-Id: If7aed1cab2fec9d9940bd562ad5aa9c4e9a6ac7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398604
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-12-17 16:00:02 -08:00
Derek Xu 0ce6724f40 [ResidentFrontendServer] Add 'replaceCachedDill' endpoint
TEST=test case added to
`pkg/frontend_server/test/src/resident_frontend_server_test.dart`

Change-Id: I45a4b28c8c89714dcb93fa7f64874e158a0d69df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394763
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-12-11 13:26:55 -08:00
Daco Harkes 71f7a42f42 [deps] Roll dart-lang/native
Change-Id: I581e44384bca5145e8c3c33a4fbc102d6b7a97bd
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/+/398063
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
2024-12-09 11:28:22 +00:00
Gabriel Terwesten 903eea6bfb [vm,dartdev] Support dynamic linking between libraries
The same bundling that is used for `dart build` is now also used for
`dart test` and `dart run`, except that the output directory is
`.dart_tool/native_assets`. This way all native code assets are placed
next to each other in the `lib` directory, and loaded from there
instead of loading them in place from where the build/link hooks
placed them. By standardizing on this layout the different modes of
running dart code that support native assets can use the same
mechanisms to support dynamic linking between libraries.

On macOS, install names of dylibs are rewritten to support dynamic
linking, similar to the changes in
https://github.com/flutter/flutter/pull/153054.

On Windows, loading of DLLs is altered so that the directory of the DLL
that is being loaded is considered when loading dependent DLLs.

Tests are added to verify that dynamic linking works as expected.

TEST=pkg/dartdev/test/native_assets/{build,run,test}_test.dart

R=mosum@google.com

Related: https://github.com/dart-lang/native/issues/190
Fixes: https://github.com/dart-lang/sdk/issues/56459
Change-Id: Ie4a41e5b7382ab1cea39e93d29d085bf9986828b
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/+/381580
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-12-06 13:00:12 +00: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 b196577f19 [dartdev] Move some resident compiler utils from package:dartdev to dart:vmservice_io
TEST=CI

Change-Id: Ibabbb47cc5951f35dfe09259c7320fa8f930f157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-11-28 16:18:52 +00:00