Commit Graph

418 Commits

Author SHA1 Message Date
Ryan Macnak feab749acb [build] Make the build more reproducible.
On Mac and Linux, the makes the output of non-RBE, RBE local and RBE remote builds identical, and also independent of the build directories path.  On Windows, non-RBE and RBE builds still disagree because paths are rewritten from \ to / to run on the Linux workers.

Bug: b/316893839
Change-Id: I5935785489c73445e4c6ca275020e6cf7464433d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506281
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 15:35:21 -07:00
Ryan Macnak a43ef7db89 [build] Set mnemonics.
Change-Id: Ib8729ebde2ae58c20afdc879336c3ad2a4a67b38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506282
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 10:21:37 -07:00
Ryan Macnak d907fbb72b [build] Fix more invocations to use relative paths.
Change-Id: I417ff793567a8adbbc4cc4fd4f77792c9a451f89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506280
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-26 10:19:40 -07:00
Ryan Macnak 0bf1b50875 [build] Clean up aot_compile_using_prebuilt_sdk.
Change-Id: I8fae6e701b97a01ab4fa3f68d8fc3c39c6d00761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506141
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-26 08:03:40 -07:00
Ryan Macnak 2f2a523818 Fix gcc 16 build.
TEST=local build
Bug: https://github.com/dart-lang/sdk/issues/63406
Change-Id: I20c2806e569211ef7d32e95961179dbf2aba15a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505181
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-20 19:36:12 -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 d36adbacaf [vm] Remove the VM isolate.
The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).

The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.

The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.

Class serialization no longer distinguishes predefined classes.

The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)

Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.

The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.

The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.

Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.

TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-18 11:35:03 -07:00
Martin Kustermann 0b7c68fad4 [dart2wasm] Roll binaryen to newer version
This brings in an optimization for [0] we filed

[0] https://github.com/WebAssembly/binaryen/issues/8618

Change-Id: I2640d3c7d1f44a0bcc00129123a5ea6f8327047a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-21 05:27:37 -07:00
Ryan Macnak e860a9b0fa [vm, ffi] Emit the FFI callback stub as a raw blob and place it in the Fuchsia package.
Any blob in the package can be loaded as an executable VMO.

TEST=child CL
Bug: https://dartbug.com/52579
Change-Id: I61f7a84453da4da4733c5a70d4d19f0a6652581b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496661
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-04-20 11:31:19 -07:00
Ben Konyi a8aba7fab8 [ Service ] Add support for isolate-based RPCs to dart_runtime_service_vm
This change adds initial support for working with isolates in the Dart
Runtime Service and its backends.

The new `IsolateManager` base class tracks the set of active isolates
and their lifecycle events. The `VmIsolateManager` extends this class,
adding support specific to interacting with isolates within the Dart VM.

TEST=vm/cc/DartAPI_InvokeVMServiceMethod*_Exp

Change-Id: I3dfa298722c40dbdfdd58105cc78f31d058dd7a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-03-12 09:08:14 -07:00
Ryan Macnak 67d4d6066a [build] Generate debug info for assembly.
This allows bloaty to attribute functions (but not variables) written in assembly to their source file. Which in turn allows the binary_size visualization to group, e.g., all the boringssl crypto kernels under boringssl instead of them all appearing at the top level.

Change-Id: I6f601f44931d6c3d2fe2018a43804b070643fba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-09 10:45:21 -07:00
Ryan Macnak b52575161d [vm] Adjust MSAN compile flags to match google3 to reproduce MSAN error in the regexp interpreter.
TEST=msan
Bug: b/489355669
Change-Id: I3ade526a67e5e7d95c8d8862eb92924337057d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485240
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-04 13:45:22 -08:00
Ryan Macnak 8a16c74eb6 Update zlib to 3008c4b3a06bd65392c31db8846000a21e3d03c5.
Change-Id: I57374044d7367c1d1f8950f7c3b49b99db335e2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484720
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-03 14:57:00 -08:00
Ryan Macnak 240b9bef03 [build] Enable ICF for Mac.
xcodebuild/ReleaseARM64/exe.stripped/dart -131k (-3.25%)

