Commit Graph

373 Commits

Author SHA1 Message Date
なつき 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
Ivan Inozemtsev 29e33b00d0 Reland "watchOS target os"
This is a reland of commit 7ae1d75869

TEST=manual, no watchOS SDK on bots yet.

Original change's description:
> watchOS target os
>
> - add support for --os=watchos | --os=watchos_simulator
> - do not depend on perfetto if dart_support_perfetto is false
> - change the default value for dart_support_perfetto to !is_watchos
>
> To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now.
>
> TEST=manual, no watchOS SDK on bots yet.
>
> Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
> Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>

Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Change-Id: I2b50f7eb4da173627aeb4833b88a08712b278d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425523
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-05-05 06:40:30 -07:00
asiva edd241dc36 Invoke dart2js directly using dartaotruntime while building
observatory instead of using 'compile js'

TEST=ci

Change-Id: Id190a764d1d7e9ee4b29b02549cf94b750c6dbe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425420
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-04-29 17:03:43 -07:00
Ivan Inozemtsev 10c579c7e8 Revert "watchOS target os"
This reverts commit 7ae1d75869.

Reason for revert: breaks flutter build

Original change's description:
> watchOS target os
>
> - add support for --os=watchos | --os=watchos_simulator
> - do not depend on perfetto if dart_support_perfetto is false
> - change the default value for dart_support_perfetto to !is_watchos
>
> To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now.
>
> TEST=manual, no watchOS SDK on bots yet.
>
> Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
> Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>

Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I4bede9ede04ac3c533b8ff7ae2f1adbd84eb2397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425262
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-29 03:21:37 -07:00
Ivan Inozemtsev 7ae1d75869 watchOS target os
- add support for --os=watchos | --os=watchos_simulator
- do not depend on perfetto if dart_support_perfetto is false
- change the default value for dart_support_perfetto to !is_watchos

To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now.

TEST=manual, no watchOS SDK on bots yet.

Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-29 02:28:52 -07:00
Ryan Macnak b69b2c8b4f [build] Include a deterministic build id.
Change-Id: If37a5ec31e90175d38edd0f531a7f928596e7281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423900
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-04-23 09:45:39 -07:00
Ryan Macnak 326e32a167 [build] Limit the number of concurrent dart/gen_snapshot actions.
Ninja may be run with a large --jobs value to run more C/C++ compilation actions in parallel on remote workers. The dart and gen_snapshot actions during the build should in this case remain limited to the number of cores on the machine to avoid a coincident memory usage that is too high.

When running in the Dart tree with RBE, limit this by changing the RBE exec_strategy away from racing. Otherwise, use a pool to limit the concurrency of this action type.

TEST=build.py --no-rbe -j1000
Bug: https://github.com/flutter/flutter/issues/164591
Change-Id: Ia5e5615d0067b34d49871f26ead074cb891baf70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423562
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-04-22 11:34:41 -07:00
zijiehe-google-com 65cdd580c7 [fuchsia] Uprev test-scripts with FUCHSIA_READELF env
Copied from http://go/dart-reviews/421761 with the essential fix to
make it work.

1) Add the env to select the right readelf.
2) Remove the removal of arch/, it's referred by meta.json.

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Bug: b/407890258, b/338009514
Change-Id: Ib7ae646e57082d310d3d76ca16834faefb888201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421881
Auto-Submit: Zijie He <zijiehe@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-04-14 11:07:11 -07:00
Vyacheslav Egorov 5f32e78a09 [vm] Fix running under HWASAN
HWASAN tags stack regions (and stack pointers) with 0,
but also selectively tags some stack allocations with
non-zero tags. These tags need to be cleared when
allocation goes out of scope so that stack can be
later safely reused - otherwise stale tags confuse
HWASAN instrumentation later.

This CL teaches Exceptions::JumpToFrame to do that.

CL also adds basic build changes to support building
with HWASAN, though I don't wire it into CI for now
as it can only really run on Android ARM64

TEST=manually on Android phone and on internal tests

Bug: b/374433249
Change-Id: I678443dc1de693c999a226bee0d71a6f3582d4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421180
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
2025-04-14 10:14:54 -07:00
Ivan Inozemtsev 8773b6618f Reland "Update libcxx and libcxxabi"
This is a reland of commit 3491f72880

Original change's description:
> Update libcxx and libcxxabi
>
> Add libc, required by libcxx.
>
> Based on https://github.com/flutter/flutter/pull/165621.
>
> Change-Id: I5b929dc81b2572e3b919a8d20e031f98196375e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416220
> Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>

