From 6e37e9cd8f0365cdf80c8d653c0b6f0417537198 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 9 Sep 2020 14:04:52 -0700 Subject: [PATCH] Check for dart2js on felt startup (flutter/engine#21046) This adds a check for the presence of dart2js in the engine build. Felt relies on an engine build with `--full-dart-sdk` set. Previously, we checked for the presence of pub, but not for the presence of web-specific tooling such as dart2js that felt relies on. Pub is built as part of the default Dart SDK build when `--full-dart-sdk` is not set, so its presence is insufficient to prove that other required tooling is present. Without this check, we get the following error on run: Unhandled exception: ProcessException: No such file or directory Command: /Users/cbracken/src/flutter/engine/src/out/host_debug_unopt/dart-sdk/bin/dart2js --no-minify --disable-inlining --enable-asserts --enable-experiment=non-nullable --no-sound-null-safety -O2 -o test/paragraph_builder_test.dart.browser_test.dart.js test/paragraph_builder_test.dart --- engine/src/flutter/lib/web_ui/dev/felt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/web_ui/dev/felt b/engine/src/flutter/lib/web_ui/dev/felt index 13ca5a60b9..0699073105 100755 --- a/engine/src/flutter/lib/web_ui/dev/felt +++ b/engine/src/flutter/lib/web_ui/dev/felt @@ -34,12 +34,13 @@ DART_SDK_DIR="${ENGINE_SRC_DIR}/out/host_debug_unopt/dart-sdk" GN="${FLUTTER_DIR}/tools/gn" DART_TOOL_DIR="${WEB_UI_DIR}/.dart_tool" PUB_PATH="$DART_SDK_DIR/bin/pub" +DART2JS_PATH="$DART_SDK_DIR/bin/dart2js" SNAPSHOT_PATH="${DART_TOOL_DIR}/felt.snapshot" STAMP_PATH="${DART_TOOL_DIR}/felt.snapshot.stamp" SCRIPT_PATH="${DEV_DIR}/felt.dart" REVISION="$(cd "$FLUTTER_DIR"; git rev-parse HEAD)" -if [ ! -f "${PUB_PATH}" ] +if [ ! -f "${PUB_PATH}" -o ! -f "${DART2JS_PATH}" ] then echo "Compiling the Dart SDK." gclient sync