From a0776096b9bec13e451f782bdff218285eab9f47 Mon Sep 17 00:00:00 2001 From: asiva Date: Wed, 19 Sep 2018 22:23:33 +0000 Subject: [PATCH] Cleanup some of the build rules to not use Dart 1 mode. Change-Id: I799ae7e910b90047a76151e47fc4c46d20f46ff7 Reviewed-on: https://dart-review.googlesource.com/74493 Commit-Queue: Siva Annamalai Reviewed-by: Zach Anderson Reviewed-by: Samir Jindel --- BUILD.gn | 6 --- pkg/vm/bin/gen_kernel.dart | 6 --- pkg/vm/tool/precompiler2 | 4 -- runtime/bin/BUILD.gn | 11 +----- tools/bots/try_benchmarks.sh | 2 - utils/application_snapshot.gni | 39 +------------------- utils/generate_entry_points_json.gni | 55 ---------------------------- utils/kernel-service/BUILD.gn | 16 ++++---- 8 files changed, 10 insertions(+), 129 deletions(-) delete mode 100644 utils/generate_entry_points_json.gni diff --git a/BUILD.gn b/BUILD.gn index 6f97c3c8787..6a4a55e3a13 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -36,9 +36,6 @@ group("most") { group("runtime") { import("runtime/runtime_args.gni") - target_supports_aot = dart_target_arch == "arm" || - dart_target_arch == "arm64" || dart_target_arch == "x64" - if (targetting_fuchsia) { # Fuchsia has run_vm_tests marked testonly. testonly = true @@ -53,9 +50,6 @@ group("runtime") { "runtime/vm:kernel_platform_files($host_toolchain)", "utils/kernel-service:kernel-service", ] - if (target_supports_aot) { - deps += [ "runtime/bin:precompiler_entry_points_json" ] - } } group("runtime_kernel") { diff --git a/pkg/vm/bin/gen_kernel.dart b/pkg/vm/bin/gen_kernel.dart index 9e1581e01a1..e15b46ae125 100644 --- a/pkg/vm/bin/gen_kernel.dart +++ b/pkg/vm/bin/gen_kernel.dart @@ -96,12 +96,6 @@ Future compile(List arguments) async { } final List entryPoints = options['entry-points'] ?? []; - if (entryPoints.isEmpty) { - entryPoints.addAll([ - 'pkg/vm/lib/transformations/type_flow/entry_points.json', - 'pkg/vm/lib/transformations/type_flow/entry_points_extra.json', - ]); - } final errorPrinter = new ErrorPrinter(); final errorDetector = new ErrorDetector(previousErrorHandler: errorPrinter); diff --git a/pkg/vm/tool/precompiler2 b/pkg/vm/tool/precompiler2 index 9dae451ed92..2339405bf2f 100755 --- a/pkg/vm/tool/precompiler2 +++ b/pkg/vm/tool/precompiler2 @@ -89,9 +89,6 @@ fi export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64} BIN_DIR="$OUT_DIR/$DART_CONFIGURATION" -ENTRY_POINTS="--entry-points ${BIN_DIR}/gen/runtime/bin/precompiler_entry_points.json \ - --entry-points ${SDK_DIR}/pkg/vm/lib/transformations/type_flow/entry_points_extra.json" - # Step 1: Generate Kernel binary from the input Dart source. "$BIN_DIR"/dart \ "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart" \ @@ -99,7 +96,6 @@ ENTRY_POINTS="--entry-points ${BIN_DIR}/gen/runtime/bin/precompiler_entry_points --aot \ "${GEN_KERNEL_OPTIONS[@]}" \ $PACKAGES \ - $ENTRY_POINTS \ -o "$SNAPSHOT_FILE.dill" \ "$SOURCE_FILE" diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index 242e9766ab7..c6fe258e186 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -6,7 +6,6 @@ import("../../build/dart/dart_action.gni") import("../../sdk/lib/_http/http_sources.gni") import("../../sdk/lib/io/io_sources.gni") import("../../sdk/lib/cli/cli_sources.gni") -import("../../utils/generate_entry_points_json.gni") import("../runtime_args.gni") import("../vm/heap/heap_sources.gni") import("../vm/compiler/compiler_sources.gni") @@ -666,7 +665,7 @@ gen_snapshot_action("generate_snapshot_bin") { # dart 2. "--no-strong", "--no-sync-async", - "--reify-generic-functions", + "--no-reify-generic-functions", "--snapshot_kind=" + dart_core_snapshot_kind, "--vm_snapshot_data=" + rebase_path(vm_snapshot_data, root_build_dir), @@ -1239,11 +1238,3 @@ shared_library("sample_extension") { ldflags = [ "/LIBPATH:$abs_root_out_dir" ] } } - -generate_entry_points_json_with_dart_bootstrap( - "precompiler_entry_points_json") { - # Dart script to precompile (any valid script would suffice). - input = "../tests/vm/dart/hello_world_test.dart" - - output = "$target_gen_dir/precompiler_entry_points.json" -} diff --git a/tools/bots/try_benchmarks.sh b/tools/bots/try_benchmarks.sh index 141b8520183..a988f472ea0 100755 --- a/tools/bots/try_benchmarks.sh +++ b/tools/bots/try_benchmarks.sh @@ -242,7 +242,6 @@ EOF out/ReleaseX64/dart-sdk \ out/ReleaseSIMDBC64/dart \ out/ReleaseX64/gen/kernel-service.dart.snapshot \ - out/ReleaseX64/gen/runtime/bin/precompiler_entry_points.json \ out/ReleaseX64/dart \ out/ReleaseX64/dart_bootstrap \ out/ReleaseX64/run_vm_tests \ @@ -363,7 +362,6 @@ EOF out/ReleaseX64/dart-sdk \ out/ReleaseSIMDBC64/dart \ out/ReleaseX64/gen/kernel-service.dart.snapshot \ - out/ReleaseX64/gen/runtime/bin/precompiler_entry_points.json \ out/ReleaseX64/dart \ out/ReleaseX64/dart_bootstrap \ out/ReleaseX64/run_vm_tests \ diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni index b225d4097f4..0ef7e3904cd 100644 --- a/utils/application_snapshot.gni +++ b/utils/application_snapshot.gni @@ -121,8 +121,7 @@ template("_application_snapshot") { # Arguments to pass to the Dart application for the training run. # # vm_args (optional): -# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here. -# Instead use the template application_snapshot_dart1. +# Additional arguments to the Dart VM. # # name (optional): # The name of the snapshot if different from the target name. The output @@ -148,40 +147,6 @@ template("application_snapshot") { } } -# Creates an app-jit snapshot for a Dart1 program based on a training run. -# -# Parameters: -# main_dart (required): -# The entrypoint to the Dart application. -# -# training_args (required): -# Arguments to pass to the Dart application for the training run. -# -# vm_args (optional): -# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here. -# -# name (optional): -# The name of the snapshot if different from the target name. The output -# will be in $root_gen_dir/$name.dart.snapshot. -# -# deps (optional): -# Any build dependencies. -# -# dot_packages (optional): -# The .packages file for the app. Defaults to the $_dart_root/.packages. -# -# output (optional): -# Overrides the full output path. -template("application_snapshot_dart1") { - _application_snapshot(target_name) { - forward_variables_from(invoker, "*") - if (!defined(invoker.vm_args)) { - vm_args = [] - } - vm_args += [ "--no-preview-dart-2" ] - } -} - # Creates an app-jit snapshot for the common FE based on a training run. # # Parameters: @@ -192,7 +157,7 @@ template("application_snapshot_dart1") { # Arguments to pass to the Dart application for the training run. # # vm_args (optional): -# Additional arguments to the Dart VM. Do not put --no-preview-dart-2 here. +# Additional arguments to the Dart VM. # # name (optional): # The name of the snapshot if different from the target name. The output diff --git a/utils/generate_entry_points_json.gni b/utils/generate_entry_points_json.gni deleted file mode 100644 index dbb3a42219b..00000000000 --- a/utils/generate_entry_points_json.gni +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -# 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") - -_dart_root = get_path_info("..", "abspath") - -# Template to generate entry points JSON file using dart_bootstrap tool. -# List of entry points is generated as a by-product while doing precompilation. -# -# This template expects the following arguments: -# - input: Name of the input dart script for precompilation. -# - output: Name of the output entry points JSON file. -# - extra_args: Extra arguments to pass to dart_bootstrap (optional). -# -template("generate_entry_points_json_with_dart_bootstrap") { - assert(defined(invoker.input), "Must define input dart script") - assert(defined(invoker.output), "Must define output json file") - extra_args = [] - if (defined(invoker.extra_args)) { - extra_args += invoker.extra_args - } - dart_bootstrap_action(target_name) { - # Printing precompiler entry points is folded into precompilation, so dart_bootstrap is invoked - # with correct arguments to generate app-aot snapshot. - script = invoker.input - output = invoker.output - outputs = [ - output, - ] - vm_args = [ - "--no-preview-dart-2", - "--print-precompiler-entry-points=" + rebase_path(output), - "--snapshot=" + rebase_path("$target_gen_dir/dummy.snapshot"), - "--snapshot-kind=app-aot", - "--use-blobs", - "--snapshot-kind=app-aot", - ] + extra_args - args = [] - } -} - -# Template to copy checked-in extra entry points JSON file. -# -# This template expects the following argument: -# - output: Target destination for the extra entry points JSON file. -# -template("copy_entry_points_extra_json") { - assert(defined(invoker.output), "Must define output json file") - copy(target_name) { - sources = [ "$_dart_root/pkg/vm/lib/transformations/type_flow/entry_points_extra.json" ] - outputs = [ invoker.output ] - } -} diff --git a/utils/kernel-service/BUILD.gn b/utils/kernel-service/BUILD.gn index bcab7021e44..6e7f7774e76 100644 --- a/utils/kernel-service/BUILD.gn +++ b/utils/kernel-service/BUILD.gn @@ -78,15 +78,13 @@ prebuilt_dart_action("kernel_service_dill") { output, ] - # Enable this when the prebuilt SDK rolls to pick up the fix for - # Issue #34026. - # depfile = "$target_gen_dir/kernel_service_dill.d" - # abs_depfile = rebase_path(depfile) - # abs_output = rebase_path(output) - # vm_args = [ - # "--depfile=$abs_depfile", - # "--depfile_output_filename=$abs_output", - # ] + depfile = "$root_gen_dir/kernel_service_dill.d" + abs_depfile = rebase_path(depfile) + abs_output = rebase_path(output) + vm_args = [ + "--depfile=$abs_depfile", + "--depfile_output_filename=$abs_output", + ] script = gen_kernel_script