Linux riscv64 #25
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux riscv64 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| srcrev: | |
| description: 'Flutter Engine Commit Hash' | |
| required: True | |
| default: '' | |
| release: | |
| description: 'Release' | |
| required: false | |
| default: 'false' | |
| jobs: | |
| linux-riscv64: | |
| runs-on: [self-hosted, linux, x64] | |
| env: | |
| arch: riscv64 | |
| linux_cpu: riscv64 | |
| target_triple: riscv64-unknown-linux-gnu | |
| target_sysroot: debian_trixie_riscv64-sysroot | |
| tag_debug: linux-engine-sdk-debug-riscv64-${{ inputs.srcrev }} | |
| tag_debug_unopt: linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }} | |
| tag_release: linux-engine-sdk-release-riscv64-${{ inputs.srcrev }} | |
| tag_profile: linux-engine-sdk-profile-riscv64-${{ inputs.srcrev }} | |
| notes_debug: "Flutter Engine - runtime debug SDK" | |
| notes_debug_unopt: "Flutter Engine - runtime debug SDK" | |
| notes_release: "Flutter Engine - runtime release SDK" | |
| notes_profile: "Flutter Engine - 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 | |
| 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 | |
| pushd engine/src/flutter/third_party/abseil-cpp | |
| git apply $PATCH_DIR/flutter/third_party/abseil-cpp/0001-flutter-third_party-abseil-cpp-clang-compiler-warnin.patch | |
| popd | |
| pushd engine/src/flutter/third_party/googletest | |
| git apply $PATCH_DIR/flutter/third_party/googletest/0001-flutter-third_party-googletest-fix-implicit-conversi.patch | |
| popd | |
| pushd engine/src/flutter/third_party/swiftshader | |
| git apply $PATCH_DIR/flutter/third_party/swiftshader/0001-flutter-third_party-swiftshader-pointer-cast-to-void.patch | |
| git apply $PATCH_DIR/flutter/third_party/swiftshader/0002-flutter-third_party-swiftshader-llvm-16.0-required-f.patch | |
| popd | |
| - 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-$arch.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-riscv64-${{ inputs.srcrev }}.tar.gz | |
| linux-engine-sdk-debug-riscv64-${{ 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 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-$arch.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-riscv64-${{ inputs.srcrev }}.tar.gz | |
| linux-engine-sdk-release-riscv64-${{ 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-$arch.sh flutter/engine/src/out/linux_profile_$arch $PWD/flutter/engine/src/build/linux/$target_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-riscv64-${{ inputs.srcrev }}.tar.gz | |
| linux-engine-sdk-profile-riscv64-${{ 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 |