Change-Id: I9392f4cdc2ccb985085768c90bd293d353bf4c95
Cq-Include-Trybots: luci.dart.try:vm-aot-tsan-linux-release-x64-try,vm-tsan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-ubsan-linux-release-arm64-try,vm-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421300
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-09 09:04:51 -07:00
Ivan Inozemtsev 53f9327c75 Revert "Update libcxx and libcxxabi"
This reverts commit 3491f72880.

Reason for revert: breaks tsan on linux. I did test locally before submitting, but without RBE.

Original change's description:
> Update libcxx and libcxxabi
>
> Add libc, required by libcxx.
>
> Based on https://github.com/flutter/flutter/pull/165621.
>
> Change-Id: I5b929dc81b2572e3b919a8d20e031f98196375e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416220
> Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Idcae5b01dbec26045ea7704d1575f73947d0682e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420560
Commit-Queue: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-04-04 16:47:58 -07:00
Alexander Aprelev e5e9f29115 [build/win] Update vs_toolchain.py with latest chromium.
This syncs up with chromium https://chromium.googlesource.com/chromium/src/build/+/d0ce4a42b5c1c9b6b437fe1e19d94a6a4dbdeedc/vs_toolchain.py

TEST=ci

Change-Id: I42e69c4a82fbf5f8b7a43b13e26dc4de29ec85fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419928
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-04-04 08:58:22 -07:00
Ivan Inozemtsev 3491f72880 Update libcxx and libcxxabi
Add libc, required by libcxx.

Based on https://github.com/flutter/flutter/pull/165621.

Change-Id: I5b929dc81b2572e3b919a8d20e031f98196375e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416220
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-04 07:32:20 -07:00
Ivan Inozemtsev 3718ed6426 Pass --no-junction flag to depot_tools script for windows toolchain
This cancels the effect of https://source.chromium.org/chromium/chromium/tools/depot_tools/+/c6684fda9877962580c021aab7c8bc0e9f1c2647.

Change-Id: If8a46bbcc1d1d8b645609d3a9d6f174e3d420edd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419841
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-04-02 06:33:49 -07:00
Lasse R.H. Nielsen 8d46b7cd81 Remove references to .packages from build scripts.
It's just names and comments, they already used
`package_config.json` as the package configuration.

Change-Id: Icd421ed99079fa9058426e1536565658938252ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414100
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-03-11 03:37:14 -07:00
Martin Kustermann 3b750c5545 [dart2wasm] Generate *.support.js feature detection files
The file will contain a JS expression that evaluates to a boolean.
If it (at runtime) evalutes to

  * `true` it means that all required features are supported by the JS
    environment and the dart2wasm-compiled app can be used

  * `false` it means some features were not present in the JS
    environment and the dart2wasm-compiled app shouldn't be used,
    instead a dart2js fallback may be used

We introduce this mechanism to allow users, at compilation time, to tell
dart2wasm to take advantage of new spec features and allow the runtime
to self-detect whether they are available and fallback to dart2js if
not.

The first feature we introduce (already in this PR) is
`--require-js-string-builtin` that will tell dart2wasm it can assume the
`js-string` builtin is available (and emit corresponding `*.support.js`
code to detect it).

If the flag was passed, we take advantage of the `js-string` import
mechanism for string constants that doesn't require emitting them in the
mjs file (which significantly reduces code size and improves startup
time - compared with emitting JS strings in the mjs file).

We enable `--require-js-string-builtin` on one CI configuration for
testing that if we don't use any polyfill, the imports of the builtin
functions as well as magical utf8-encoded wasm imports work.

We also use a template mechanism to generate `*.mjs` as the code
becomes more readable (e.g. to conditionally include the js string
polyfill)

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

Change-Id: Ic7e7818a2d5269095935022941352beeb9fed731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408781
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-02-10 06:17:49 -08:00
Ivan Inozemtsev 6e33c95463 Dart Engine
Adds shared libraries for embedding Dart VM and new API (runtime/engine/include/dart_engine.h).

