1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 00:08:46 +00:00

[dart2wasm] Build snapshot as part of the SDK.

Change-Id: Iea75c14b6709f2347fe82af2ef226a1ed068d8a6
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261502
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Joshua Litt 2022-10-05 11:55:22 +00:00 committed by Commit Queue
parent e2bf48243f
commit fd39eab463
2 changed files with 50 additions and 1 deletions

View File

@ -103,12 +103,18 @@ group("dart2js") {
deps = [ "utils/compiler:dart2js" ]
}
group("dart2wasm") {
group("dart2wasm_platform") {
deps = [
":runtime_precompiled",
"utils/dart2wasm:compile_dart2wasm_platform",
"utils/dart2wasm:dart2wasm_asserts_snapshot",
"utils/dart2wasm:dart2wasm_snapshot",
]
}
group("dart2wasm") {
deps = [
":dart2wasm_platform",
"utils/dart2wasm:test_wasm_modules",
]
}

View File

@ -38,10 +38,12 @@ declare_args() {
# ......dartaotruntime or dartaotruntime.exe (executable)
# ......dart2js
# ......dartdevc
# ......run_wasm.js (if not on ia32)
# ......utils/gen_snapshot or utils/gen_snapshot.exe (if not on ia32)
# ......snapshots/
# ........analysis_server.dart.snapshot
# ........dart2js.dart.snapshot
# ........dart2wasm.dart.snapshot (if not on ia32)
# ........dartdev.dart.snapshot
# ........dartdev.dill
# ........dartdevc.dart.snapshot
@ -67,6 +69,8 @@ declare_args() {
# ........dart2js_platform_unsound.dill
# ........dart2js_server_platform.dill
# ........dart2js_server_platform_unsound.dill
# ........dart2wasm_platform.dill (if not on ia32)
# ........dart2wasm_outline.dill (if not on ia32)
# ........vm_platform_strong.dill
# ........dev_compiler/
# ......async/
@ -481,6 +485,37 @@ copy("copy_dart2js_dill_files") {
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_dart2wasm_platform") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../:dart2wasm_platform",
"../utils/dart2wasm:compile_dart2wasm_platform",
]
sources = [
"$root_out_dir/dart2wasm_outline.dill",
"$root_out_dir/dart2wasm_platform.dill",
]
outputs =
[ "$root_out_dir/$dart_sdk_output/lib/_internal/{{source_file_part}}" ]
}
copy("copy_dart2wasm_runtime") {
visibility = [ ":create_full_sdk" ]
sources = [ "../pkg/dart2wasm/bin/run_wasm.js" ]
outputs = [ "$root_out_dir/$dart_sdk_output/bin/{{source_file_part}}" ]
}
copy("copy_dart2wasm_snapshot") {
visibility = [ ":create_full_sdk" ]
deps = [
":copy_libraries",
"../utils/dart2wasm:dart2wasm_snapshot",
]
sources = [ "$root_out_dir/dart2wasm.snapshot" ]
outputs = [ "$root_out_dir/$dart_sdk_output/snapshots/{{source_file_part}}" ]
}
# Copies DDC's SDK weak outline .dill to lib/_internal
# TODO(nshahan) Fix the outline to be consistent and merge with below as a
# breaking change.
@ -775,6 +810,14 @@ group("create_full_sdk") {
":copy_full_sdk_scripts",
":copy_full_sdk_snapshots",
]
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
public_deps += [
":copy_dart2wasm_platform",
":copy_dart2wasm_runtime",
":copy_dart2wasm_snapshot",
]
}
}
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.