Change-Id: I9d3f4f39c77bb242e891e1996e217923bbc55d0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482984
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-02-24 11:08:51 -08:00
Slava Egorov 1418cb1b9c Roll Perfetto to 49c59636465f2a32f4d83cff835538ba7bf8d732
Drop libprotobuf dependency and update compile_perfetto_protos
to rely on externally provided protoc and protozero_plugin. 
This is done because protoc does not build with our current
toolchain and fixing this build requires rolling new protobuf,
protobuf_gn and perfetto. Which also pulls more external dependencies
like abseil.

Regenerate Perfetto *.pbzero{.cc,.h}, *.dart files

TEST=ci

Change-Id: I11a32aa07e810b48ac12502e526bbaee6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482781
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-02-24 03:24:32 -08:00
Ryan Macnak e443b89f23 [vm] Update Irregexp to V8 commit 254cc758346f10be2a7e22e55d90d4defe9cad74.
Includes support for modifier spans and duplicate named capture groups.

Drops the flow graph implementation to ease maintenance.

TEST=corelib/regexp
Bug: https://github.com/dart-lang/sdk/issues/56573
Bug: https://github.com/dart-lang/sdk/issues/61337
Bug: https://github.com/dart-lang/sdk/issues/62349
Bug: https://github.com/dart-lang/sdk/issues/62708
Change-Id: I05640ba945a4fa5476e7ad463738f4f39d842c14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480121
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-02-23 09:54:47 -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 Aprelev 61c3fbc220 [vm/build/ubsan/win] Fix ubsan build on Windows
- copy sanitizer runtime when using ubsan;
- avoid use of winnt.h CONTAINING_RECORD since it triggers ubsan "member access within null-pointer of type" error, use our copy which uses `offsetof`;
- have default virtual destructor in `ValueObject` to avoid ubsan complains about "insufficient space for an object of type 'dart:ValueObject'" at NoTemporaryAllocator use/declaration site;
- have virtual destructor in ZoneAllocated to avoid ubsan complains about "not having enough space to allocate object" at new RegExpEmpty() instantiation site;
- avoid using crashpad with ubsan as it causes dartvm to exit with error code 3;
- switch to windows, mac-friendly `[[gnu::no_sanitize(check)]]` from `__GNUC__` and `__has_feature` checks.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62267
Change-Id: I8b922a8da329af276d4cefaa88fb841cc0457124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469840
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-01-07 12:38:27 -08:00
Slava Egorov 9e18e03ba8 [vm/build] Update WINVER to match NTDDI_VERSION
We bumped NTDDI_VERSION to Windows 10 but have not updated WINVER in 
the same way making them diverge for no good reason.

FWIW NTDDI_VERSION should probably be set by winver config, but I am 
not going to fix that now.

Change-Id: I53cdf1cde40aa50911aa1311ca15705d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471181
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-01-07 03:12:28 -08:00
Ryan Macnak b18ec187d0 [build] Bump mac_sdk_min to 14.0.
TEST=ci
Change-Id: I92eb459a037ce8e4d1f98d1e28d7fd483f08f242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468883
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2026-01-05 13:06:49 -08:00
Ryan Macnak 7bb5e4c192 [build] Fix Windows ASAN build to actually use ASAN.
Bug: https://github.com/dart-lang/sdk/issues/62263
Change-Id: I77a44aeff0a0685730ff3e5c897e338ddc5561a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464781
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-12-17 14:08:00 -08:00
Ryan Macnak 6b500b2517 [build] Put sanitizer versions of the AOT runtime into the SDK for testing.
Note there is no need for versions of gen_snapshot because the sanitizer target is a runtime flag.