TEST=tests/standalone/embedder_samples_test.dart

Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv32-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-aot-win-product-x64-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-appjit-linux-product-x64-try,vm-appjit-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try,vm-gcc-linux-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-arm64-try,vm-linux-release-ia32-try,vm-linux-release-simarm-try,vm-linux-release-x64-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-msvc-windows-try,vm-reload-linux-debug-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-reload-rollback-linux-release-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try,vm-win-release-x64-try
Change-Id: Ia4e4d1b871ddef515cfb2f4639bdaa9fe3676936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402860
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-01-28 03:53:40 -08:00
Ryan Macnak ebfcd436da [build] Update RBE implicit inputs for new checked-in SDK.
Change-Id: I1c6b64b63dca75d49a0c6af78f49d778ffbcc419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-12-10 23:05:47 +00:00
Ryan Macnak 04dc8ccc5c [build] Expand when compiled_action / prebuilt_tool_action can run on RBE.
Change-Id: I37b0fb9ef35339b3b387879245c93f2f5d693d83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398952
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-12-09 19:34:03 +00:00
Ryan Macnak 31c2de75e7 [build] Setup RBE for the Fuchsia toolchain.
Change-Id: I4d4860cfb0ac28fb30d44681659505d5dd73f9ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398943
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-12-04 22:17:21 +00:00
Ryan Macnak 7381222387 [build] Don't create a second copy of executables compiled with -fPIC.
build.py -mrelease runtime
4169 -> 2711 build steps

Change-Id: I679b2d7b34fd598deffc66e3bf10c48b02e9d764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398944
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-12-04 21:41:51 +00:00
Ivan Inozemtsev 68800e6c0d Fix toolchain_cpu for clang_x64 android toolchain
Similar to https://dart-review.googlesource.com/c/sdk/+/396260, it
looks like the value for `android_app_abi` was used for `cpu`, but
before https://dart-review.googlesource.com/c/sdk/+/392661 `current_cpu`
wasn't actually set to `toolchain_cpu`.

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

Change-Id: Icf3a36c2b6d58c5979bb71ea67a864b658abc514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397901
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2024-11-27 14:28:21 +00:00
Ivan Inozemtsev a999cec694 Separate toolchains for shared libraries
1. Added `toolchain_suite` template and switched toolchain definitions
to it, so now each toolchain definition defines a regular and
`_shared` toolchain, with different values for `is_shared_library`
argument.
2. Changed the logic of choosing between `fPIC` and `fPIE` based on
`is_shared_library` arg.
3. Changed `shared_library` template to define a group, depending on
the same target in a shared toolchain, and a copy of an output
artifact.
4. Made a copy of `runtime:dart_shared_lib` config and add it
automatically to all shared libraries.
5. Removed `runtime:dart_shared_lib` config and `DART_SHARED_LIB`
define from existing `shared_library` targets.

This CL should be a no-op refactoring to enable
https://dart-review.googlesource.com/c/sdk/+/394102.

TEST=ci

Change-Id: I6c044254d8e74b6b3ddadbf784e58d5f641fbcf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392661
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-26 11:48:51 +00:00
Ivan Inozemtsev 242406b2b4 Fix toolchain_cpu for clang_arm64 android toolchain
That's the only mention of `aarch64` in a context of cpus:
https://github.com/search?q=repo%3Adart-lang%2Fsdk%20path%3A*.gn*%20aarch64&type=code.

Similar to https://dart-review.googlesource.com/c/sdk/+/395300, I
believe it works correctly now only by accident, because `current_cpu`
defaults to `target_cpu`, and `toolchain_cpu` is unused.

However when using mulitple toolchains, `current_cpu` is set to
`toolchain_cpu`, and config evaluation fails at
https://github.com/dart-lang/sdk/blob/246050a1ef6233d9574ce6a30d30506e004fef3d/build/config/android/config.gni#L107

Change-Id: Ic3b3ab4afecf00556f0420800f058ebe4c64fa70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396260
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-19 20:47:10 +00:00
Johnni Winther 808fa4ca8b [cfe] Move tool/_fasta/ to tool/
Change-Id: I5b7348fb4adb4e7f4039c91d54d712c1eb131ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395002
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-11-18 07:49:01 +00:00
Ivan Inozemtsev f8569331e1 Fix toolchain_os in ios toolchain definitions
I think it worked correctly before only by accident, because of the
fallback to `target_os` in build config: https://github.com/dart-lang/sdk/blob/0906af6d2f6cf8ae1eff52a93adccdaf90d13443/build/config/BUILDCONFIG.gn#L48).

However when buildconfig is re-evaluated with toolchain
args, current_os is set to a toolchain_os at https://github.com/dart-lang/sdk/blob/0906af6d2f6cf8ae1eff52a93adccdaf90d13443/build/toolchain/mac/BUILD.gn#L260, which causes linking issues in https://dart-review.googlesource.com/c/sdk/+/392661 (https://ci.chromium.org/ui/p/dart/builders/try/vm-mac-debug-arm64-try/12692/overview).

