From 1dd72d4309953e6b1ba167546b53b41d1c2a2d85 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 3 Apr 2019 17:06:47 +0000 Subject: [PATCH] Revert "[vm/build] Expose is_release/is_profile so they are available in third_party gn scripts." and different fix. Patchset 1 reverts commit f3aaf8a77054b8062aaa2ec9c235add49f24d754 as it will present problems in other embedders which will have to deal with is_profile argument. Patchset 2 fixes the build by switching from is_product to dart_runtime_mode Change-Id: I167e6f531af3b0fb0f3e006b074ebdf1b69f3fe5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98601 Reviewed-by: Zach Anderson Commit-Queue: Alexander Aprelev --- build/config/BUILDCONFIG.gn | 8 ++++++-- runtime/runtime_args.gni | 6 ------ runtime/vm/BUILD.gn | 5 +++-- .../f6768b6fb3e58bb704aca1e22a7ffd11e7ff07cb.patch | 14 -------------- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 1bf4d5ddaa6..109e3fc4b5a 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -109,6 +109,12 @@ declare_args() { # Debug build. is_debug = true + # Release build. + is_release = false + + # Product build. + is_product = false + # Set to true when compiling with the Clang compiler. Typically this is used # to configure warnings. is_clang = current_os == "mac" || current_os == "linux" @@ -196,8 +202,6 @@ if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) { is_clang = true } -import("runtime/runtime_args.gni") - # ============================================================================= # TARGET DEFAULTS # ============================================================================= diff --git a/runtime/runtime_args.gni b/runtime/runtime_args.gni index 758ef06414f..d83020817f5 100644 --- a/runtime/runtime_args.gni +++ b/runtime/runtime_args.gni @@ -3,12 +3,6 @@ # BSD-style license that can be found in the LICENSE file. declare_args() { - # Release build. - is_release = false - - # Product build. - is_product = false - # Instead of using is_debug, we introduce a different flag for specifying a # Debug build of Dart so that clients can still use a Release build of Dart # while themselves doing a Debug build. diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn index bced864f0e1..680ab8411cd 100644 --- a/runtime/vm/BUILD.gn +++ b/runtime/vm/BUILD.gn @@ -119,9 +119,10 @@ template("gen_vm_platform") { "$root_out_dir/vm_outline" + output_postfix + ".dill", ] args = [ "dart:core" ] - allow_causal_async_stacks = !is_product + is_product_flag = dart_runtime_mode == "release" + allow_causal_async_stacks = !is_product_flag args += [ - "-Ddart.vm.product=$is_product", + "-Ddart.vm.product=$is_product_flag", "-Ddart.developer.causal_async_stacks=$allow_causal_async_stacks", "-Ddart.isVM=true", ] diff --git a/tools/patches/flutter-engine/f6768b6fb3e58bb704aca1e22a7ffd11e7ff07cb.patch b/tools/patches/flutter-engine/f6768b6fb3e58bb704aca1e22a7ffd11e7ff07cb.patch index e77f7d01467..b58759303fb 100644 --- a/tools/patches/flutter-engine/f6768b6fb3e58bb704aca1e22a7ffd11e7ff07cb.patch +++ b/tools/patches/flutter-engine/f6768b6fb3e58bb704aca1e22a7ffd11e7ff07cb.patch @@ -76,17 +76,3 @@ index aed4d561d..ca6f1c3fe 100644 ] } } else if (is_win) { -diff --git a/tools/gn b/tools/gn -index 7dacacf06..83bd7d9da 100755 ---- a/tools/gn -+++ b/tools/gn -@@ -134,6 +134,9 @@ def to_gn_args(args): - else: - gn_args['dart_runtime_mode'] = runtime_mode - -+ gn_args['is_release'] = gn_args['dart_runtime_mode'] == 'profile' -+ gn_args['is_product'] = gn_args['dart_runtime_mode'] == 'release' -+ - if args.dart_debug: - gn_args['dart_debug'] = True -