Commit Graph

915 Commits

Author SHA1 Message Date
kevmoo 45c27304eb Bump tools to 338a2c8380059afb250a1d0c26555e4da24c6ccc
Also removed SDK-version of api_summary.

Migrates the `api_summary` package from the SDK (`pkg/api_summary`)
to the `tools` monorepo (`third_party/pkg/tools/pkgs/api_summary`).

Updates SDK workspaces and dependency overrides in `pubspec.yaml`
and unit tests in `tools/bots/test_matrix.json`.

The API summary when through a review when landed in tools and includes additional changes. See https://github.com/dart-lang/tools/pull/2412/commits

The changes to `api.txt` files are due to this bug fix:
https://github.com/dart-lang/tools/pull/2412/changes/1fcb09f9466740e21b93a1b082d2bd4cc9ded9c7#diff-ee68240679409574825ff54e43ecf132ff6eb7214844aabeb88b576944f4d5b7R372

Changes:
```
> git log --format="%C(auto) %h %s" 6a7dd15..338a2c8
 https://dart.googlesource.com/tools.git/+/338a2c83 [api_summary] Include mixins in textual API summaries (2417)
 https://dart.googlesource.com/tools.git/+/c436f994 feat(api_summary): Move api_summary package into the tools monorepo (2412)
 https://dart.googlesource.com/tools.git/+/abd67801 [markdown] fix new lint RE await in an async function (2416)
 https://dart.googlesource.com/tools.git/+/fc11c6ea [code_builder] Expand code coverage (2409)
 https://dart.googlesource.com/tools.git/+/999a2df4 [code_builder] Emit ignore_for_file bits correctly (2406)
 https://dart.googlesource.com/tools.git/+/215ed97c [code_builder] Drop unused dev_deps and rebuild (2407)
 https://dart.googlesource.com/tools.git/+/6b99b07f Remove some extra spaces in unformatted output (2403)
 https://dart.googlesource.com/tools.git/+/2bf09dee Mark AnsiCode and AnsiCodeType final (2402)
 https://dart.googlesource.com/tools.git/+/03f2c205 publish cli_util version 0.5.1 (2397)
```

Diff: https://dart.googlesource.com/tools.git/+/6a7dd15748e63db7d41cfee8294c54636b668f41..338a2c8380059afb250a1d0c26555e4da24c6ccc/

Change-Id: I239f01adc4f0ba5e939e517abcaa1143d538c949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507264
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-06-02 11:54:20 -07:00
Ryan Macnak 8b4420c381 [infra] Shard Fuchsia ARM64 builder.
Also remove some dead Fuchsia scripts.

Change-Id: I87349973e2f192cb8472bb2b5c18049025950760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508362
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-02 09:32:36 -07:00
Ryan Macnak 1d5057e94d [build] Use ad-hoc code signing by default.
Change-Id: I00b483581a04bfb4a4ed0d6212c767d67c003f83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508164
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-06-02 02:39:40 -07:00
Ryan Macnak e82bd2c8ed [infra] Shard QEMU builders.
Change-Id: I0f96cfb8a7305897116149e5453d0ee5eb3744e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508361
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-06-01 17:14:39 -07:00
Ryan Macnak 201abb5cd1 Reduce sanitizer build set.
Change-Id: Idd5df6ff7c5b4f6bc3ccb0a335df0d332556d6ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508420
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 16:57:43 -07:00
Ryan Macnak 108682198a Reduce dartfuzz's build set.
dartfuzz has been taking ~35 min to finish the build and upload steps even with 100% RBE cache hit rate, causing it to fail to finish before the first wave of nightly builders trigger.

Change-Id: I932facd77bc08f4d7236ae8c760013406a69fb0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507267
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-06-01 15:34:32 -07:00
Ryan Macnak 2bf2ff5682 [infra] Reduce Fuchsia build set.
Change-Id: Iba59af7e031bafc375669e0ba3cc84081476e6e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507720
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 10:54:02 -07:00
Ryan Macnak fc750ac8e0 [build] Remove unsigned executable memory permissions from the AOT runtime on Mac.
Snapshots are now generally signed Mach-O dylibs loaded by dlopen, instead of ELF files mapped executable by the VM's loader.

