[build] Too many deps!
- Break false dependency of non-VM platforms on VM platform - Break false dependency of bootstrap gen_kernel on VM platform - Extend precompile_tools to gen_kernel steps - Rename intermediate kernel files so JIT versus AOT is visible in ninjatracing TEST=ci Change-Id: I07011abe8303597af61d2b8c73e788b661482cc0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510060 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
fb2c85c973
commit
52f1a4ef54
+45
-4
@@ -7,6 +7,35 @@ import("../sdk_args.gni")
|
||||
|
||||
_dart_root = get_path_info("..", "abspath")
|
||||
|
||||
template("kernel_compile_using_prebuilt_sdk") {
|
||||
prebuilt_dart_action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"deps",
|
||||
"pool",
|
||||
"testonly",
|
||||
"visibility",
|
||||
])
|
||||
inputs = [
|
||||
invoker.entry_point,
|
||||
invoker.package_config,
|
||||
]
|
||||
|
||||
outputs = [ invoker.output ]
|
||||
|
||||
depfile = invoker.output + ".d"
|
||||
|
||||
vm_args = [
|
||||
"--snapshot-kind=kernel",
|
||||
"--snapshot=" + rebase_path(invoker.output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
"--packages=" + rebase_path(invoker.package_config, root_build_dir),
|
||||
]
|
||||
script = invoker.entry_point
|
||||
args = []
|
||||
}
|
||||
}
|
||||
|
||||
template("aot_compile_using_prebuilt_sdk") {
|
||||
prebuilt_dart_action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
@@ -39,15 +68,27 @@ template("aot_compile_using_prebuilt_sdk") {
|
||||
}
|
||||
}
|
||||
|
||||
aot_compile_using_prebuilt_sdk("compile_platform.exe") {
|
||||
kernel_compile_using_prebuilt_sdk("bootstrap_compile_platform.dill") {
|
||||
entry_point = "$_dart_root/pkg/front_end/tool/compile_platform.dart"
|
||||
output = "$root_out_dir/compile_platform.exe"
|
||||
output = "$target_out_dir/bootstrap_compile_platform.dill"
|
||||
package_config = "$_dart_root/.dart_tool/package_config.json"
|
||||
}
|
||||
|
||||
aot_compile_using_prebuilt_sdk("gen_kernel.exe") {
|
||||
aot_compile_using_prebuilt_sdk("bootstrap_compile_platform.exe") {
|
||||
entry_point = "$_dart_root/pkg/front_end/tool/compile_platform.dart"
|
||||
output = "$root_out_dir/bootstrap_compile_platform.exe"
|
||||
package_config = "$_dart_root/.dart_tool/package_config.json"
|
||||
}
|
||||
|
||||
kernel_compile_using_prebuilt_sdk("bootstrap_gen_kernel.dill") {
|
||||
entry_point = "$_dart_root/pkg/vm/bin/gen_kernel.dart"
|
||||
output = "$root_out_dir/gen_kernel.exe"
|
||||
output = "$target_out_dir/bootstrap_gen_kernel.dill"
|
||||
package_config = "$_dart_root/.dart_tool/package_config.json"
|
||||
}
|
||||
|
||||
aot_compile_using_prebuilt_sdk("bootstrap_gen_kernel.exe") {
|
||||
entry_point = "$_dart_root/pkg/vm/bin/gen_kernel.dart"
|
||||
output = "$root_out_dir/bootstrap_gen_kernel.exe"
|
||||
package_config = "$_dart_root/.dart_tool/package_config.json"
|
||||
}
|
||||
|
||||
|
||||
+111
-50
@@ -44,69 +44,130 @@ template("aot_snapshot") {
|
||||
output = invoker.output
|
||||
}
|
||||
|
||||
dill = "$target_out_dir/$name.dart.dill"
|
||||
dill = "$target_out_dir/$name.aot.dill"
|
||||
unsigned_snapshot = "$target_out_dir/$name.dart.snapshot.unsigned"
|
||||
signed_snapshot = output
|
||||
|
||||
# Build the kernel file using the prebuilt VM to speed up the debug and
|
||||
# simulator builds.
|
||||
kernel_label = target_name + "_dill"
|
||||
prebuilt_dart_action(kernel_label) {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
"$_dart_root/utils/gen_kernel:bootstrap_gen_kernel",
|
||||
]
|
||||
gen_kernel_kernel =
|
||||
get_label_info("$_dart_root/utils/gen_kernel:bootstrap_gen_kernel",
|
||||
"target_gen_dir") + "/bootstrap_gen_kernel.dill"
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
if (precompile_tools) {
|
||||
action(kernel_label) {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
} else {
|
||||
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
|
||||
}
|
||||
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_kernel,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
gen_kernel_tool =
|
||||
"$_dart_root/utils:bootstrap_gen_kernel.exe($host_toolchain)"
|
||||
gen_kernel_exe = get_label_info(gen_kernel_tool, "root_out_dir") +
|
||||
"/bootstrap_gen_kernel.exe"
|
||||
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
gen_kernel_tool,
|
||||
]
|
||||
output = dill
|
||||
outputs = [ output ]
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
|
||||
depfile = "$output.d"
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_exe,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
]
|
||||
output = dill
|
||||
outputs = [ output ]
|
||||
|
||||
vm_args = [
|
||||
# Ensure gen_kernel.dart will use this SDK hash when consuming/producing
|
||||
# kernel.
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
]
|
||||
depfile = "$output.d"
|
||||
|
||||
script = gen_kernel_kernel
|
||||
script = "$_dart_root/build/gn_run_binary.py"
|
||||
|
||||
args = [
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--aot",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
args = [
|
||||
rebase_path(gen_kernel_exe, root_build_dir),
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--aot",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$product_mode",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
if (defined(invoker.args)) {
|
||||
args += invoker.args
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$product_mode",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
if (defined(invoker.args)) {
|
||||
args += invoker.args
|
||||
}
|
||||
}
|
||||
} else {
|
||||
prebuilt_dart_action(kernel_label) {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
"$_dart_root/utils:bootstrap_gen_kernel.dill",
|
||||
]
|
||||
gen_kernel_kernel =
|
||||
get_label_info("$_dart_root/utils:bootstrap_gen_kernel.dill",
|
||||
"target_out_dir") + "/bootstrap_gen_kernel.dill"
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_kernel,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
]
|
||||
output = dill
|
||||
outputs = [ output ]
|
||||
|
||||
depfile = "$output.d"
|
||||
|
||||
vm_args = [
|
||||
# Ensure gen_kernel.dart will use this SDK hash when consuming/producing
|
||||
# kernel.
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
]
|
||||
|
||||
script = gen_kernel_kernel
|
||||
|
||||
args = [
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--aot",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$product_mode",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
if (defined(invoker.args)) {
|
||||
args += invoker.args
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+126
-68
@@ -117,89 +117,151 @@ template("application_snapshot") {
|
||||
gen_kernel_args += invoker.gen_kernel_args
|
||||
}
|
||||
|
||||
# Build the kernel file using the prebuilt VM to speed up the debug and
|
||||
# simulator builds.
|
||||
prebuilt_dart_action(target_name + "_dill") {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
"$_dart_root/utils/gen_kernel:bootstrap_gen_kernel",
|
||||
]
|
||||
gen_kernel_kernel =
|
||||
get_label_info("$_dart_root/utils/gen_kernel:bootstrap_gen_kernel",
|
||||
"target_gen_dir") + "/bootstrap_gen_kernel.dill"
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
if (precompile_tools) {
|
||||
action(target_name + "_dill") {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
} else {
|
||||
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
|
||||
}
|
||||
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_kernel,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
gen_kernel_tool = "$_dart_root/utils:bootstrap_gen_kernel.exe"
|
||||
gen_kernel_exe = get_label_info(gen_kernel_tool, "root_out_dir") +
|
||||
"/bootstrap_gen_kernel.exe"
|
||||
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
gen_kernel_tool,
|
||||
]
|
||||
output = "$target_out_dir/$name.dart.dill"
|
||||
outputs = [ output ]
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
|
||||
depfile = "$output.d"
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_exe,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
]
|
||||
output = "$target_out_dir/$name.jit.dill"
|
||||
outputs = [ output ]
|
||||
|
||||
vm_args = [
|
||||
# Ensure gen_kernel.dart will use this SDK hash when consuming/producing
|
||||
# kernel.
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
]
|
||||
depfile = "$output.d"
|
||||
|
||||
script = gen_kernel_kernel
|
||||
is_product_flag = dart_runtime_mode == "release"
|
||||
script = "$_dart_root/build/gn_run_binary.py"
|
||||
is_product_flag = dart_runtime_mode == "release"
|
||||
|
||||
args = [
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--no-aot",
|
||||
"--no-embed-sources",
|
||||
"--no-link-platform",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
args = [
|
||||
rebase_path(gen_kernel_exe, root_build_dir),
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--no-aot",
|
||||
"--no-embed-sources",
|
||||
"--no-link-platform",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$is_product_flag",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$is_product_flag",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
}
|
||||
} else {
|
||||
prebuilt_dart_action(target_name + "_dill") {
|
||||
mnemonic = "GEN_KERNEL"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
deps = extra_deps + [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
"$_dart_root/utils:bootstrap_gen_kernel.dill",
|
||||
]
|
||||
gen_kernel_kernel =
|
||||
get_label_info("$_dart_root/utils:bootstrap_gen_kernel.dill",
|
||||
"target_out_dir") + "/bootstrap_gen_kernel.dill"
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
|
||||
inputs = extra_inputs + [
|
||||
gen_kernel_kernel,
|
||||
platform_dill,
|
||||
main_dart,
|
||||
package_config,
|
||||
]
|
||||
output = "$target_out_dir/$name.jit.dill"
|
||||
outputs = [ output ]
|
||||
|
||||
depfile = "$output.d"
|
||||
|
||||
vm_args = [
|
||||
# Ensure gen_kernel.dart will use this SDK hash when consuming/producing
|
||||
# kernel.
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
]
|
||||
|
||||
script = gen_kernel_kernel
|
||||
is_product_flag = dart_runtime_mode == "release"
|
||||
|
||||
args = [
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--platform=" + rebase_path(platform_dill, root_build_dir),
|
||||
"--no-aot",
|
||||
"--no-embed-sources",
|
||||
"--no-link-platform",
|
||||
"--output=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
|
||||
# Ensure the compiled application (e.g. kernel-service, frontend-server,
|
||||
# ...) will use this SDK hash when consuming/producing kernel.
|
||||
#
|
||||
# (Instead of ensuring every user of the "application_snapshot" /
|
||||
# "kernel_snapshot" passes this if needed, we always pass it)
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
"-Ddart.vm.product=$is_product_flag",
|
||||
"-Ddart.vm.asan=$is_asan",
|
||||
"-Ddart.vm.msan=$is_msan",
|
||||
"-Ddart.vm.tsan=$is_tsan",
|
||||
]
|
||||
args += gen_kernel_args
|
||||
args += [ rebase_path(main_dart, root_build_dir) ]
|
||||
}
|
||||
}
|
||||
|
||||
# Create a snapshot from kernel built above.
|
||||
if (dart_snapshot_kind == "kernel") {
|
||||
copy(target_name) {
|
||||
deps = extra_deps + [ ":${target_name}_dill" ]
|
||||
sources = [ "$target_out_dir/$name.dart.dill" ]
|
||||
sources = [ "$target_out_dir/$name.jit.dill" ]
|
||||
outputs = [ output ]
|
||||
|
||||
assert(snapshot_vm_args != "", "Ignoring unused argument")
|
||||
assert(training_args != "", "Ignoring unused argument")
|
||||
assert(training_inputs != "", "Ignoring unused argument")
|
||||
assert(training_deps != "", "Ignoring unused argument")
|
||||
not_needed([
|
||||
"snapshot_vm_args",
|
||||
"training_args",
|
||||
"training_inputs",
|
||||
"training_deps",
|
||||
])
|
||||
}
|
||||
} else {
|
||||
} else if (dart_snapshot_kind == "app-jit") {
|
||||
dart_action(target_name) {
|
||||
mnemonic = "APP_JIT"
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
deps = extra_deps + [ ":${target_name}_dill" ] + training_deps
|
||||
depfile = "$output.d"
|
||||
|
||||
script = "$target_out_dir/$name.dart.dill"
|
||||
# No depfile needed when running from a kernel file. The set of inputs is
|
||||
# known at GN time.
|
||||
|
||||
script = "$target_out_dir/$name.jit.dill"
|
||||
|
||||
inputs = extra_inputs + training_inputs
|
||||
|
||||
@@ -212,16 +274,12 @@ template("application_snapshot") {
|
||||
vm_args = [
|
||||
"--deterministic",
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
"--snapshot-kind=app-jit",
|
||||
"--snapshot=" + rebase_path(output, root_build_dir),
|
||||
"--snapshot-depfile=" + rebase_path(depfile, root_build_dir),
|
||||
] + snapshot_vm_args
|
||||
|
||||
if (dart_snapshot_kind == "app-jit") {
|
||||
vm_args += [ "--snapshot-kind=app-jit" ]
|
||||
args = training_args
|
||||
} else {
|
||||
assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind")
|
||||
}
|
||||
args = training_args
|
||||
}
|
||||
} else {
|
||||
assert(false, "Unknown snapshot_kind: $dart_snapshot_kind")
|
||||
}
|
||||
}
|
||||
|
||||
+60
-79
@@ -23,32 +23,71 @@ template("compile_platform") {
|
||||
assert(!defined(invoker.script), "Remove 'script' from $target_name")
|
||||
assert(!defined(invoker.depfile), "Remove 'depfile' from $target_name")
|
||||
|
||||
# In order to automatically compute dependencies, we need to add a dependency
|
||||
# on vm_outline.dill. This is used to include the source code of Fasta itself
|
||||
# in the dependency file. Without this, a change to Fasta wouldn't cause the
|
||||
# platform dill files to be rebuilt. However, when building
|
||||
# vm_outline.dill, we shouldn't list it as a dependency as this would
|
||||
# lead to cyclic dependencies.
|
||||
add_implicit_vm_platform_dependency = true
|
||||
if (defined(invoker.add_implicit_vm_platform_dependency)) {
|
||||
add_implicit_vm_platform_dependency =
|
||||
invoker.add_implicit_vm_platform_dependency
|
||||
}
|
||||
|
||||
outline = "vm_outline.dill"
|
||||
if (defined(invoker.outline)) {
|
||||
outline = invoker.outline
|
||||
}
|
||||
|
||||
if (precompile_tools) {
|
||||
action(target_name) {
|
||||
mnemonic = "COMPILE_PLATFORM"
|
||||
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
} else {
|
||||
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
|
||||
}
|
||||
|
||||
outputs = invoker.outputs
|
||||
depfile = outputs[0] + ".d"
|
||||
|
||||
compile_platform_tool =
|
||||
"$_dart_root/utils:bootstrap_compile_platform.exe($host_toolchain)"
|
||||
compile_platform_exe =
|
||||
get_label_info(compile_platform_tool, "root_out_dir") +
|
||||
"/bootstrap_compile_platform.exe"
|
||||
|
||||
deps = [ compile_platform_tool ]
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
|
||||
inputs = [ compile_platform_exe ]
|
||||
if (defined(invoker.inputs)) {
|
||||
inputs += invoker.inputs
|
||||
}
|
||||
|
||||
script = "$_dart_root/build/gn_run_binary.py"
|
||||
args = [ rebase_path(compile_platform_exe, root_build_dir) ]
|
||||
args += invoker.args
|
||||
if (defined(invoker.single_root_scheme)) {
|
||||
args += [ "--single-root-scheme=" + invoker.single_root_scheme ]
|
||||
}
|
||||
if (defined(invoker.single_root_base)) {
|
||||
args += [ "--single-root-base=" + invoker.single_root_base ]
|
||||
}
|
||||
if (defined(invoker.single_root_scheme)) {
|
||||
args += [ invoker.libraries_specification_uri ]
|
||||
} else {
|
||||
args +=
|
||||
[ rebase_path(invoker.libraries_specification_uri, root_build_dir) ]
|
||||
}
|
||||
args += [ "unused-vm-platform.dill" ]
|
||||
args += rebase_path(outputs, root_build_dir)
|
||||
}
|
||||
} else {
|
||||
prebuilt_dart_action(target_name) {
|
||||
mnemonic = "COMPILE_PLATFORM"
|
||||
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
|
||||
outputs = invoker.outputs
|
||||
compile_platform_tool =
|
||||
"$_dart_root/utils:bootstrap_compile_platform.dill($host_toolchain)"
|
||||
|
||||
compile_platform_tool = "//utils:compile_platform.exe($host_toolchain)"
|
||||
script = get_label_info(compile_platform_tool, "target_out_dir") +
|
||||
"/bootstrap_compile_platform.dill"
|
||||
|
||||
outputs = invoker.outputs
|
||||
depfile = outputs[0] + ".d"
|
||||
|
||||
vm_args = [ "-Dsdk_hash=$sdk_hash" ]
|
||||
|
||||
deps = [ compile_platform_tool ]
|
||||
if (defined(invoker.deps)) {
|
||||
@@ -60,19 +99,7 @@ template("compile_platform") {
|
||||
inputs += invoker.inputs
|
||||
}
|
||||
|
||||
if (add_implicit_vm_platform_dependency) {
|
||||
inputs += [ "$root_out_dir/$outline" ]
|
||||
deps += [ "$_dart_root/runtime/vm:vm_platform" ]
|
||||
}
|
||||
|
||||
depfile = outputs[0] + ".d"
|
||||
|
||||
script = "$_dart_root/build/gn_run_binary.py"
|
||||
args =
|
||||
[ rebase_path(get_label_info(compile_platform_tool, "root_out_dir") +
|
||||
"/compile_platform.exe",
|
||||
root_build_dir) ]
|
||||
args += invoker.args
|
||||
args = invoker.args
|
||||
if (defined(invoker.single_root_scheme)) {
|
||||
args += [ "--single-root-scheme=" + invoker.single_root_scheme ]
|
||||
}
|
||||
@@ -85,53 +112,7 @@ template("compile_platform") {
|
||||
args +=
|
||||
[ rebase_path(invoker.libraries_specification_uri, root_build_dir) ]
|
||||
}
|
||||
args += [ rebase_path("$root_out_dir/$outline", root_build_dir) ]
|
||||
args += rebase_path(outputs, root_build_dir)
|
||||
}
|
||||
} else {
|
||||
prebuilt_dart_action(target_name) {
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
script = "$_dart_root/pkg/front_end/tool/compile_platform.dart"
|
||||
|
||||
packages = "$_dart_root/.dart_tool/package_config.json"
|
||||
|
||||
outputs = invoker.outputs
|
||||
|
||||
vm_args = [ "-Dsdk_hash=$sdk_hash" ]
|
||||
|
||||
inputs = []
|
||||
deps = []
|
||||
args = []
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
|
||||
if (defined(invoker.inputs)) {
|
||||
inputs += invoker.inputs
|
||||
}
|
||||
|
||||
if (add_implicit_vm_platform_dependency) {
|
||||
inputs += [ "$root_out_dir/$outline" ]
|
||||
deps += [ "$_dart_root/runtime/vm:vm_platform" ]
|
||||
}
|
||||
depfile = outputs[0] + ".d"
|
||||
|
||||
args += invoker.args
|
||||
if (defined(invoker.single_root_scheme)) {
|
||||
args += [ "--single-root-scheme=" + invoker.single_root_scheme ]
|
||||
}
|
||||
if (defined(invoker.single_root_base)) {
|
||||
args += [ "--single-root-base=" + invoker.single_root_base ]
|
||||
}
|
||||
if (defined(invoker.single_root_scheme)) {
|
||||
args += [ invoker.libraries_specification_uri ]
|
||||
} else {
|
||||
args +=
|
||||
[ rebase_path(invoker.libraries_specification_uri, root_build_dir) ]
|
||||
}
|
||||
args += [ rebase_path("$root_out_dir/$outline", root_build_dir) ]
|
||||
args += [ "unused-vm-platform.dill" ]
|
||||
args += rebase_path(outputs, root_build_dir)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ sdk_root = "../../sdk"
|
||||
|
||||
application_snapshot("dart2js") {
|
||||
deps = [ ":dart2js_create_snapshot_entry" ]
|
||||
training_deps = [ ":compile_dart2js_platform" ]
|
||||
training_deps = [ ":dart2js_platform" ]
|
||||
training_inputs = [
|
||||
"$root_out_dir/dart2js_platform.dill",
|
||||
"$root_out_dir/dart2js_outline.dill",
|
||||
@@ -106,7 +106,7 @@ aot_snapshot("dart2js_sdk_aot_product") {
|
||||
force_product_mode = !dart_debug
|
||||
}
|
||||
|
||||
compile_platform("compile_dart2js_platform") {
|
||||
compile_platform("dart2js_platform") {
|
||||
single_root_scheme = "org-dartlang-sdk"
|
||||
single_root_base = rebase_path("$sdk_root/", root_build_dir)
|
||||
libraries_specification_uri = "org-dartlang-sdk:///lib/libraries.json"
|
||||
@@ -122,7 +122,7 @@ compile_platform("compile_dart2js_platform") {
|
||||
"dart:core",
|
||||
]
|
||||
}
|
||||
compile_platform("compile_dart2js_server_platform") {
|
||||
compile_platform("dart2js_server_platform") {
|
||||
single_root_scheme = "org-dartlang-sdk"
|
||||
single_root_base = rebase_path("$sdk_root/", root_build_dir)
|
||||
libraries_specification_uri = "org-dartlang-sdk:///lib/libraries.json"
|
||||
|
||||
@@ -41,7 +41,7 @@ aot_snapshot("dart2wasm_product_snapshot") {
|
||||
force_product_mode = true
|
||||
}
|
||||
|
||||
compile_platform("compile_dart2wasm_platform") {
|
||||
compile_platform("dart2wasm_platform") {
|
||||
single_root_scheme = "org-dartlang-sdk"
|
||||
single_root_base = rebase_path("$sdk_root/", root_build_dir)
|
||||
libraries_specification_uri = "org-dartlang-sdk:///lib/libraries.json"
|
||||
@@ -57,7 +57,7 @@ compile_platform("compile_dart2wasm_platform") {
|
||||
]
|
||||
}
|
||||
|
||||
compile_platform("compile_dart2wasm_js_compatibility_platform") {
|
||||
compile_platform("dart2wasm_js_compatibility_platform") {
|
||||
single_root_scheme = "org-dartlang-sdk"
|
||||
single_root_base = rebase_path("$sdk_root/", root_build_dir)
|
||||
libraries_specification_uri = "org-dartlang-sdk:///lib/libraries.json"
|
||||
@@ -74,7 +74,7 @@ compile_platform("compile_dart2wasm_js_compatibility_platform") {
|
||||
]
|
||||
}
|
||||
|
||||
compile_platform("compile_dart2wasm_standalone_platform") {
|
||||
compile_platform("dart2wasm_standalone_platform") {
|
||||
single_root_scheme = "org-dartlang-sdk"
|
||||
single_root_base = rebase_path("$sdk_root/", root_build_dir)
|
||||
libraries_specification_uri = "org-dartlang-sdk:///lib/libraries.json"
|
||||
|
||||
@@ -82,7 +82,7 @@ template("compile_dart2wasm") {
|
||||
}
|
||||
|
||||
deps = [
|
||||
"../dart2wasm:compile_dart2wasm_platform",
|
||||
"../dart2wasm:dart2wasm_platform",
|
||||
"../dart2wasm:dart2wasm_snapshot",
|
||||
]
|
||||
if (product_mode) {
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ template("dart2js_compile") {
|
||||
|
||||
prebuilt_dart_action(target_name) {
|
||||
mnemonic = "DART2JS"
|
||||
deps = invoker.deps + [ "../compiler:compile_dart2js_platform" ]
|
||||
deps = invoker.deps + [ "../compiler:dart2js_platform" ]
|
||||
|
||||
inputs = [
|
||||
"$root_out_dir/dart2js_platform.dill",
|
||||
|
||||
@@ -2,44 +2,7 @@
|
||||
# for details. All rights reserved. Use of this source code is governed by a
|
||||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("../../build/dart/dart_action.gni")
|
||||
import("../../runtime/runtime_args.gni")
|
||||
import("../../sdk_args.gni")
|
||||
|
||||
_dart_root = get_path_info("../..", "abspath")
|
||||
|
||||
prebuilt_dart_action("bootstrap_gen_kernel") {
|
||||
deps = [
|
||||
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
|
||||
"$_dart_root/runtime/vm:vm_platform",
|
||||
]
|
||||
gen_kernel_script = "$_dart_root/pkg/vm/bin/gen_kernel.dart"
|
||||
platform_dill = "$root_out_dir/vm_platform.dill"
|
||||
package_config = rebase_path("$_dart_root/.dart_tool/package_config.json")
|
||||
|
||||
inputs = [
|
||||
gen_kernel_script,
|
||||
platform_dill,
|
||||
package_config,
|
||||
]
|
||||
output = "$target_gen_dir/bootstrap_gen_kernel.dill"
|
||||
outputs = [ output ]
|
||||
|
||||
depfile = "$output.d"
|
||||
vm_args = [
|
||||
"--snapshot-kind=kernel",
|
||||
"--snapshot=" + rebase_path(output, root_build_dir),
|
||||
"--depfile=" + rebase_path(depfile, root_build_dir),
|
||||
|
||||
# Ensure gen_kernel.dart will use this SDK hash when consuming/producing kernel.
|
||||
"-Dsdk_hash=$sdk_hash",
|
||||
|
||||
"--packages=" + rebase_path(package_config, root_build_dir),
|
||||
]
|
||||
script = gen_kernel_script
|
||||
args = []
|
||||
}
|
||||
|
||||
import("../aot_snapshot.gni")
|
||||
|
||||
aot_snapshot("gen_kernel") {
|
||||
|
||||
@@ -92,9 +92,12 @@ template("kernel_service_dill") {
|
||||
action("kernel_service" + target_name + "_dill") {
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
} else {
|
||||
pool = "$_dart_root/build/dart:dart_action_pool($default_toolchain)"
|
||||
}
|
||||
|
||||
gen_kernel_tool = "//utils:gen_kernel.exe($host_toolchain)"
|
||||
gen_kernel_tool =
|
||||
"$_dart_root/utils:bootstrap_gen_kernel.exe($host_toolchain)"
|
||||
kernel_service_script = "../../$_kernel_service_script"
|
||||
|
||||
deps = [
|
||||
@@ -113,7 +116,7 @@ template("kernel_service_dill") {
|
||||
|
||||
script = "$_dart_root/build/gn_run_binary.py"
|
||||
args = [ rebase_path(get_label_info(gen_kernel_tool, "root_out_dir") +
|
||||
"/gen_kernel.exe",
|
||||
"/bootstrap_gen_kernel.exe",
|
||||
root_build_dir) ]
|
||||
args += invoker.extra_args
|
||||
args += [
|
||||
|
||||
Reference in New Issue
Block a user