From 79a59110bb0f0edb5cab30d559876f38901012e8 Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Mon, 24 Jun 2024 18:58:11 -0700 Subject: [PATCH 1/5] [ci] Add Wasm compilation to all_packages web app. --- .ci/scripts/build_all_packages_app.sh | 1 + .ci/scripts/create_all_packages_app.sh | 9 ++++++++- .ci/targets/web_build_all_packages.yaml | 10 ++++++++++ script/configs/exclude_all_packages_app.yaml | 2 +- .../configs/exclude_all_packages_app_wasm.yaml | 18 ++++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 script/configs/exclude_all_packages_app_wasm.yaml diff --git a/.ci/scripts/build_all_packages_app.sh b/.ci/scripts/build_all_packages_app.sh index 7b381acc4e9..bfe7d85d8d3 100755 --- a/.ci/scripts/build_all_packages_app.sh +++ b/.ci/scripts/build_all_packages_app.sh @@ -8,4 +8,5 @@ platform="$1" build_mode="$2" shift 2 cd all_packages +flutter clean flutter build "$platform" --"$build_mode" "$@" diff --git a/.ci/scripts/create_all_packages_app.sh b/.ci/scripts/create_all_packages_app.sh index 4440dfe2608..c0161fb62a8 100755 --- a/.ci/scripts/create_all_packages_app.sh +++ b/.ci/scripts/create_all_packages_app.sh @@ -4,5 +4,12 @@ # found in the LICENSE file. set -e +# Decide what exclusion file to use, the normal or "wasm" depending on $1 +if [ "$1" = "--wasm" ]; then + EXCLUDE="script/configs/exclude_all_packages_app_wasm.yaml" +else + EXCLUDE="script/configs/exclude_all_packages_app.yaml" +fi + dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \ - --output-dir=. --exclude script/configs/exclude_all_packages_app.yaml + --output-dir=. --exclude $EXCLUDE diff --git a/.ci/targets/web_build_all_packages.yaml b/.ci/targets/web_build_all_packages.yaml index 1be790f62d5..aa14ca82512 100644 --- a/.ci/targets/web_build_all_packages.yaml +++ b/.ci/targets/web_build_all_packages.yaml @@ -10,3 +10,13 @@ tasks: - name: build all_packages app for Web release script: .ci/scripts/build_all_packages_app.sh args: ["web", "release"] + - name: clear all_packages app contents + script: rm -rf ./all_packages/* + infra_step: true + - name: (Wasm) create all_packages app + script: .ci/scripts/create_all_packages_app.sh + args: ["--wasm"] + infra_step: true # Note infra steps failing prevents "always" from running. + - name: (Wasm) build all_packages app for Web release + script: .ci/scripts/build_all_packages_app.sh + args: ["web", "release", "--wasm"] diff --git a/script/configs/exclude_all_packages_app.yaml b/script/configs/exclude_all_packages_app.yaml index 040087f10f5..ca15045d59d 100644 --- a/script/configs/exclude_all_packages_app.yaml +++ b/script/configs/exclude_all_packages_app.yaml @@ -9,5 +9,5 @@ # NOTE: camera_android is semi-excluded via special casing in the repo tools. # See create_all_packages_app_command.dart. -# This is a permament entry, as it should never be a direct app dependency. +# This is a permanent entry, as it should never be a direct app dependency. - plugin_platform_interface diff --git a/script/configs/exclude_all_packages_app_wasm.yaml b/script/configs/exclude_all_packages_app_wasm.yaml new file mode 100644 index 00000000000..3667d17706d --- /dev/null +++ b/script/configs/exclude_all_packages_app_wasm.yaml @@ -0,0 +1,18 @@ +# This list should be kept as short as possible, and things should remain here +# only as long as necessary, since in general the goal is for all of the latest +# versions of packages to be mutually compatible, and compilable with Wasm. + +# This is only used for wasm compilation. Once all packages in the repo have +# been migrated, remove this file and use `exclude_all_packages_app.yaml` instead. + +# Packages that aren't migrated yet. +# https://github.com/flutter/flutter/issues/117022 +- camera +- webview_flutter + +# Dependencies are not migrated yet +# https://github.com/flutter/flutter/issues/148624 +- google_maps_flutter + +# This is a permanent entry, as it should never be a direct app dependency. +- plugin_platform_interface From 82eb2a53cd23a483aa7bdb945127c08ab3611daa Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Mon, 24 Jun 2024 19:18:32 -0700 Subject: [PATCH 2/5] Remove ./all_packages --- .ci/targets/web_build_all_packages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/targets/web_build_all_packages.yaml b/.ci/targets/web_build_all_packages.yaml index aa14ca82512..694f6665d83 100644 --- a/.ci/targets/web_build_all_packages.yaml +++ b/.ci/targets/web_build_all_packages.yaml @@ -11,7 +11,7 @@ tasks: script: .ci/scripts/build_all_packages_app.sh args: ["web", "release"] - name: clear all_packages app contents - script: rm -rf ./all_packages/* + script: rm -rf ./all_packages infra_step: true - name: (Wasm) create all_packages app script: .ci/scripts/create_all_packages_app.sh From 209c80021cf0aea4cfa8d042ca85fdc44ef1ede9 Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Mon, 24 Jun 2024 19:26:06 -0700 Subject: [PATCH 3/5] Do not attempt to delete the all_packages dir (?) --- .ci/targets/web_build_all_packages.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/targets/web_build_all_packages.yaml b/.ci/targets/web_build_all_packages.yaml index 694f6665d83..fd3f1ff1efc 100644 --- a/.ci/targets/web_build_all_packages.yaml +++ b/.ci/targets/web_build_all_packages.yaml @@ -10,9 +10,9 @@ tasks: - name: build all_packages app for Web release script: .ci/scripts/build_all_packages_app.sh args: ["web", "release"] - - name: clear all_packages app contents - script: rm -rf ./all_packages - infra_step: true + # - name: clear all_packages app contents + # script: rm -rf ./all_packages + # infra_step: true - name: (Wasm) create all_packages app script: .ci/scripts/create_all_packages_app.sh args: ["--wasm"] From e70d79c4d86136a9d89323f751184deb85496859 Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Mon, 24 Jun 2024 19:37:52 -0700 Subject: [PATCH 4/5] Do not download deps multiple times. --- .ci/scripts/build_all_packages_app.sh | 1 - .ci/scripts/create_all_packages_app.sh | 3 +++ .ci/targets/web_build_all_packages.yaml | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.ci/scripts/build_all_packages_app.sh b/.ci/scripts/build_all_packages_app.sh index bfe7d85d8d3..7b381acc4e9 100755 --- a/.ci/scripts/build_all_packages_app.sh +++ b/.ci/scripts/build_all_packages_app.sh @@ -8,5 +8,4 @@ platform="$1" build_mode="$2" shift 2 cd all_packages -flutter clean flutter build "$platform" --"$build_mode" "$@" diff --git a/.ci/scripts/create_all_packages_app.sh b/.ci/scripts/create_all_packages_app.sh index c0161fb62a8..6c83da7d214 100755 --- a/.ci/scripts/create_all_packages_app.sh +++ b/.ci/scripts/create_all_packages_app.sh @@ -11,5 +11,8 @@ else EXCLUDE="script/configs/exclude_all_packages_app.yaml" fi +# Delete ./all_packages if it exists already +rm -rf ./all_packages + dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \ --output-dir=. --exclude $EXCLUDE diff --git a/.ci/targets/web_build_all_packages.yaml b/.ci/targets/web_build_all_packages.yaml index fd3f1ff1efc..bb782c560d2 100644 --- a/.ci/targets/web_build_all_packages.yaml +++ b/.ci/targets/web_build_all_packages.yaml @@ -10,9 +10,6 @@ tasks: - name: build all_packages app for Web release script: .ci/scripts/build_all_packages_app.sh args: ["web", "release"] - # - name: clear all_packages app contents - # script: rm -rf ./all_packages - # infra_step: true - name: (Wasm) create all_packages app script: .ci/scripts/create_all_packages_app.sh args: ["--wasm"] From 200a37fe5f9bc891ebb5d7fd4f02b370b3b3889f Mon Sep 17 00:00:00 2001 From: David Iglesias Teixeira Date: Tue, 25 Jun 2024 13:43:09 -0700 Subject: [PATCH 5/5] Apply PR comments. --- .ci/scripts/create_all_packages_app.sh | 13 +++++++------ script/configs/exclude_all_packages_app_wasm.yaml | 5 +---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.ci/scripts/create_all_packages_app.sh b/.ci/scripts/create_all_packages_app.sh index 6c83da7d214..a0ff3ad89d4 100755 --- a/.ci/scripts/create_all_packages_app.sh +++ b/.ci/scripts/create_all_packages_app.sh @@ -4,15 +4,16 @@ # found in the LICENSE file. set -e -# Decide what exclusion file to use, the normal or "wasm" depending on $1 -if [ "$1" = "--wasm" ]; then - EXCLUDE="script/configs/exclude_all_packages_app_wasm.yaml" -else - EXCLUDE="script/configs/exclude_all_packages_app.yaml" +# The base exclusion file for all_packages app. +exclusions=("script/configs/exclude_all_packages_app.yaml") + +# Add a wasm-specific exclusion file if "--wasm" is specified. +if [[ "$1" == "--wasm" ]]; then + exclusions+=",script/configs/exclude_all_packages_app_wasm.yaml" fi # Delete ./all_packages if it exists already rm -rf ./all_packages dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \ - --output-dir=. --exclude $EXCLUDE + --output-dir=. --exclude "$exclusions" diff --git a/script/configs/exclude_all_packages_app_wasm.yaml b/script/configs/exclude_all_packages_app_wasm.yaml index 3667d17706d..d10cdbf6ff2 100644 --- a/script/configs/exclude_all_packages_app_wasm.yaml +++ b/script/configs/exclude_all_packages_app_wasm.yaml @@ -3,7 +3,7 @@ # versions of packages to be mutually compatible, and compilable with Wasm. # This is only used for wasm compilation. Once all packages in the repo have -# been migrated, remove this file and use `exclude_all_packages_app.yaml` instead. +# been migrated, remove this file and use `exclude_all_packages_app.yaml` only. # Packages that aren't migrated yet. # https://github.com/flutter/flutter/issues/117022 @@ -13,6 +13,3 @@ # Dependencies are not migrated yet # https://github.com/flutter/flutter/issues/148624 - google_maps_flutter - -# This is a permanent entry, as it should never be a direct app dependency. -- plugin_platform_interface