Change-Id: I9c6129ad40a7ec26fde47816810241850b6f816f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395300
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-11-14 21:08:12 +00:00
Ryan Macnak 0a238b3828 [vm] Update to C++20.
- There is no C20, so that stays at C17
 - Math between different enum types disallowed, use explicit cast
 - operator++ removed from volatile types
 - stream print for wchar_t removed

TEST=build
Bug: https://github.com/dart-lang/sdk/issues/42074
Change-Id: Ie552b0bf24f8ac8991336c61fd4bd4913da42909
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393622
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-11-12 20:28:50 +00:00
Alexander Aprelev 073a700517 [build/win] Roll crashpad and minichromium deps.
Roll not to the lastest, but to the one before move to breaking c++20 changes in those deps.

Pulls changes and fixes to crashpad from 10/22/2018 to 1/10/2024.

TEST=ci

Change-Id: I1ff37eaec91ea6b1fb3d73b38b360b2e8d88a47c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393903
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-11-07 20:30:22 +00:00
Matan Lurey acc66a77fe Forward GN metadata from dart_action and friends.
In the Flutter engine, we plan to expand and start using Dart actions to
rely more on the GN build system, and less on home-grown (Python/Bash)
tooling. To that end, we'll start generating dart_snapshot and dart_test
rules that are invokved the same way locally (via `et`) and on CI, with
a goal of making all of our tests programatically discoverable.

We need the `metadata` field (a standard GN field) in order to tag our
outputs (i.e. `metadata = { action_type = ['dart_executable'] }`);
see https://gn.googlesource.com/gn/+/main/docs/reference.md#var_metadata.

Bug: https://github.com/flutter/flutter/issues/147013
Change-Id: I0e44209b8aade13cec99b944583a90a7c13d3300
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386582
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-09-24 18:51:23 +00:00
Ryan Macnak 640724dc2a [build] Report the exit code for failed build-time executions.
Bug: https://github.com/dart-lang/sdk/issues/56529
Change-Id: Idc0e41091491b144c12056dca2eb441444c2af0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384400
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-09-09 18:38:23 +00:00
Hzj_jie 689f8d6826 [fuchsia] Remove duplicate gn_configs and uprev test-scripts
Change https://crrev.com/c/5823950 moved most of the gn_configs to
fuchsia-gn-sdk, and they are not needed to be repeated again in
the gn_configs.gni anymore

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Bug: http://crbug.com/359657446
Change-Id: I2be62484f2f5279a8804f81714bf0db22ef4384c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382761
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-09-09 17:40:35 +00:00
Alexander Markov 21561b023b [gardening] Fix TSAN build
TEST=tools/build.py --mode=release --arch=x64 --sanitizer=tsan runtime dart_precompiled_runtime

Change-Id: I7b7f432fe6ae4a2f6cd916c215476a0f93d14bed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383445
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-09-04 00:30:27 +00:00
Ivan Inozemtsev ad15bc4b47 Add support for iOS target os
- `build/mac/find_sdk.py` can search for iPhone and Watch SDKs and their simulators
- `tools/build.py` supports `--os=ios` and `-os=ios_simulator` now. Treating simulator as a separate os to minimize changes and avoid an additional dimension for configs.
- `vm-mac-(release|debug)-arm64-try` tryjobs make sure a shared library builds successfully for ios.

TEST=ci

Change-Id: I76358ec8fd33752260bf0b8462da22a13cd7562e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381623
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-09-03 19:53:58 +00:00
Hzj_jie aa3c910027 [fuchsia] use the api-level from gn-sdk and uprev test-scripts
https://crrev.com/c/5805927 provides the default api-level in gn-sdk,
so as long as we have the latest gn-sdk / skia setup, the api-level
would be updated automatically.

And since I am here, I updated the version of test-scripts as the
skia roller of it hasn't been enabled yet.

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Bug: b/347373793
Change-Id: I0b45df7981b130b19d3158a2e0f58a1ed224d2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381883
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-08-26 19:34:08 +00:00
Alexander Markov 3d8829fad2 Add dart2bytecode snapshot and VM/AOT dynamic modules test configurations
Change-Id: I84f8dbc174dbac5a11ca84e248c7aecb3759aaad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380283
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-15 15:28:25 +00:00
Hzj_jie 99da8ce289 [fuchsia] reduce the standalone commands in fuchsia integration
multiple processes are now aggregated by one test_env_setup call.

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Bug: http://crbug.com/356463343
Change-Id: Ib41bd2b36eb5d06ceeb6b834f1024365650e0ca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379560
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2024-08-13 18:04:17 +00:00
Ryan Macnak cbb4176bea Roll icu to 43953f57b037778a1b8005564afabe214834f7bd.
Embed the Flutter version of icutl.dat to keep \p{Emoji} etc working.