TEST=ci
Change-Id: Id19877bed0bd0282b320f070904a848b0c076a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-01 07:21:29 -07:00
Jonas Finnemann Jensen 8c42f67d35 [dartpad] Part 1-8 squashed into a single commmit.
Reviewed in https://dart-review.googlesource.com/c/sdk/+/497583

[dartpad] Part 1: Protocol and Scaffolding

This sets up folders for `package:dartpad` and `package:dartpad_worker`,

R=athom@google.com, sigurdm@google.com

including:
 * `OWNERS` files,
 * Protocol definition,
 * Exceptions, and,
 * Virtual file system utilities.

[dartpad] Part 2: HotReloadCompiler

Adds the hot reload compiler logic to dartpad_worker.

This is models on dartdevc with `--reload-last-accepted-kernel` and
`--reload-delta-kernel` options. I don't think this does an incremental
compilation, instead it does a modular compilation. Meaning, we can have
a huge collection of precompiled DDC modules and the compiler just gets
a DDC outline/summary dill files for these modules. But on the other hand
the actual code that is compiled will be recompiled on every compile()
call.

This is very important for flutter_web.js / flutter_web.dill where the
precompiled DDC modules is around 60 MB in total. The fact that
package:flutter is precompiled into flutter_web.js is critical for
compilation performance for small dartpad-style example apps.

The downside is that unlike incremental compilation with _frontendserver_,
if the user were to install package:http and use it in the app they are
compiling then every `compile()` call will recompile `package:http`.
Where as with _frontendserver_ we'd be able to invalidate specific files,
and only those would be recompiled.

This leaves future work to either:
 * (A) Add support for modular compilation to _frontendserver_, such that
   we can do incremental compilation without having to first compile all
   of `package:flutter`.
 * (B) Refactor compilation strategy implemented here, to leverage
   modular further. We could for example compile all dependencies from
   `PUB_CACHE` into a `pub_cache_outline.dill` inside the dartpad worker.
   Then recompilation would only touch the user-code. Granted this is
   still less than ideal.

At the moment the lack of incremental compilation is not a blocker,
current dartpad doesn't have incremental compilation, but granted it also
only supported a single file. This dartpad environment will support
multiple files, but adding many files will result in poor performance
until we refactor and figure out how to do incremental compilation.
Hence, why we shouldn't block progress waiting for incremental compilation
to work.

R=nshahan@google.com

[dartpad] Part 3: Pub execution wrapper

Adds the internal wrapper for executing pub commands inside the
worker's virtual file system.

R=sigurdm@google.com

[dartpad] Part 4: Language Server wrapper

Adds the internal wrapper for spawning and communicating with the
Dart LSP inside the DartPad worker.

R=scheglov@google.com

[dartpad] Part 5: DartPad Worker

Implements the main worker entrypoint, RPC message handling. The
`bin/worker.dart` is what will be compiled to WASM and will run as a
_Web Worker_.

R=sigurdm@google.com

[dartpad] Part 6: DartPad Client library

The public-facing `dartpad` library that developers use to embed
the compilation environment in their web applications.

This finishes `package:dartpad`featuring:
 * `DartPad.create()`, which creates a _Web Worker_ running the compiled
   `pkg/dartpad_worker/bin/worker.dart`, and returns a `DartPad` instance
   wrapping RPC calls into the _Web Worker_.
 * `Sandbox.createIFrame()` which creates a _sandboxed iframe_ containing
   precompiled DDC modules from the SDK assets and `sandbox.js` for
   wrapping `ddc_module_loader.js` with an RPC interface. This returns a
   `Sandbox` instance wrapping RPC calls into the _sandboxed iframe_,
   making it easy to load modules, run library entrypoints (main()),
   initiate hot-reload, or launch a flutter app.

This is an initial API design that works. There are minor inconsistencies
and improvements that we should do. But I propose that we do so in
follow-up PRs.

R=sigurdm@google.com

[dartpad] Part 7: Build Targets

Adds a `dartpad` target to the Dart SDK, which produces:
```
out/ReleaseX64/dartpad/
├── dart
│   ├── dart_sdk.js.map
│   ├── sdk.js
│   └── sdk.tar
├── ddc_module_loader.js
├── sandbox.js
├── worker.loader.js
├── worker.mjs
├── worker.support.js
├── worker.wasm
└── worker.wasm.map
```

