From 73a09eba16fa51653dad290232a652d8f991a99f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 24 Nov 2025 20:04:31 -0800 Subject: [PATCH] riscv64 in armhf out Signed-off-by: Joel Winarske --- .github/workflows/flutter-engine-armv7hf.yaml | 259 ------------------ .github/workflows/flutter-engine-riscv64.yaml | 3 + patches/0003-gn-riscv32-and-riscv64.patch | 28 ++ ...l-fixes-text_input-compiler-warnings.patch | 76 +++++ ...peller-unnecessary-virtual-specifier.patch | 28 ++ 5 files changed, 135 insertions(+), 259 deletions(-) delete mode 100644 .github/workflows/flutter-engine-armv7hf.yaml create mode 100644 patches/0003-gn-riscv32-and-riscv64.patch create mode 100644 patches/0005-fml-fixes-text_input-compiler-warnings.patch create mode 100644 patches/0006-impeller-unnecessary-virtual-specifier.patch diff --git a/.github/workflows/flutter-engine-armv7hf.yaml b/.github/workflows/flutter-engine-armv7hf.yaml deleted file mode 100644 index e101bfd..0000000 --- a/.github/workflows/flutter-engine-armv7hf.yaml +++ /dev/null @@ -1,259 +0,0 @@ -name: Linux armv7hf - -on: - workflow_dispatch: - inputs: - srcrev: - description: 'Flutter Engine Commit Hash' - required: True - default: '' - release: - description: 'Release' - required: false - default: 'false' - -jobs: - linux-armv7hf: - runs-on: [self-hosted, linux, x64] - env: - arch: arm - linux_cpu: arm --arm-float-abi hard - target_triple: armv7-unknown-linux-gnueabihf - target_sysroot: debian_bullseye_arm-sysroot - tag_debug: linux-engine-sdk-debug-armv7hf-${{ inputs.srcrev }} - tag_debug_unopt: linux-engine-sdk-debug-unopt-armv7hf-${{ inputs.srcrev }} - tag_release: linux-engine-sdk-release-armv7hf-${{ inputs.srcrev }} - tag_profile: linux-engine-sdk-profile-armv7hf-${{ inputs.srcrev }} - notes_debug: "Flutter Engine - Linux armv7hf runtime debug SDK" - notes_debug_unopt: "Flutter Engine - Linux armv7hf runtime debug unoptimized SDK" - notes_release: "Flutter Engine - Linux armv7hf runtime release SDK" - notes_profile: "Flutter Engine - Linux armv7hf runtime profile SDK" - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install packages - run: | - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - - - name: Get Flutter Source - run: | - export PATH=$PATH:$PWD/depot_tools - export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython - git clone https://github.com/flutter/flutter.git - pushd flutter - gclient config --spec 'solutions=[{"managed":False,"name":".","url":"https://github.com/flutter/flutter.git","custom_deps":{},"custom_vars":{"download_android_deps":False,"download_windows_deps":False,"download_linux_deps":True},"deps_file":"DEPS","safesync_url":""}]' - gclient sync --force --shallow --no-history -R -D --revision ${{ inputs.SRCREV }} -j$(nproc) -v - popd - - # fetch sysroot - cd flutter/engine/src - build/linux/sysroot_scripts/install-sysroot.py --arch=$arch - - - name: Patch Flutter Source - run: | - PATCH_DIR=$PWD/patches - cd flutter - git apply $PATCH_DIR/0001-clang-toolchain.patch - - - name: Build Debug - working-directory: flutter/engine/src - run: | - export PATH=$PATH:$PWD/../../../depot_tools - export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython - CLANG_ROOT=$(find -iname clang++) - CLANG_ROOT=$(dirname $CLANG_ROOT) - export CLANG_ROOT=$(dirname $CLANG_ROOT) - ./flutter/tools/gn --runtime-mode=debug \ - --embedder-for-target \ - --no-build-embedder-examples \ - --no-goma --no-rbe \ - --no-stripped --no-enable-unittests \ - --no-dart-version-git-info \ - --linux-cpu $linux_cpu \ - --target-os linux \ - --target-sysroot $PWD/build/linux/$target_sysroot \ - --target-toolchain $PWD/$CLANG_ROOT \ - --target-triple $target_triple - - ninja -C out/linux_debug_$arch - - - name: Prepare Debug Artifacts - run: | - scripts/prepare-sdk-armv7hf.sh flutter/engine/src/out/linux_debug_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot - - tar czfhv $tag_debug.tar.gz flutter/engine/src/out/linux_debug_$arch/engine-sdk/ - - sha256sum -b $tag_debug.tar.gz > $tag_debug.tar.gz.sha256 - - - name: Publish Debug - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-debug - path: | - linux-engine-sdk-debug-armv7hf-${{ inputs.srcrev }}.tar.gz - linux-engine-sdk-debug-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - - - name: Release - Debug Release - if: ${{ inputs.release == 'true' }} - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - run: | - gh release delete "$tag_debug" --cleanup-tag -y |true - gh release create --draft "$tag_debug" --title "$tag_debug" --notes "$notes_debug" - gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256" - gh release edit "$tag_debug" --draft=false - - - name: Build Debug Unoptimized - working-directory: flutter/engine/src - run: | - export PATH=$PATH:$PWD/../../../depot_tools - export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython - CLANG_ROOT=$(find -iname clang++) - CLANG_ROOT=$(dirname $CLANG_ROOT) - export CLANG_ROOT=$(dirname $CLANG_ROOT) - ./flutter/tools/gn --runtime-mode=debug \ - --unoptimized \ - --embedder-for-target \ - --no-build-embedder-examples \ - --no-goma --no-rbe \ - --no-stripped --no-enable-unittests \ - --no-dart-version-git-info \ - --linux-cpu $linux_cpu \ - --target-os linux \ - --target-sysroot $PWD/build/linux/$target_sysroot \ - --target-toolchain $PWD/$CLANG_ROOT \ - --target-triple $target_triple - ninja -C out/linux_debug_unopt_$arch - - - name: Prepare Debug Unoptimized Artifacts - run: | - scripts/prepare-sdk-armv7hf.sh flutter/engine/src/out/linux_debug_unopt_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot - - tar czfhv $tag_debug_unopt.tar.gz flutter/engine/src/out/linux_debug_unopt_$arch/engine-sdk/ - - sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 - - - name: Publish Debug Unoptimized - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-debug-unoptimized - path: | - linux-engine-sdk-debug-unopt-armv7hf-${{ inputs.srcrev }}.tar.gz - linux-engine-sdk-debug-unopt-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - - - name: Release - Debug Unoptimized Release - if: ${{ inputs.release == 'true' }} - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - run: | - gh release delete "$tag_debug_unopt" --cleanup-tag -y |true - gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt" - gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256" - gh release edit "$tag_debug_unopt" --draft=false - - - name: Build Release - working-directory: flutter/engine/src - run: | - export PATH=$PATH:$PWD/../../../depot_tools - export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython - CLANG_ROOT=$(find -iname clang++) - CLANG_ROOT=$(dirname $CLANG_ROOT) - export CLANG_ROOT=$(dirname $CLANG_ROOT) - ./flutter/tools/gn --runtime-mode=release \ - --embedder-for-target \ - --no-build-embedder-examples \ - --no-goma --no-rbe \ - --no-stripped --no-enable-unittests \ - --no-dart-version-git-info \ - --linux-cpu $linux_cpu \ - --target-os linux \ - --target-sysroot $PWD/build/linux/$target_sysroot \ - --target-toolchain $PWD/$CLANG_ROOT \ - --target-triple $target_triple - - ninja -C out/linux_release_$arch - - - name: Prepare Release Artifacts - run: | - scripts/prepare-sdk-armv7hf.sh flutter/engine/src/out/linux_release_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot - - tar czfhv $tag_release.tar.gz flutter/engine/src/out/linux_release_$arch/engine-sdk/ - - sha256sum -b $tag_release.tar.gz > $tag_release.tar.gz.sha256 - - - name: Publish Release - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-release - path: | - linux-engine-sdk-release-armv7hf-${{ inputs.srcrev }}.tar.gz - linux-engine-sdk-release-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - - - name: Release - Publish Release - if: ${{ inputs.release == 'true' }} - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - run: | - gh release delete "$tag_release" --cleanup-tag -y |true - gh release create --draft "$tag_release" --title "$tag_release" --notes "$notes_release" - gh release upload "$tag_release" "$tag_release.tar.gz" "$tag_release.tar.gz.sha256" - gh release edit "$tag_release" --draft=false - - - name: Build Profile - working-directory: flutter/engine/src - run: | - export PATH=$PATH:$PWD/../../../depot_tools - export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython - CLANG_ROOT=$(find -iname clang++) - CLANG_ROOT=$(dirname $CLANG_ROOT) - export CLANG_ROOT=$(dirname $CLANG_ROOT) - ./flutter/tools/gn --runtime-mode=profile \ - --embedder-for-target \ - --no-build-embedder-examples \ - --no-goma --no-rbe \ - --no-stripped --no-enable-unittests \ - --no-dart-version-git-info \ - --linux-cpu $linux_cpu \ - --target-os linux \ - --target-sysroot $PWD/build/linux/$target_sysroot \ - --target-toolchain $PWD/$CLANG_ROOT \ - --target-triple $target_triple - ninja -C out/linux_profile_$arch - - - name: Prepare Profile Artifacts - run: | - scripts/prepare-sdk-armv7hf.sh flutter/engine/src/out/linux_profile_$arch $PWD/flutter/engine/src/build/linux/debian_sid_arm-sysroot - - tar czfhv $tag_profile.tar.gz flutter/engine/src/out/linux_profile_$arch/engine-sdk/ - - sha256sum -b $tag_profile.tar.gz > $tag_profile.tar.gz.sha256 - - - name: Publish Profile - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-profile - path: | - linux-engine-sdk-profile-armv7hf-${{ inputs.srcrev }}.tar.gz - linux-engine-sdk-profile-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - - - name: Release - Publish Profile - if: ${{ inputs.release == 'true' }} - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - run: | - gh release delete "$tag_profile" --cleanup-tag -y |true - gh release create --draft "$tag_profile" --title "$tag_profile" --notes "$notes_profile" - gh release upload "$tag_profile" "$tag_profile.tar.gz" "$tag_profile.tar.gz.sha256" - gh release edit "$tag_profile" --draft=false - diff --git a/.github/workflows/flutter-engine-riscv64.yaml b/.github/workflows/flutter-engine-riscv64.yaml index d74993d..55196ec 100644 --- a/.github/workflows/flutter-engine-riscv64.yaml +++ b/.github/workflows/flutter-engine-riscv64.yaml @@ -57,6 +57,9 @@ jobs: PATCH_DIR=$PWD/patches cd flutter git apply $PATCH_DIR/0001-clang-toolchain.patch + git apply $PATCH_DIR/0003-gn-riscv32-and-riscv64.patch + git apply $PATCH_DIR/0005-fml-fixes-text_input-compiler-warnings.patch + git apply $PATCH_DIR/0006-impeller-unnecessary-virtual-specifier.patch - name: Build Debug working-directory: flutter/engine/src diff --git a/patches/0003-gn-riscv32-and-riscv64.patch b/patches/0003-gn-riscv32-and-riscv64.patch new file mode 100644 index 0000000..008be72 --- /dev/null +++ b/patches/0003-gn-riscv32-and-riscv64.patch @@ -0,0 +1,28 @@ +From 748e416e394552cac6e4be30112c3ef45d1c0ec3 Mon Sep 17 00:00:00 2001 +From: Joel Winarske +Date: Tue, 6 Aug 2024 08:03:59 -0700 +Subject: [PATCH] gn riscv32 and riscv64 + +Upstream-Status: Inappropriate + +Signed-off-by: Joel Winarske +--- + engine/src/flutter/tools/gn | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn +index 0be76e5477..8fee233aed 100755 +--- a/engine/src/flutter/tools/gn ++++ b/engine/src/flutter/tools/gn +@@ -1015,7 +1015,7 @@ def parse_args(args): + parser.add_argument('--web', action='store_true', default=False) + parser.add_argument('--windows', dest='target_os', action='store_const', const='win') + +- parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm']) ++ parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm', 'riscv32', 'riscv64']) + parser.add_argument('--fuchsia-cpu', type=str, choices=['x64', 'arm64'], default='x64') + parser.add_argument('--windows-cpu', type=str, choices=['x64', 'arm64', 'x86'], default='x64') + parser.add_argument('--simulator-cpu', type=str, choices=['x64', 'arm64'], default='x64') +-- +2.45.2 + diff --git a/patches/0005-fml-fixes-text_input-compiler-warnings.patch b/patches/0005-fml-fixes-text_input-compiler-warnings.patch new file mode 100644 index 0000000..d6734f9 --- /dev/null +++ b/patches/0005-fml-fixes-text_input-compiler-warnings.patch @@ -0,0 +1,76 @@ +From c7bb26a38b1d5988cc45a60091a70b5e87ac36ba Mon Sep 17 00:00:00 2001 +From: Joel Winarske +Date: Mon, 10 Nov 2025 09:49:09 -0800 +Subject: [PATCH] [fml] fixes text_input compiler warnings + +Upstream-Status: Inappropriate + +Signed-off-by: Joel Winarske +--- + .../shell/platform/common/text_input_model.cc | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/engine/src/flutter/shell/platform/common/text_input_model.cc b/engine/src/flutter/shell/platform/common/text_input_model.cc +index a21fe1ff3ef..ef807409dc1 100644 +--- a/engine/src/flutter/shell/platform/common/text_input_model.cc ++++ b/engine/src/flutter/shell/platform/common/text_input_model.cc +@@ -157,7 +157,7 @@ bool TextInputModel::Backspace() { + // There is no selection. Delete the preceding codepoint. + size_t position = selection_.position(); + if (position != editable_range().start()) { +- int count = IsTrailingSurrogate(text_.at(position - 1)) ? 2 : 1; ++ int count = IsTrailingSurrogate(static_cast(text_.at(position - 1))) ? 2 : 1; + text_.erase(position - count, count); + selection_ = TextRange(position - count); + if (composing_) { +@@ -175,7 +175,7 @@ bool TextInputModel::Delete() { + // There is no selection. Delete the preceding codepoint. + size_t position = selection_.position(); + if (position < editable_range().end()) { +- int count = IsLeadingSurrogate(text_.at(position)) ? 2 : 1; ++ int count = IsLeadingSurrogate(static_cast(text_.at(position))) ? 2 : 1; + text_.erase(position, count); + if (composing_) { + composing_range_.set_end(composing_range_.end() - count); +@@ -196,17 +196,17 @@ bool TextInputModel::DeleteSurrounding(int offset_from_cursor, int count) { + count = i; + break; + } +- start -= IsTrailingSurrogate(text_.at(start - 1)) ? 2 : 1; ++ start -= IsTrailingSurrogate(static_cast(text_.at(start - 1))) ? 2 : 1; + } + } else { + for (int i = 0; i < offset_from_cursor && start != max_pos; i++) { +- start += IsLeadingSurrogate(text_.at(start)) ? 2 : 1; ++ start += IsLeadingSurrogate(static_cast(text_.at(start))) ? 2 : 1; + } + } + + auto end = start; + for (int i = 0; i < count && end != max_pos; i++) { +- end += IsLeadingSurrogate(text_.at(start)) ? 2 : 1; ++ end += IsLeadingSurrogate(static_cast(text_.at(start))) ? 2 : 1; + } + + if (start == end) { +@@ -271,7 +271,7 @@ bool TextInputModel::MoveCursorForward() { + // Otherwise, move the cursor forward. + size_t position = selection_.position(); + if (position != editable_range().end()) { +- int count = IsLeadingSurrogate(text_.at(position)) ? 2 : 1; ++ int count = IsLeadingSurrogate(static_cast(text_.at(position))) ? 2 : 1; + selection_ = TextRange(position + count); + return true; + } +@@ -287,7 +287,7 @@ bool TextInputModel::MoveCursorBack() { + // Otherwise, move the cursor backward. + size_t position = selection_.position(); + if (position != editable_range().start()) { +- int count = IsTrailingSurrogate(text_.at(position - 1)) ? 2 : 1; ++ int count = IsTrailingSurrogate(static_cast(text_.at(position - 1))) ? 2 : 1; + selection_ = TextRange(position - count); + return true; + } +-- +2.51.1 + diff --git a/patches/0006-impeller-unnecessary-virtual-specifier.patch b/patches/0006-impeller-unnecessary-virtual-specifier.patch new file mode 100644 index 0000000..2aae7e0 --- /dev/null +++ b/patches/0006-impeller-unnecessary-virtual-specifier.patch @@ -0,0 +1,28 @@ +From ff6fcf1170b03546fd8c6445ca0ceeab4f66b278 Mon Sep 17 00:00:00 2001 +From: Joel Winarske +Date: Mon, 10 Nov 2025 11:54:38 -0800 +Subject: [PATCH] [impeller] unnecessary-virtual-specifier + +Upstream-Status: Inappropriate + +Signed-off-by: Joel Winarske +--- + engine/src/flutter/impeller/renderer/vertex_descriptor.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/engine/src/flutter/impeller/renderer/vertex_descriptor.h b/engine/src/flutter/impeller/renderer/vertex_descriptor.h +index 55c487e0cdf..b344d589da1 100644 +--- a/engine/src/flutter/impeller/renderer/vertex_descriptor.h ++++ b/engine/src/flutter/impeller/renderer/vertex_descriptor.h +@@ -28,7 +28,7 @@ class VertexDescriptor final : public Comparable { + VertexDescriptor(); + + // |Comparable| +- virtual ~VertexDescriptor(); ++ ~VertexDescriptor(); + + template + void SetStageInputs( +-- +2.51.1 +