TEST=corelib/regexp/unicode-property-binary_test
Bug: https://github.com/dart-lang/sdk/issues/50248
Change-Id: I91124690160fead3e1ba841f4244595ba338387c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375180
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-07-17 16:47:50 +00:00
Ryan Macnak b82383953d [build] Link with lld on Windows when using Clang.
- Make the build deterministic

Bug: https://github.com/dart-lang/sdk/issues/55995
Change-Id: Ic800dd66f23bc402dfede09db3f67f01aa82d29d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373360
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-07-02 21:16:39 +00:00
Jens Johansen 9b67562b4d Add 'coverage' flag, defaulting to true, but let the gn application_snapshot default it to false
Automatic set coverage when loading snapshot

TEST=Existing tests, manual inspection of reduction in sdk snapshot sizes (see data in comments in https://dart-review.googlesource.com/c/sdk/+/370501)

Change-Id: I044616144c2defeed252a6715eba1abcabffc86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371700
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-18 09:10:00 +00:00
Johnni Winther c5cd8ff349 [cfe] Remove agnostic mode
The agnostic mode was added to allow the platform dill embedded in
the VM to support both weak and strong mode. Since weak mode is no
longer supported in the VM, the agnostic mode can new be deleted.

All uses of the agnostic in Dart and Flutter have been removed prior
to this change.

Change-Id: Iff0f69d9cd64e887e01cd7e7d336a97761bd6d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366801
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-06 11:02:37 +00:00
なつき 0fba690acc [infra] Install alpine riscv64 sysroot
Closes https://github.com/dart-lang/sdk/pull/55875

GitOrigin-RevId: 46d7031db865173547f3d3b502f9c43a8172d8a9
Change-Id: I15e77d172d8db737d712463a40b27f5b7ca776b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368823
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-05-30 17:33:04 +00:00
Vyacheslav Egorov a4dd314c9e [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

This relands 5cda2a871c with fixes
for Flutter build.

TEST=manually tested

Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-24 09:40:39 +00:00
Slava Egorov a17d709a1d Revert "[tools] Allow precompiling gen_kernel and compile_platform"
This reverts commit 5cda2a871c.

Reason for revert: broke Flutter build. 

Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-23 13:52:58 +00:00
Vyacheslav Egorov 5cda2a871c [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

TEST=manually tested

Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 12:35:21 +00:00
Ryan Macnak 53f1ed4095 [build] Fix ARM32 GCC build.
TEST=vm-gcc-linux
Bug: https://github.com/dart-lang/sdk/issues/52080
Bug: https://github.com/dart-lang/sdk/issues/55669
Change-Id: I94ecf1b7c74c23d0609844a1163d14454e80eebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367502
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-22 18:06:01 +00:00
Jonas Termansen e0b08fadd8 Reland "[infra] RBE all the things."
This is a reland of commit b3253d9c8b

Fix the gn rules so the RBE offloading only happens in the Dart build
and the conflicting RBE configuration is not included otherwise. This
ensures this change can roll into Flutter while we design a better
solution to compose the projects' RBE usages.

Original change's description:
> [infra] RBE all the things.
>
> This change offloads all Dart actions during the build to RBE using
> the new rewrapper_dart.py script that understands all the different
> command line invocations of Dart programs and translates it into the
> appropriate rewrapper invocation, with a full list of input and output
> files and no absolute paths.
>
> The dart actions are all considered to be expensive RBE compilation
> steps that may be much slower on RBE than locally due to the low
> parallelism of the build during these stages and the comperatively
> slower bots in the RBE pools. The build uses the racing strategy by
> default for these compilations, such that cache hits are still used
> if available, and otherwise a local build is transparently used if it
> happens to be faster. The bots will use the remote strategy by default
> unlike developers, such that the rewrapper_dart.py script does not fail.
>
> rewrapper_dart.py contains a tiny dart import proprocessor written
> in python and a big argument parser that understands every command
> invoked during the build and the semantic meaning of every option.
>
> The absolute paths used during the Dart SDK build is not solved in
> this changelist, which just works around them initially, but these
> will be fixed in follow up changes with the appropriate teams now
> that this change proves they are not needed.
>
> Bug: b/333595242
> Change-Id: I36603ec1bf16f4ac87d56635cc1c98e8686a4028
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335827
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: Jonas Termansen <sortie@google.com>

Bug: b/333595242
Change-Id: I43bec2e7fcad375e972ca447aa13ae65b0ce09ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362661
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-12 22:06:32 +00:00