The `dartpad/` output folder is intended to be used as `assetBaseUrl` in
client libraries provided in `package:dartpad`. And the `dartpad/dart/`
folder is intended to be used as `sdkLocation`. These files are not
intended to be distributed along side the normal Dart SDK, instead we'll
publish them on a CDN and let people use `package:dartpad` to point at
these files. If they want to self-host everything, they can copy from our
CDN or rebuild the files using a local Dart SDK checkout.

These files are also necessary for testing, to ensure that we have proper
integration tests for `pkg/dartpad_worker/`. As we will want to publish
these files on a CDN the actual compiled size in release-mode matters,
thus, we have enabled wasm optimizations steps in this mode.

R=rmacnak@google.com

[dartpad] Part 8: Tests for `package:dartpad` and `pkg/dartpad_worker/`.

We have 3 kinds of tests:
 * Unit tests (vm, browser or both),
 * Worker tests (vm and browser),
 * Integration tests (browser-only).

As the Dart SDK test runner simply executes `*_test.dart` files with
`dart` and doesn't support compiling tests to the browser, launching and
running tests in the browser, we employ `dart test` to run tests. We do
this by having `pkg/dartpad_worker/dart_test.yaml` specify that
`dart test` should look for files names `test_*.dart`, and we then create
`pkg/dartpad_worker/test/ci_test.dart´ to be a single test that simply
runs `dart test` as a subprocess. Thus, the only test file triggered by
Dart SDK test runner is `ci_test.dart`, and if you locally run `dart test`
this will run the individual `test_*.dart` files.

While this hack to use `dart test` isn't ideal it gives everyone a decent
work flow. And saves us from having to invent complex test harness for
`pkg/dartpad_worker/`.

**Worker tests** defined in `test/dart/worker/` and `test/flutter/worker/`
are all imported into `test_dart_worker.dart` and
`test_flutter_worker.dart` to reduce test compilation time. These have a
non-trivial compilation time because the worker is running in the test
process. This allows testing on VM, which can be easier to debug.

**Integration tests** unlike _worker tests_ launch the worker compiled by
the `dartpad` build target in a _Web Worker_. This has less compilation
overhead for the individual tests, but involves more setup, and can be
a bit harder to debug.

Both worker and integration tests employ `test/asset_server/` which serves
assets built by the `dartpad` build target, and serves as a pub-server for
tests. It also serves assets built by `tool/setup_local_flutter.dart`
which creates flutter assets, though this is not intended to run as part
of CI, since we do not have a Flutter checkout available. Thus, for the
time being flutter testing is local only. Maybe, later we'll move this
script to another repository.

R=sigurdm@google.com

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try
Change-Id: I3a99939ec5217b9f3a855fc5b9ad9699047d02cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507321
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-05-29 02:25:49 -07:00
Martin Kustermann 639f505308 [dart2wasm] Change dart2wasm-mac-safari to shards=1, i.e. no shards
Change-Id: Ia87d3ff035f936f1ca18a74a4ab75d464d502dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507020
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-05-28 06:23:29 -07:00
Alexander Markov 514be1781f [modular_aot] Add corelib tests to vm-modaot-mac-debug-arm64 bot
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I68b4c1ad40d21aa57cf79c802ce50073046cb208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505380
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-21 12:38:04 -07:00
Ryan Macnak b2911c0bf1 Fix GCC build.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/63406
Change-Id: I3bb3963fcc182777c5d2c0e062ae4bbf3c5aae75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-20 08:21:30 -07:00
Ryan Macnak 6613ac694e [infra] Fix wasted parent machine time on vm-mac-{debug,release}-arm64.
A test shard will run on the parent only if the tests are the last step.

Change-Id: Ib251abe84c631330432b1cdd75897cb0f540a6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504281
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2026-05-19 07:17:52 -07:00
Martin Kustermann 5ae8a02eec [dart2wasm/infra] Add dart2wasm-linux-mac builder to tools/bots/test_matrix.json
The configuration was already added long ago in [0]

[0] https://dart-review.googlesource.com/c/sdk/+/426461

Change-Id: If78a1d40311bda1ed3d2c1325cbc3063685ab9c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501501
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-18 01:26:32 -07:00
Ryan Macnak 017f2570d9 [test] Add missing FFI tests to the Fuchsia test package.
Change-Id: I333c5d99051e89b64aca9056b7892d245fda0fe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500480
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-04 10:40:32 -07:00
kevmoo a2055fbb82 pkg:api_summary
- Moved existing summary logic to the new package

Change-Id: I47d032f5a253cfa32d9b685d9ff18bb08f534177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499440
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2026-05-01 11:29:56 -07:00
Nate Biggs d43d9df1a7 [dart2wasm] Remove dynamic modules support from the dart2wasm compiler.
Change-Id: If92f55296dfe83b64165a2bd07eaefb7d137198c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497341
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-04-24 12:04:23 -07:00
Simon Binder b4cfeb1093 dart2wasm: Prepare standalone target
When compiled to WebAssembly, the Dart SDK needs access to external
host functions to implement regular expressions, stack traces, timers
and more. Currently, `dart2wasm` relies on `js_interop` definition to
implement these functions in JavaScript.

As discussed in https://github.com/dart-lang/sdk/issues/53884, an
alternative is to use `wasm:import` annotations to let an arbitrary
embedder that doesn't necessarily run in a JavaScript context inject
implementations for these host functions.

This would allow running `dart2wasm` apps by e.g.

  - using a runtime like wasmtime and defining host functions in Rust.
  - defining a wrapper module implementing required functions by
    delegating to WASI definitions, and then using say `wasm-merge` to
    run the app in any WASI-compatible runtime.

This prepares the `--standalone` flag on `dart2wasm` to do just that.
When enabled, the compiler uses a different SDK platform to use imports
instead of JS interop. For now, these platforms are almost identical:
I've ported the timer logic to use wasm imports as a demo, but the rest
is still based on existing patch files. We can revisit in subsequent
CLs to incrementally reduce `js_interop` dependencies before removing
that library from the `dart2wasm_standalone` target entirely.

Change-Id: I3f406afbf2dab65506094de5c3f4067f4db66f3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486380
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-03-19 01:25:57 -07:00
Ben Konyi f7a049dfb4 [ Service ] Initial implementation of VM Service based on package:dart_runtime_service
This change includes an initial implementation of the new VM service
implementation based on `package:dart_runtime_service`, along with the
necessary plumbing to start it in place of the legacy VM service
implementation.

The entrypoint for the new VM service implementation is located in
dart_runtime_service_vm/bin/vm_service_entrypoint.dart, which is
compiled into AppJIT and AOT snapshots when the
`--include-experimental-vm-service` flag is provided to `build.py`. To run
the VM with the new VM service implementation, the
`--experimental-vm-service` flag must be provided.

Currently, the experimental VM service implementation supports:

  - User specified ports
  - Authentication code flags
  - Enabling the HTTP server via SIGQUIT
  - Some service protocol RPCs that don't require an isolate ID (e.g.,
    `getVM`)

See go/dart-runtime-services-unification for more details.

TEST=Manual

CoreLibraryReviewExempt: dart:_vmservice is private
Change-Id: I4a58cd1fa0a386313baa3d5c5345720231279123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484820
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-10 13:27:01 -07:00
Alexander Markov 588d91dbc0 [test_matrix] Add vm-modaot-mac-debug-arm64 bot
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I18dd688879306bf647144e4988a1e1b0edba36eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481460
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-02-18 10:14:13 -08:00
Ben Konyi 27e03e18d5 [ Service ] Create package:dart_runtime_service
This change creates `pkg/dart_runtime_services/` with the initial
implementation of `package:dart_runtime_service`.

`package:dart_runtime_service` provides a simple interface to create
Dart services with common platform-agnostic features and behaviors,
while also allowing for configuration of custom service backends.

This initial implementation focuses on providing the initial shared
server functionality, including:

- Handlers for web socket and SSE connections
- Authentication code generation + validation
- Client management
- Initial RPC routing with two sample RPCs (getClientName, setClientName)

Change-Id: I1458269a5de7edd97120103a2c5fc2d0348eff31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478760
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-02-09 08:01:30 -08:00
Ryan Macnak cff8dc5fd6 Roll Clang from f77ce52b56d0 to b153f17b8aeb.
Change-Id: Ie6b115b09c3376cd5b5720e17a99d2d66ffe1a3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476085
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-28 11:33:12 -08:00
Alexander Markov 24739822e4 Testing configuration for modular AOT compiler
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I4c18cdb22b47ea805adb4295bc58d124954b0be7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472980
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-01-16 07:24:51 -08:00
Ryan Macnak cee7000c1a [test] Enable TSAN thread leak detection for most tests.
Disable for tests that use dart:io's exit.

Add missing thread joins to cc tests.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/41811
Change-Id: Id4e1a468a986c886fb5ae9e9677b4d8d0281cc79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468880
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-05 10:04:25 -08:00
Daco Harkes 0d052e3969 [deps] Roll dart-lang/native
This roll moves `package:record_use` to the dart-lang/native repo.

Change-Id: I31183dc8b72272d7e94ed3031ca0b8bfca583e0d
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/+/463662
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
2025-11-24 05:04:03 -08:00
Alexander Markov c9e8aab56b [bots] Increase number of shards for vm-aot-android-* bots
Shards on vm-aot-android-debug-arm64c and vm-aot-android-debug-arm_x64
bots have been timing out recently, exceeding 1.5h testing time.
It seems like they are making progress, but number of tests is quite
large.

Increase number of shards from 10 to 16 in order to reduce running
time of each shard and avoid timeouts.

Change-Id: Id53d2cdf1eaa2606874118153c0f9c822c212daf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461840
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-11-14 09:45:16 -08:00
Ryan Macnak f8e61ad148 [vm] Fix TSAN symbolization for Mac.
TEST=tsan
Change-Id: I44456d685737c0fe59c25d0f2cc9f6fc8a4ded56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456106
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-10-20 15:58:20 -07:00
Ryan Macnak 0a1678c06c [vm] Record stack for JIT TSAN.
The main interesting thing is that deopt can expand one optimized frame to multiple unoptimized frames, so deopt needs to call  __tsan_func_entry enough times to rebalance the stack.

Also fixes stack balance for throw error slow paths for AOT.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/61352
Change-Id: I3fdc8481bc8db7a3aec0fa1938ac3e0e96ac13a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452943
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-10-20 10:49:20 -07:00
Nate Biggs a8a2303fa7 [dart2wasm] Fix wasm unit test structure.
Previously these were being run with the standard "pkg" unit test suite.
All the other backends have their own unit test suite so this introduces
one for dart2wasm.

This ensures the tests run with the correct fileset (including d8).

Change-Id: I29cd0048a4d6731da3a20110f6e496fe7da0c3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454760
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-10-15 09:44:09 -07:00
Martin Kustermann 8322e6af37 [dart2wasm] Add support for reading wasm files to package:wasm_builder
This adds a wasm binary reader that produces an `ir.Module`.

We also make a few changes to existing code

* Represent the import section with an `ir.Imports` object (similar to
  `ir.Exports`, `ir.Functions`, ...)

* We make a bunch of data structures allocatable in uninitialized state
  (the fields being usually uninitialized `late final` fields) where the
  deserializer can create those objects and then fill in details later.

  => This comes partly due to the way wasm binaries are structured
     themselves: The "data count" section comes first so a reader knows
     how many data sections there will be, then the "code section" can
     refer to those data sections. Then afterwards the actual "data
     segment" comes that fills in the data of the section.

* We make names consistently optional: Wasm objects don't have to have
  names, so the names should be optional, so we make them `String?`. We
  also make them non-final as that's consistent with other names.

* We make the `ir.Types`, `ir.Functions`, ... objects have `operator[]`
  and the index used is the same index used e.g. in wasm instructions.

* We make static constants for section ids and custom section names.

Issue https://github.com/dart-lang/sdk/issues/60928

Change-Id: I5394d6b82cf4dc68d24cea1dee66c5b33eb2f60f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452144
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-10-01 03:37:31 -07:00
Ryan Macnak fe967a1adf [infra] Split GCC and MSVC builder configurations.
Change-Id: I5f17ac79843eac883584f957b3b5d405894de721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-09-30 11:14:14 -07:00
Ryan Macnak d65c6da10e [infra] Add more sanitizer configurations.
Change-Id: I58b170359fc76c31b408b05c77a7a1d5ae9bcf2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451121
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-09-23 16:31:24 -07:00
Ryan Macnak b50a115d15 [infra] Reduce Android shard count.
When the shard count is greater than the number of machines in the pool, shards are guarenteed to wait, increase latency relative to a lower shard count.

Change-Id: I1fd61a59837b767748c13120dec30ca6eb352f28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450946
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-09-22 12:40:24 -07:00
Ryan Macnak 333587b206 [dartfuzz] Reduce duration so it finishes before the nightly builders start.
Change-Id: I70f93c97cc89c23c900df951920e21c7f15d6cba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450944
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-09-22 11:19:44 -07:00
Ben Konyi be2d42a11f [ VM ] Remove dead fork of Observatory from runtime/
Observatory was moved to pkg/observatory in a previous CL.

TEST=N/A

Change-Id: Ie0e7cb71799408cefe30d2c72b4dfd7bd43747ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450221
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-09-17 15:15:26 -07:00
Ryan Macnak 496a2bdc9b Roll clang to 49f39b349db181ca516eb0253462105ff0e2c634.
TEST=ci
Change-Id: I38e9ad7b16ffb0a9d380c3ed23b17854dca5a32f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447440
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-09-15 10:00:29 -07:00
Jens Johansen a757154d93 [infra] Shard dart2js modular tests
* Shard dart2js modular tests (and decrease the shards of the
  unit tests)
* Remove folders we look for dart files in --- the remove folders
  doesn't contain any anyway and would have to be copied if keeping
  these lines.
* Fix sharding, previously trying to shard in 2 shards would only allow
  you to run ~50% of the tests:

```
$ out/ReleaseX64/dart-sdk/bin/dart pkg/compiler/tool/modular_test_suite.dart -nweb-unittest-asserts-linux --verbose --use-sdk --shards=2 --shard=0
Error: shard should be between 0 and 1, but got 0