Change-Id: I25485e27331a0b8724e954a5222a11a1db45cfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464623
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-01 15:06:53 -08:00
Ryan Macnak b0de09e20f [build] Make rpath a bit more robust for Mac sanitizers.
Bug: https://github.com/dart-lang/sdk/issues/61713
Bug: https://github.com/dart-lang/sdk/issues/61831
Change-Id: I76ca4ae244dda7d97d98adfb802814a649edc309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457882
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-10-28 09:11:05 -07:00
Ryan Macnak 18db50f66a [build] Get source positions in sanitizer backtraces for Mac.
Change-Id: Ied8dc6900fd5e3a37f2a301b8a9e2e2360270fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456407
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-10-21 14:51:54 -07:00
Slava Egorov 07c9599ead [vm] Tweak location of Perfetto protos
This CL tries to address version skew issues which occur in internal
monorepo which we created by checking in *.pbzero.h files into
runtime/vm/protos/*. These files refer to protozero internal headers,
which in the internal monorepo come from a shared Perfetto dependency
which does not necessarily match the version we pinned in our DEPS and
used to generated these files.

This version skew caused problems for the Perfetto team, see
https://github.com/google/perfetto/pull/3195

To resolve this change layout of our repo to allow us to depend on the
shared Perfetto entirely - including its version of *.pbzero.h headers.

We change include paths in the VM source to

    #include "third_party/perfetto/protos/..."

which match location of these headers in the internal monorepo.

To make the code compile in the normal SDK checkout we shift location of
Perfetto and checked in code:

* Perfetto source moves from third_party/perfetto to
  third_party/perfetto/src.
* Generated code moves from runtime/vm/protos into
  third_party/perfetto/protos.

Note: experiments show that *.pbzero.h files tree-shake very well and
you pay only for things that you use. That means depending on *.pbzero.h
files generated from full message definitions rather than our manually
tree-shaken versions does not actually increase the size of the VM
binaries. We could switch our external build to do the same but this
would make protoc a build time dependency, which seems excessive.

TEST=ci

Change-Id: I724b9d9304be83302a5d83c2337154b36a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454260
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-10-13 02:09:31 -07:00
Ryan Macnak 6938441679 [build] Increase android_api_level from 21 to 24.
Bug: https://github.com/dart-lang/sdk/issues/61664
Change-Id: I10a99fbe03df32f056765913e75f14b63bc33bc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453681
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-10-07 13:17:21 -07:00
Ryan Macnak 4c092f8883 [build] Build libcxx from source for Mac UBSAN.
Bug: https://github.com/dart-lang/sdk/issues/61636
Change-Id: I2463cbddeb6044291840d9db2596498b5bc74cc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452906
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-10-01 14:27:40 -07:00
Ryan Macnak f1ba8ceacf [vm] Make some IgnoreRace functions inlinable.
Fix GCC TSAN build.
Cleanup sanitizer includes.

TEST=ci
Change-Id: Ib68bbfa701b4309c03514ed689391051094208e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452226
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-10-01 09:41:26 -07:00
Nate Biggs d4036a7bfe Fix analysis_server build action failing with remote RBE execution.
Bug: https://github.com/dart-lang/sdk/issues/61510
Change-Id: I4938cebe392e523271c0e13f80bd839acf68b694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452580
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-10-01 08:02:02 -07:00
Ryan Macnak bf6edc78c0 [build] Fix Windows ARM64.
There is no kernel service snapshot in the Windows ARM64 SDK.

Change-Id: I735524efb95b4951a9d668d096ba97e41c469426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449603
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-09-15 17:10:42 -07:00
Ryan Macnak dbab989a29 [build] And missing DFE input.
Change-Id: I126e115555430b6fe6928f2f32966e772b1fd9df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449584
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-09-15 13:45:42 -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
Ryan Macnak 1cdf67a55b [infra] Adjust rpath so TSAN works with shards not having resources at the same absolute path.
Change-Id: I3629f4b9de1270cef648dc938084ecf73ba1863e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447420
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-08-27 12:00:01 -07:00
Vyacheslav Egorov 8fbf6030ef [tsan] Improve suppression for tzset
When running under TSAN disable inlining of LocalTime
helper so we can write a suppression using its name.

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

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-x64-try,vm-tsan-linux-release-arm64-try
Change-Id: I9f07572b5b597343dbc61554c4f287eac630f047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446720
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-08-26 01:01:14 -07:00
Vyacheslav Egorov 4ccfbc66ce [build] Fix sanitizer build on Mac.
It seems on Linux linker parses -usymbol as -u symbol,
but the same does not get parsed on Mac - it interprets
the whole thing as a name of a flag and gets confused.

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

TEST=tried building with TSAN on mac
R=aam@google.com

Change-Id: I75e386813621f6e15562b5d8386f2c4441773970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446301
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-08-21 14:55:54 -07:00
Vyacheslav Egorov 9cf56fbc7e [vm] Add builtin TSAN suppressions
Sanitizers can pickup configuration and suppressions via
special symbols in the binary (e.g. __*_default_suppressions and
__*_default_options). We have a bunch of stale files in the
buildroot which showed how to do it, but none of these were
actually used by the build process.

Update our BUILDCONFIG.gn to actually link this code into
the binaries and clean it up leaving behind only one relevant
suppression for TSAN.

Additionally fix libplatform targets - libdart_platform_no_tsan was
accidentally disabling TSAN for the whole libplatform by adding
no_tsan_config into public_configs instead of extra_configs.

This is needed to unblock landing https://dart-review.googlesource.com/c/sdk/+/444983

TEST=manually with the referenced CL to verify that suppressions work

Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-x64-try,vm-tsan-linux-release-arm64-try
Change-Id: Id4e8a5b89c665cf5d89b18c4f5881ef31c3c9396
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445941
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-08-20 23:25:51 -07:00
asiva ab44b20ab8 Reapply "[VM/dartdev] Switch dartdev to use an AOT runtime." and
Add the fixes that were done after original CL landed.

This reverts commit 97bc401163.

TEST=ci

Change-Id: I26373aecc325e4c0c379c92e779aa301e3a58c5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441700
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-07-24 14:48:03 -07:00
asiva 97bc401163 Revert "[VM/dartdev] Switch dartdev to use an AOT runtime."
This reverts commit 5399dbf6f6.

Reason for revert : Flutter rolls are failing

TEST=ci

Change-Id: I76fede849705514496adbc2ab7f6c262de4103ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439661
Reviewed-by: Jason Simmons <jsimmons@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-07-09 23:08:28 -07:00
asiva 5399dbf6f6 [VM/dartdev] Switch dartdev to use an AOT runtime.
- split the Dart CLI tool out of the VM into it's own embedder which
  runs in AOT mode. The pure Dart VM executable is called 'dartvm' and
  has no Dart CLI functionality in it
- the Dart CLI executable parses the CLI commands and invokes the rest
  of the AOT tools in the same process, for the 'run' and 'test'
  commands it execs a process which runs 'dartvm' to run
- 'dart hello.dart' execs the 'dartvm' process and runs 'hello.dart'
- the Dart CLI is not generated for ia32 as we are not shipping a
  Dart SDK for ia32 anymore (support to execute the 'dartvm' for ia32
  architecture is retained)
- the Dart CLI tool is not built in the internal Dart SDK builds

TEST=ci

Some performance improvement numbers
'dart format pkg/dartdev' goes from 1.17 secs to 0.22 secs
'dart doc pkg/dartdev' goes from 100.2 secs to 66.6 secs
'dart fix pkg/dartdev' goes from 19.3 secs to 14.5 secs

Change-Id: I66984a26cb2ab014b34dc1873f1f3d2884e13518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364202
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-07-04 13:22:13 -07:00
Nicholas Shahan 51fee27069 [ddc] Update DDC snapshot training target
Specify package_config.json when running DDC JIT snapshot training.
This allows the build to succeed in environments where the running
compiler would go searching for the package_config.json and find
one in some parent directory. This should fix local web engine
builds in Flutter which likely broke when the repo was migrated to a
pub workspace.

Change-Id: Ifb5b6357cbf40f04069020ab1b4aee099d0945ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438602
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-07-02 16:29:44 -07:00
Vyacheslav Egorov 077e1be29c [gn] Fix precompile_tools=True (attempt 2)
Turns out that dart compile exe --depfile produces
depfile which does not work with ninja because
it uses absolute path to the output file
instead of using relative path.

So we can't use it directly and need to fix
depfile.

TEST=manually

Change-Id: I1aadfd5079cc38d392933f9afe333f63407bb295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435680
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-06-23 14:54:04 -07:00
Vyacheslav Egorov b0f933facc [gn] Fix precompile_tools=true
gn_dart_compile_exe.py wrapper stopped working because we rearranged
something in the prebuilt SDK. However we no longer need it because
we can ask `compile exe` itself to produce the depfile.

TEST=manually
R=kustermann@google.com

Change-Id: If5e64ede08b4e146a7bf033e7ef2d1809f40de1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435500
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-06-18 07:18:22 -07:00
Ryan Macnak ab4f9351b1 Rename vm_platform_strong.dill to vm_platform.dill.
The name has always been annoying because it did not add strong typing. And now there aren't variants of the VM platform to distinguish.

Leave a copy at the old name to not immediately break illegal uses.

TEST=ci
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,flutter-frontend-try,flutter-linux-try
Change-Id: Ie76fa7f16940aa1ba8d582eb5197f0ae55dc8938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429828
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-16 18:33:38 -07:00
Ryan Macnak 5f877fb7c8 Revert "[build] Update to Focal sysroot."
This reverts commit ad9a13a1c1.

Reason for revert: breaks Debian arm32 package

Original change's description:
> [build] Update to Focal sysroot.
>
> Our minimum supported version is Jammy, which Fuchsia doesn't have a CIPD package for, but at least we no longer need to use a different sysroot for different architectures.
>
> Change-Id: I90f37797c2f2f79886df85d6b7ed9903270e8c2a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433561
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I532c6052ba9bfe271f34bc18f6120eb80df98d6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433922
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-06-10 16:11:47 -07:00
Ryan Macnak ad9a13a1c1 [build] Update to Focal sysroot.
Our minimum supported version is Jammy, which Fuchsia doesn't have a CIPD package for, but at least we no longer need to use a different sysroot for different architectures.

Change-Id: I90f37797c2f2f79886df85d6b7ed9903270e8c2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433561
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-10 14:31:51 -07:00
なつき e8f47127fa [infra] Remove ia32 from alpine sysroot script
Closes https://github.com/dart-lang/sdk/pull/60764

GitOrigin-RevId: 7077a42d948bd0c55ce0e6c7de6fe992e29c4ed2
Change-Id: Ib9573f3d017750a77e1faa28cd38f35851738f37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429820
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-05-20 14:39:28 -07:00
Ryan Macnak 1d53d28e96 [infra] Setup for x64 reclient on Linux ARM64.
Change-Id: I2ff065c8b962d768f93ea3304544ceb527f9c266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429466
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-05-20 13:43:11 -07:00
Ryan Macnak f4fa8b7ca6 [infra] Use x64 reclient on Windows ARM64.
Switch build to use Clang. This somewhat degrades FFI testing, but reduces build time by roughly half or one hour.

Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,vm-aot-win-debug-arm64-try,vm-aot-win-release-arm64-try,vm-win-debug-arm64-try,vm-win-release-arm64-try
Change-Id: Ie267942e99934312b228cfadcd6d5b8477f855c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429421
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-05-19 17:31:29 -07:00
Ryan Macnak f8915309d9 [build] Build libcxx ourselves for Mac ASAN too.
Bug: https://github.com/dart-lang/sdk/issues/60720
Change-Id: I5158610702dd2d3da7146187dc895f8303eb92be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428400
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2025-05-13 23:43:02 -07:00
Ryan Macnak aa0a29c966 [infra] More setup for Mac and Windows ASAN.
Change-Id: I7cec0e5823410ee9dea2074c32f2ccb6f0aabceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427960
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-05-12 10:31:34 -07:00