From 2692e4e7f251c5b5471d5a346323ac230f028703 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 31 Jan 2023 16:19:46 -0800 Subject: [PATCH] Revert "Remove uses of `--full-dart-sdk` from the engine_v2 builders. (#39297)" This reverts commit 5c83e6eac3d240339e7a8cab56043db635260cb7. --- ci/builders/linux_arm_host_engine.json | 1 + ci/builders/linux_host_engine.json | 3 + ci/builders/mac_host_engine.json | 6 +- ci/builders/web_engine.json | 131 +++++++++++++++++------ ci/builders/windows_arm_host_engine.json | 7 +- ci/builders/windows_host_engine.json | 7 +- lib/web_ui/dev/felt_windows.bat | 68 ++++++++++++ 7 files changed, 183 insertions(+), 40 deletions(-) create mode 100644 lib/web_ui/dev/felt_windows.bat diff --git a/ci/builders/linux_arm_host_engine.json b/ci/builders/linux_arm_host_engine.json index 3b4d5cda6091a..46cf1bd06d8fa 100644 --- a/ci/builders/linux_arm_host_engine.json +++ b/ci/builders/linux_arm_host_engine.json @@ -59,6 +59,7 @@ "gn": [ "--runtime-mode", "debug", + "--full-dart-sdk", "--target-os=linux", "--linux-cpu=arm64", "--prebuilt-dart-sdk" diff --git a/ci/builders/linux_host_engine.json b/ci/builders/linux_host_engine.json index a1835760f5f74..ab15c65433336 100644 --- a/ci/builders/linux_host_engine.json +++ b/ci/builders/linux_host_engine.json @@ -78,6 +78,7 @@ "out/host_debug/zip_archives/linux-x64/font-subset.zip", "out/host_debug/zip_archives/flutter_patched_sdk.zip", "out/host_debug/zip_archives/dart-sdk-linux-x64.zip", + "out/host_debug/zip_archives/flutter-web-sdk-linux-x64.zip", "out/host_debug/zip_archives/linux-x64/linux-x64-flutter-gtk.zip" ] } @@ -92,6 +93,7 @@ "gn": [ "--runtime-mode", "debug", + "--full-dart-sdk", "--prebuilt-dart-sdk", "--build-embedder-examples" ], @@ -103,6 +105,7 @@ "flutter/build/archives:embedder", "flutter/build/archives:flutter_patched_sdk", "flutter/build/archives:dart_sdk_archive", + "flutter/web_sdk", "flutter/tools/font-subset", "flutter/shell/platform/linux:flutter_gtk" ] diff --git a/ci/builders/mac_host_engine.json b/ci/builders/mac_host_engine.json index e33bf9e2201f6..834563eeb142a 100644 --- a/ci/builders/mac_host_engine.json +++ b/ci/builders/mac_host_engine.json @@ -8,7 +8,8 @@ "include_paths": [ "out/host_debug/zip_archives/darwin-x64/artifacts.zip", "out/host_debug/zip_archives/darwin-x64/FlutterEmbedder.framework.zip", - "out/host_debug/zip_archives/dart-sdk-darwin-x64.zip" + "out/host_debug/zip_archives/dart-sdk-darwin-x64.zip", + "out/host_debug/zip_archives/flutter-web-sdk-darwin-x64.zip" ], "name": "host_debug" } @@ -25,6 +26,7 @@ "--runtime-mode", "debug", "--no-lto", + "--full-dart-sdk", "--prebuilt-dart-sdk", "--build-embedder-examples" ], @@ -35,6 +37,7 @@ "flutter/shell/platform/darwin/macos:zip_macos_flutter_framework", "flutter/build/archives:artifacts", "flutter/build/archives:dart_sdk_archive", + "flutter/web_sdk", "flutter/build/archives:archive_gen_snapshot", "flutter/build/archives:flutter_embedder_framework" ] @@ -159,6 +162,7 @@ "--runtime-mode", "debug", "--no-lto", + "--full-dart-sdk", "--prebuilt-dart-sdk" ], "name": "mac_debug_arm64", diff --git a/ci/builders/web_engine.json b/ci/builders/web_engine.json index 1ce92ddf05c47..1aa3d7331fd27 100644 --- a/ci/builders/web_engine.json +++ b/ci/builders/web_engine.json @@ -1,41 +1,102 @@ { - "generators": { - "pub_dirs": [ - "flutter/lib/web_ui/", - "flutter/web_sdk/web_engine_tester/" - ], - "tasks": [ - { - "name": "compile web_tests", - "parameters": [ - "run", - "compile_tests" - ], - "scripts": [ - "out/host_debug_unopt/dart-sdk/bin/dart", - "flutter/lib/web_ui/dev/felt.dart" - ] + "builds": [ + { + "archives": [], + "drone_dimensions": [ + "device_type=none", + "os=Windows-10" + ], + "gn": [ + "--runtime-mode", + "debug", + "--unoptimized", + "--full-dart-sdk", + "--prebuilt-dart-sdk" + ], + "name": "windows_host_debug", + "ninja": { + "config": "host_debug_unopt", + "targets": [] }, - { - "name": "check licenses", - "parameters": [ - "check-licenses" + "platform": "Windows", + "tests": [] + }, + { + "archives": [], + "drone_dimensions": [ + "device_type=none", + "os=Linux" + ], + "generators": { + "pub_dirs": [ + "flutter/lib/web_ui/", + "flutter/web_sdk/web_engine_tester/" ], - "scripts": [ - "out/host_debug_unopt/dart-sdk/bin/dart", - "flutter/lib/web_ui/dev/felt.dart" + "tasks": [ + { + "name": "compile web_tests", + "parameters": [ + "run", + "compile_tests" + ], + "scripts": [ + "out/host_debug_unopt/dart-sdk/bin/dart", + "flutter/lib/web_ui/dev/felt.dart" + ] + }, + { + "name": "check licenses", + "parameters": [ + "check-licenses" + ], + "scripts": [ + "out/host_debug_unopt/dart-sdk/bin/dart", + "flutter/lib/web_ui/dev/felt.dart" + ] + }, + { + "name": "web engine analysis", + "parameters": [], + "scripts": [ + "flutter/lib/web_ui/dev/web_engine_analysis.sh" + ] + } ] }, - { - "name": "web engine analysis", - "parameters": [ - "analyze" - ], - "scripts": [ - "out/host_debug_unopt/dart-sdk/bin/dart", - "flutter/lib/web_ui/dev/felt.dart" - ] - } - ] - } + "gn": [ + "--runtime-mode", + "debug", + "--unoptimized", + "--full-dart-sdk" + ], + "name": "linux_host_debug_unopt", + "ninja": { + "config": "host_debug_unopt", + "targets": [] + }, + "platform": "Linux", + "tests": [] + }, + { + "archives": [], + "drone_dimensions": [ + "device_type=none", + "os=Mac" + ], + "gn": [ + "--runtime-mode", + "debug", + "--unoptimized", + "--full-dart-sdk", + "--prebuilt-dart-sdk" + ], + "name": "mac_host_debug_unopt", + "ninja": { + "config": "host_debug_unopt", + "targets": [] + }, + "platform": "Mac", + "tests": [] + } + ] } diff --git a/ci/builders/windows_arm_host_engine.json b/ci/builders/windows_arm_host_engine.json index dfa170b3632d1..a0c20004f0671 100644 --- a/ci/builders/windows_arm_host_engine.json +++ b/ci/builders/windows_arm_host_engine.json @@ -11,7 +11,8 @@ "out/host_debug_arm64/zip_archives/windows-arm64/font-subset.zip", "out/host_debug_arm64/zip_archives/dart-sdk-windows-arm64.zip", "out/host_debug_arm64/zip_archives/windows-arm64-debug/windows-arm64-flutter.zip", - "out/host_debug_arm64/zip_archives/windows-arm64/flutter-cpp-client-wrapper.zip" + "out/host_debug_arm64/zip_archives/windows-arm64/flutter-cpp-client-wrapper.zip", + "out/host_debug_arm64/zip_archives/flutter-web-sdk-windows-arm64.zip" ], "name": "host_debug_arm64" } @@ -26,6 +27,7 @@ "gn": [ "--runtime-mode", "debug", + "--full-dart-sdk", "--no-lto", "--windows-cpu", "arm64" @@ -39,7 +41,8 @@ "flutter/tools/font-subset", "flutter/build/archives:dart_sdk_archive", "flutter/shell/platform/windows/client_wrapper:client_wrapper_archive", - "flutter/build/archives:windows_flutter" + "flutter/build/archives:windows_flutter", + "flutter/web_sdk" ] }, "tests": [] diff --git a/ci/builders/windows_host_engine.json b/ci/builders/windows_host_engine.json index fa23d8c624239..a22943aae63db 100644 --- a/ci/builders/windows_host_engine.json +++ b/ci/builders/windows_host_engine.json @@ -11,7 +11,8 @@ "out/host_debug/zip_archives/windows-x64/font-subset.zip", "out/host_debug/zip_archives/dart-sdk-windows-x64.zip", "out/host_debug/zip_archives/windows-x64-debug/windows-x64-flutter.zip", - "out/host_debug/zip_archives/windows-x64/flutter-cpp-client-wrapper.zip" + "out/host_debug/zip_archives/windows-x64/flutter-cpp-client-wrapper.zip", + "out/host_debug/zip_archives/flutter-web-sdk-windows-x64.zip" ], "name": "host_debug" } @@ -26,6 +27,7 @@ "gn": [ "--runtime-mode", "debug", + "--full-dart-sdk", "--no-lto" ], "name": "host_debug", @@ -38,7 +40,8 @@ "flutter/tools/font-subset", "flutter/build/archives:dart_sdk_archive", "flutter/shell/platform/windows/client_wrapper:client_wrapper_archive", - "flutter/build/archives:windows_flutter" + "flutter/build/archives:windows_flutter", + "flutter/web_sdk" ] }, "tests": [ diff --git a/lib/web_ui/dev/felt_windows.bat b/lib/web_ui/dev/felt_windows.bat new file mode 100644 index 0000000000000..94edf0ea1d688 --- /dev/null +++ b/lib/web_ui/dev/felt_windows.bat @@ -0,0 +1,68 @@ +:: TODO(yjbanov): migrate LUCI to felt.bat and delete this file. +:: felt_windows: a command-line utility for Windows for building and testing +:: Flutter web engine. +:: FELT stands for Flutter Engine Local Tester. + +@ECHO OFF +SETLOCAL + +FOR /F "tokens=1-2 delims=:" %%a in ('where gclient') DO SET GCLIENT_PATH=%%b +IF %GCLIENT_PATH%==[] (ECHO "ERROR: gclient is not in your PATH") + +FOR /F "tokens=1-2 delims=:" %%a in ('where ninja') DO SET NINJA_PATH=%%b +IF %NINJA_PATH%==[] (ECHO "ERROR: ninja is not in your PATH") + +SET FELT_DIR=%~dp0 + +:: web_ui directory is the parent of felt directory. +FOR %%a IN ("%FELT_DIR:~0,-1%") DO SET WEB_UI_DIR=%%~dpa + +:: Flutter Directory is grandparent of web_ui directory. +FOR %%a IN ("%WEB_UI_DIR:~0,-1%") DO SET orTempValue=%%~dpa +FOR %%a IN ("%orTempValue:~0,-1%") DO SET FLUTTER_DIR=%%~dpa + +:: Engine source directory is the parent of flutter directory. +FOR %%a IN ("%FLUTTER_DIR:~0,-1%") DO SET ENGINE_SRC_DIR=%%~dpa + +SET DEV_DIR="%WEB_UI_DIR%dev" +SET OUT_DIR="%ENGINE_SRC_DIR%out" +SET HOST_DEBUG_UNOPT_DIR="%ENGINE_SRC_DIR%out\host_debug_unopt" +SET SCRIPT_PATH="%DEV_DIR%felt.dart" +SET STAMP_PATH="%DART_TOOL_DIR%felt.snapshot.stamp" +SET GN="%FLUTTER_DIR%tools\gn" +SET DART_TOOL_DIR="%WEB_UI_DIR%.dart_tool" +SET SNAPSHOT_PATH="%DART_TOOL_DIR%felt.snapshot" +SET SDK_PREBUILTS_DIR=%FLUTTER_DIR%\prebuilts +SET PREBUILT_TARGET=windows-x64 +IF NOT DEFINED DART_SDK_DIR ( + SET DART_SDK_DIR=%SDK_PREBUILTS_DIR%\%PREBUILT_TARGET%\dart-sdk +) + +:: Set revision from using git in Flutter directory. +CD %FLUTTER_DIR% +FOR /F "tokens=1 delims=:" %%a in ('git rev-parse HEAD') DO SET REVISION=%%a + +SET orTempValue=1 +IF NOT EXIST %OUT_DIR% (SET orTempValue=0) +IF NOT EXIST %HOST_DEBUG_UNOPT_DIR% (SET orTempValue=0) +IF %orTempValue%==0 ( + ECHO "Compiling the Dart SDK." + CALL gclient sync + CALL python %GN% --unoptimized --full-dart-sdk + CALL ninja -C %HOST_DEBUG_UNOPT_DIR%) + +:: TODO(yjbanov): The batch script does not support snapshot option. +:: Support snapshot option. +CALL :installdeps +IF "%1"=="test" (%DART_SDK_DIR%\bin\dart %DEV_DIR%\felt.dart %* --browser=chrome) ELSE ( %DART_SDK_DIR%\bin\dart %DEV_DIR%\felt.dart %* ) + +EXIT /B %ERRORLEVEL% + +:installdeps +ECHO "Running \`pub get\` in 'engine/src/flutter/web_sdk/web_engine_tester'" +cd "%FLUTTER_DIR%web_sdk\web_engine_tester" +CALL %DART_SDK_DIR%\bin\dart pub get +ECHO "Running \`pub get\` in 'engine/src/flutter/lib/web_ui'" +cd %WEB_UI_DIR% +CALL %DART_SDK_DIR%\bin\dart pub get +EXIT /B 0