$ out/ReleaseX64/dart-sdk/bin/dart pkg/compiler/tool/modular_test_suite.dart -nweb-unittest-asserts-linux --verbose --use-sdk --shards=2 --shard=2
Error: shard should be between 0 and 1, but got 2
```

  This has been corrected to allow from `1..n` for `n` shards to fit
  with what the testing system sends when specifying `shards` in
  `tools/bots/test_matrix.json`.

For previous try runs I extracted this:

Build 60615:
Shard #1: --- Total time: 04:27 ---
Shard #2: --- Total time: 05:19 ---
Shard #3: --- Total time: 04:23 ---
Shard #4: --- Total time: 10:29 ---
 => A total of 24:35 --- combined finish of 10:29
Modular tests: 32:19
Total bot runtime: 35:48

Build 60614:
Shard #1: --- Total time: 03:57 ---
Shard #2: --- Total time: 05:18 ---
Shard #3: --- Total time: 05:21 ---
Shard #4: --- Total time: 05:34 ---
 => A total of 20:10 --- combined finish of 5:34
Modular tests: 29:41 secs
Total bot runtime: 35:55

Build: 60613
Shard #1: --- Total time: 03:56 ---
Shard #2: --- Total time: 05:15 ---
Shard #3: --- Total time: 04:32 ---
Shard #4: --- Total time: 05:34 ---
 => A total of 19:17 --- combined finish of 5:34
Modular tests: 33:39
Total bot runtime: 38:51

With the new sharding I'd estimate that the unit tests and modular tests
would have finished in less than 13 minutes, making the bots finish in
~17 minutes, ~20 minutes and ~19 minutes instead.
The try-run with this ran in 17:06

Possibly a follow-up could do more stuff on the "main bot".

Change-Id: Ie5c96206deb9c0c6db3385bbca04ae6f4eab4c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448381
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-09-04 23:11:30 -07:00
Alexander Markov 9a3349ed41 [bots] Add vm-ffi-dyn-mac-{debug,release}-simarm64_arm64 bots to test dynamic modules on simarm64_arm64
Change-Id: I82d97b705c97d95b160f4faf96c01931b5ee58a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447600
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
2025-08-28 11:28:01 -07:00
Ryan Macnak e01d4b3cc6 [vm, compiler] Get the full Dart stack in TSAN reports.
Call __tsan_func_entry/__tsan_func_exit in functions that use __tsan_read/__tsan_write or call other functions. Call __tsan_func_exit once per frame when unwinding for exceptions. Do so only in AOT, since TSAN won't be able to symbolize JIT functions anyway.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/61352
Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try
Change-Id: Ie52c978c25664d78b834e9b72ecf7eb2a12cc2ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444181
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-08-26 11:50:13 -07:00
Ryan Macnak 3bc1985977 [infra] Add configuration for vm-tsan-mac-release-arm64.
Change-Id: I83e472910ed22394d9704afa48e24085fc65ebe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447001
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-08-26 11:46:56 -07:00
Alexander Markov d93cd6040f [test_matrix] Add vm-dyn-mac-debug-arm64 builder
Change-Id: I0f48f229f5517b5f5f0c9e160fe1d7c5cd445998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446003
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-08-19 13:16:34 -07:00
Ryan Macnak 048f059ce9 [infra] Increase Linux ARM64 testing to match Linux X64.
Making use of new capacity.

Also remove dead configuration for vm-checked-mac-release-arm64.

Change-Id: I3347d9ddf87e660ed00f7d88a91d058e78a0a564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445800
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-08-19 08:15:22 -07:00
Ryan Macnak e1619544a2 [infra] Increase Linux ARM64 sharding.
Making use of increased capacity.

Change-Id: I8161f39efdcb8cbc99f8b264afdb6ad13ef86d24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444925
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-08-13 09:45:50 -07:00
Alexander Markov ed1d4a5461 Run all tests on vm-dyn-linux-debug-x64 configuration
Change-Id: I660787d59b9cb905e5309f07d8aa4de69690c847
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444369
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-08-11 09:49:46 -07:00
Alexander Markov bbdc543c4d [tests] Run co19 tests on dynamic modules bots
Change-Id: Ie801f5c2c9f6c36cedf8f68b9a1eae5d5f322b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443580
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-08-04 14:23:21 -07:00
Daco Harkes 2af31661c6 [pkg] Introduce dart_data_home
The directory location depends on the current OS:
 - on Windows:
   - `%LOCALAPPDATA%\Dart\<tool>`
 - on Mac OS:
   - `$HOME/Library/Application Support/Dart/<tool>`
 - on Linux:
   - `$XDG_STATE_HOME/Dart/<tool>` if `$XDG_STATE_HOME` is defined,
      and
   - `$HOME/.local/state/Dart/<tool>` otherwise.

The Dart data home can be overridden with the `DART_DATA_HOME`
environment variable.

This CL does not start using the new location yet.

Bug: https://github.com/dart-lang/sdk/issues/60922
Bug: https://github.com/dart-lang/sdk/issues/41560
Bug: https://github.com/flutter/flutter/issues/59430
Change-Id: I55e0ba610f8665ea3c9f053b36c943b097313046
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/+/440462
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-07-16 01:05:13 -07:00
Alexander Markov c124f459ac [vm,test_runner] Run vm/* tests against interpreter
Introduce Dart_LoadLibraryFromBytecode to support loading unit test
libraries from bytecode.

TEST=ci

Change-Id: I7706fdb2acaf906f01f27f671e7193b9755efe0f
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439080
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-07-08 06:49:34 -07:00
Nate Biggs addbdcbd59 [dart2wasm] Add --dry-run flag to dart2wasm.
This new flag will run the CFE to create a kernel and then run a series of checks over the resulting kernel to look for errors that could block a wasm migration.

The compiler will then exit before actually starting the wasm compilation process. This means no output file will be emitted so callers must be aware of this.

This first CL is not meant to cover every check we could add here. It adds some initial checks and we can expand on this to include more in follow-up changes.

One of the checks implemented here is also provided by a lint. While ideally we would share code between lints and these checks, the delta in the CFE vs analyzer model makes that infeasible today.

Sample output:
```
Found incompatibilities with WebAssembly.

package:dryrun/test.dart 5:15 - Cannot test a JS value against String (3)
package:dryrun/test.dart 6:7 - JS interop class 'B' cannot extend Dart class 'A'. (2)
```

Bug: https://github.com/dart-lang/sdk/issues/60050
Change-Id: Ib2c8e3501cc42d57b86ebaa749359ce6c5dba974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437960
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-07-02 09:44:43 -07:00
Ryan Macnak 554cb577e3 [infra] Add missing Android debug and RISC-V release builders.
Run co19 on fewer builders.

Change-Id: I7d6ea9f1f0cf2f9553a4a0dd34a608fa86916398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437180
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-25 16:22:25 -07:00
Alexander Markov 43830ab2ea Test interpreter directly on the VM, without dynamic_module_runner
Also, run pkg/vm_service/ tests against interpreter.

TEST=ci

Change-Id: Ib9c7fc1ed33c5721288e3ba1a3d4999c3e234350
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-06-24 06:00:45 -07:00