From 5fe383698b44177ebaba582c9950d4673d4597cc Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Fri, 10 Aug 2018 12:47:32 +0200 Subject: [PATCH 1/3] Roll Dart to version be6309690fd60284a87f3258a740c7c30efb1092 This rolls includes the following changes: be6309690f (HEAD) Analyze pkg/dart2js_tools on the bots. 6f9073bb9d Wait for Analysis Server errors only while waiting for a response. 5d4e85ba3d Allow `x == null` to be a constant value whenever x is const. 7c77ed04f4 Move deobfuscation tools to the SDK repo 666c8c1a89 Fix @visibleForTemplate tests on Windows. 6fc1dd4480 analyzer_plugin no implicit-casts. 29401573d5 Get documentation comments before metadata as well. 3d0a663518 [vm/frontend-server] Fix frontend_server so that it can be tested. --- DEPS | 2 +- ci/licenses.sh | 2 +- ci/licenses_golden/licenses_third_party | 88 ++++++++++++------------- frontend_server/bin/starter.dart | 10 ++- frontend_server/lib/server.dart | 11 ++-- 5 files changed, 58 insertions(+), 55 deletions(-) diff --git a/DEPS b/DEPS index 81480ad230f44..5edb82f4dde37 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '1be785ae2ddb1754a184cd638ab719e94d86b4e9', + 'dart_revision': 'be6309690fd60284a87f3258a740c7c30efb1092', 'dart_args_tag': '1.4.4', 'dart_async_tag': '2.0.8', diff --git a/ci/licenses.sh b/ci/licenses.sh index 974aaab468eff..be89742edabec 100755 --- a/ci/licenses.sh +++ b/ci/licenses.sh @@ -3,7 +3,7 @@ set -e shopt -s nullglob echo "Verifying license script is still happy..." -(cd flutter/tools/licenses; pub get; dart --checked lib/main.dart --src ../../.. --out ../../../out/license_script_output --golden ../../ci/licenses_golden) +(cd flutter/tools/licenses; pub get; dart lib/main.dart --src ../../.. --out ../../../out/license_script_output --golden ../../ci/licenses_golden) for f in out/license_script_output/licenses_*; do if ! cmp -s flutter/ci/licenses_golden/$(basename $f) $f diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index 89056741a5a1d..50f2906b70761 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party @@ -16652,50 +16652,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: tonic -ORIGIN: ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/tonic/dart_list.cc -FILE: ../../../third_party/tonic/dart_list.h -FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc -FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc -FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h -FILE: ../../../third_party/tonic/platform/platform_utils.h -FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc -FILE: ../../../third_party/tonic/platform/platform_utils_win.cc ----------------------------------------------------------------------------------------------------- -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: tonic ORIGIN: ../../../third_party/tonic/LICENSE @@ -16793,6 +16749,50 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: tonic +ORIGIN: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc + ../../../third_party/tonic/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/tonic/dart_list.cc +FILE: ../../../third_party/tonic/dart_list.h +FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h +FILE: ../../../third_party/tonic/platform/platform_utils.h +FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc +FILE: ../../../third_party/tonic/platform/platform_utils_win.cc +---------------------------------------------------------------------------------------------------- +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: tonic ORIGIN: ../../../third_party/tonic/typed_data/dart_byte_data.cc + ../../../third_party/tonic/LICENSE diff --git a/frontend_server/bin/starter.dart b/frontend_server/bin/starter.dart index ab7e03a4b297f..60f3748d199a8 100644 --- a/frontend_server/bin/starter.dart +++ b/frontend_server/bin/starter.dart @@ -1,7 +1,11 @@ library frontend_server; +import 'dart:io'; + import 'package:frontend_server/server.dart'; -void main(List args){ - starter(args); -} +void main(List args) async { + final int exitCode = await starter(args); + if (exitCode != 0) { + exit(exitCode); + }} diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 913cd38395346..c264c01ff5612 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -121,11 +121,10 @@ Future starter( compiler ??= new _FlutterFrontendCompiler(output, trackWidgetCreation: options['track-widget-creation']); if (options.rest.isNotEmpty) { - exit(await compiler.compile(options.rest[0], options) - ? 0 - : 254); + return await compiler.compile(options.rest[0], options) ? 0 : 254; } - frontend.listenAndCompile(compiler, input ?? stdin, options, () { exit(0); } ); - return 0; -} + Completer completer = new Completer(); + frontend.listenAndCompile(compiler, input ?? stdin, options, completer); + return completer.future; +} \ No newline at end of file From a651792a3cd68604339cb0a1f4d78f296e370206 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Fri, 10 Aug 2018 12:54:16 +0200 Subject: [PATCH 2/3] fix analyzer hint --- frontend_server/lib/server.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index c264c01ff5612..804c5699eb2f8 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -124,7 +124,7 @@ Future starter( return await compiler.compile(options.rest[0], options) ? 0 : 254; } - Completer completer = new Completer(); + final Completer completer = new Completer(); frontend.listenAndCompile(compiler, input ?? stdin, options, completer); return completer.future; -} \ No newline at end of file +} From 2008f17ab9e68b86097a2ff443f2b9213d54a57c Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Fri, 10 Aug 2018 13:33:04 +0200 Subject: [PATCH 3/3] use --enable-asserts instead of --checked --- ci/licenses.sh | 2 +- frontend_server/bin/starter.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/licenses.sh b/ci/licenses.sh index be89742edabec..472285b5b88c3 100755 --- a/ci/licenses.sh +++ b/ci/licenses.sh @@ -3,7 +3,7 @@ set -e shopt -s nullglob echo "Verifying license script is still happy..." -(cd flutter/tools/licenses; pub get; dart lib/main.dart --src ../../.. --out ../../../out/license_script_output --golden ../../ci/licenses_golden) +(cd flutter/tools/licenses; pub get; dart --enable-asserts lib/main.dart --src ../../.. --out ../../../out/license_script_output --golden ../../ci/licenses_golden) for f in out/license_script_output/licenses_*; do if ! cmp -s flutter/ci/licenses_golden/$(basename $f) $f diff --git a/frontend_server/bin/starter.dart b/frontend_server/bin/starter.dart index 60f3748d199a8..da85e557575b1 100644 --- a/frontend_server/bin/starter.dart +++ b/frontend_server/bin/starter.dart @@ -8,4 +8,5 @@ void main(List args) async { final int exitCode = await starter(args); if (exitCode != 0) { exit(exitCode); - }} + } +}