From 57c24838db6db7ba978750bcfe81aacda58ca132 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Fri, 30 Aug 2024 09:37:52 -0700 Subject: [PATCH] Release Logic -adds debug_unopt build variant for each architecture -release logic for each build variant Signed-off-by: Joel Winarske --- .github/workflows/flutter-engine-arm64.yaml | 178 +++++++++++++---- .github/workflows/flutter-engine-armv7hf.yaml | 182 ++++++++++++++---- .github/workflows/flutter-engine-x86_64.yaml | 176 +++++++++++++---- README.md | 31 +++ ...re-sdk-aarch64.sh => prepare-sdk-arm64.sh} | 6 + scripts/prepare-sdk-armv7hf.sh | 6 + scripts/prepare-sdk-x86-64.sh | 6 + 7 files changed, 480 insertions(+), 105 deletions(-) rename scripts/{prepare-sdk-aarch64.sh => prepare-sdk-arm64.sh} (98%) diff --git a/.github/workflows/flutter-engine-arm64.yaml b/.github/workflows/flutter-engine-arm64.yaml index 3f00dba..429894b 100644 --- a/.github/workflows/flutter-engine-arm64.yaml +++ b/.github/workflows/flutter-engine-arm64.yaml @@ -3,14 +3,31 @@ name: Linux arm64 on: workflow_dispatch: inputs: - SRCREV: - description: 'Flutter Engine Target Source Revision' + srcrev: + description: 'Flutter Engine Commit Hash' required: True default: '' + release: + description: 'Release' + required: false + default: 'false' jobs: linux-arm64: runs-on: [self-hosted, linux, x64] + env: + arch: arm64 + linux_cpu: arm64 + target_triple: aarch64-unknown-linux-gnu + target_sysroot: debian_sid_arm64-sysroot + tag_debug: linux-engine-sdk-debug-arm64-${{ inputs.srcrev }} + tag_debug_unopt: linux-engine-sdk-debug-unopt-arm64-${{ inputs.srcrev }} + tag_release: linux-engine-sdk-release-arm64-${{ inputs.srcrev }} + tag_profile: linux-engine-sdk-profile-arm64-${{ 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 @@ -30,9 +47,9 @@ jobs: PATCH_DIR=$PWD/patches - # fetch arm64 sysroot + # fetch sysroot cd src - build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 + build/linux/sysroot_scripts/install-sysroot.py --arch=$arch git apply $PATCH_DIR/0001-clang-toolchain.patch cd flutter @@ -49,31 +66,96 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple aarch64-unknown-linux-gnu - ninja -C out/linux_debug_arm64 + --target-triple $target_triple + ninja -C out/linux_debug_$arch - name: Prepare Debug Artifacts run: | - chmod +x scripts/prepare-sdk-aarch64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm64-sysroot - cd src/out/linux_debug_arm64 - ../../../scripts/prepare-sdk-aarch64.sh + scripts/prepare-sdk-$arch.sh src/out/linux_debug_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug.tar.gz 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: src/out/linux_debug_arm64/engine-sdk/ + path: | + $tag_debug.tar.gz + $tag_debug.tar.gz.sha256 + + - name: Release - Debug Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src + run: | + export PATH=$PATH:$PWD/../depot_tools + export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython + ./flutter/tools/gn --runtime-mode=debug \ + --unoptimized \ + --embedder-for-target \ + --no-build-embedder-examples \ + --enable-impeller-3d \ + --no-goma --no-rbe \ + --no-stripped --no-enable-unittests \ + --linux-cpu $linux_cpu \ + --target-os linux \ + --target-sysroot $PWD/build/linux/$target_sysroot \ + --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ + --target-triple $target_triple + ninja -C out/linux_debug_unopt_$arch + + - name: Prepare Debug Unoptimized Artifacts + run: | + scripts/prepare-sdk-$arch.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ + tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ - - name: Publish Debug Symbols + sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 + sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Publish Debug Unoptimized + if: ${{ inputs.release != 'true' }} uses: actions/upload-artifact@v4 with: - name: engine-sdk-debug-symbols - path: src/out/linux_debug_arm64/.debug/ + name: engine-sdk-debug-unoptimized + path: | + $tag_debug_unopt.tar.gz + $tag_debug_unopt.tar.gz.sha256 + + - name: Publish Debug Unoptimized Symbols + if: ${{ inputs.release != 'true' }} + uses: actions/upload-artifact@v4 + with: + name: engine-sdk-debug-unoptimized-symbols + path: | + $tag_debug_unopt-symbols.tar.gz + $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Release - Debug Unoptimized Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -86,25 +168,39 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple aarch64-unknown-linux-gnu - ninja -C out/linux_release_arm64 + --target-triple $target_triple + ninja -C out/linux_release_$arch - name: Prepare Release Artifacts run: | - chmod +x scripts/prepare-sdk-aarch64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm64-sysroot - cd src/out/linux_release_arm64 - ../../../scripts/prepare-sdk-aarch64.sh + scripts/prepare-sdk-$arch.sh src/out/linux_release_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_release.tar.gz 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: src/out/linux_release_arm64/engine-sdk/ + path: | + $tag_release.tar.gz + $tag_release.tar.gz.sha256 + + - name: Release - Publish Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -117,22 +213,36 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple aarch64-unknown-linux-gnu - ninja -C out/linux_profile_arm64 + --target-triple $target_triple + ninja -C out/linux_profile_$arch - name: Prepare Profile Artifacts run: | - chmod +x scripts/prepare-sdk-aarch64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm64-sysroot - cd src/out/linux_profile_arm64 - ../../../scripts/prepare-sdk-aarch64.sh + scripts/prepare-sdk-$arch.sh src/out/linux_profile_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_profile.tar.gz 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: src/out/linux_profile_arm64/engine-sdk/ + path: | + $tag_profile.tar.gz + $tag_profile.tar.gz.sha256 + + - name: Release - Publish Profile + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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-armv7hf.yaml b/.github/workflows/flutter-engine-armv7hf.yaml index 54c1985..50a366b 100644 --- a/.github/workflows/flutter-engine-armv7hf.yaml +++ b/.github/workflows/flutter-engine-armv7hf.yaml @@ -3,14 +3,31 @@ name: Linux armv7hf on: workflow_dispatch: inputs: - SRCREV: - description: 'Flutter Engine Target Source Revision' + 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_sid_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 @@ -30,9 +47,9 @@ jobs: PATCH_DIR=$PWD/patches - # fetch arm sysroot + # fetch sysroot cd src - build/linux/sysroot_scripts/install-sysroot.py --arch=arm + build/linux/sysroot_scripts/install-sysroot.py --arch=$arch git apply $PATCH_DIR/0001-clang-toolchain.patch cd flutter @@ -49,33 +66,97 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm \ - --arm-float-abi hard \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple armv7-unknown-linux-gnueabihf + --target-triple $target_triple - ninja -C out/linux_debug_arm + ninja -C out/linux_debug_$arch - name: Prepare Debug Artifacts run: | - chmod +x scripts/prepare-sdk-armv7hf.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm-sysroot - cd src/out/linux_debug_arm - ../../../scripts/prepare-sdk-armv7hf.sh + scripts/prepare-sdk-armv7hf.sh src/out/linux_debug_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug.tar.gz 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: src/out/linux_debug_arm/engine-sdk/ + path: | + $tag_debug.tar.gz + $tag_debug.tar.gz.sha256 + + - name: Release - Debug Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src + run: | + export PATH=$PATH:$PWD/../depot_tools + export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython + ./flutter/tools/gn --runtime-mode=debug \ + --unoptimized \ + --embedder-for-target \ + --no-build-embedder-examples \ + --enable-impeller-3d \ + --no-goma --no-rbe \ + --no-stripped --no-enable-unittests \ + --linux-cpu $linux_cpu \ + --target-os linux \ + --target-sysroot $PWD/build/linux/$target_sysroot \ + --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ + --target-triple $target_triple + ninja -C out/linux_debug_unopt_$arch - - name: Publish Debug Symbols + - name: Prepare Debug Unoptimized Artifacts + run: | + scripts/prepare-sdk-armv7hf.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ + tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ + + sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 + sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Publish Debug Unoptimized + if: ${{ inputs.release != 'true' }} uses: actions/upload-artifact@v4 with: - name: engine-sdk-debug-symbols - path: src/out/linux_debug_arm/.debug/ + name: engine-sdk-debug-unoptimized + path: | + $tag_debug_unopt.tar.gz + $tag_debug_unopt.tar.gz.sha256 + + - name: Publish Debug Unoptimized Symbols + if: ${{ inputs.release != 'true' }} + uses: actions/upload-artifact@v4 + with: + name: engine-sdk-debug-unoptimized-symbols + path: | + $tag_debug_unopt-symbols.tar.gz + $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Release - Debug Unoptimized Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -88,27 +169,40 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm \ - --arm-float-abi hard \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple armv7-unknown-linux-gnueabihf + --target-triple $target_triple - ninja -C out/linux_release_arm + ninja -C out/linux_release_$arch - name: Prepare Release Artifacts run: | - chmod +x scripts/prepare-sdk-armv7hf.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm-sysroot - cd src/out/linux_release_arm - ../../../scripts/prepare-sdk-armv7hf.sh + scripts/prepare-sdk-armv7hf.sh src/out/linux_release_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_release.tar.gz 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: src/out/linux_release_arm/engine-sdk/ + path: | + $tag_release.tar.gz + $tag_release.tar.gz.sha256 + + - name: Release - Publish Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -121,25 +215,37 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu arm \ - --arm-float-abi hard \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple armv7-unknown-linux-gnueabihf - - ninja -C out/linux_profile_arm + --target-triple $target_triple + ninja -C out/linux_profile_$arch - name: Prepare Profile Artifacts run: | - chmod +x scripts/prepare-sdk-armv7hf.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_arm-sysroot - cd src/out/linux_profile_arm - ../../../scripts/prepare-sdk-armv7hf.sh + scripts/prepare-sdk-armv7hf.sh src/out/linux_profile_$arch $PWD/src/build/linux/debian_sid_arm-sysroot + + tar czfhv $tag_profile.tar.gz 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: src/out/linux_profile_arm/engine-sdk/ + path: | + $tag_profile.tar.gz + $tag_profile.tar.gz.sha256 + + - name: Release - Publish Profile + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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-x86_64.yaml b/.github/workflows/flutter-engine-x86_64.yaml index 2b7ef0b..f2ade8c 100644 --- a/.github/workflows/flutter-engine-x86_64.yaml +++ b/.github/workflows/flutter-engine-x86_64.yaml @@ -3,14 +3,31 @@ name: Linux x86_64 on: workflow_dispatch: inputs: - SRCREV: - description: 'Flutter Engine Target Source Revision' + srcrev: + description: 'Flutter Engine Commit Hash' required: True default: '' + release: + description: 'Release' + required: false + default: 'false' jobs: linux-x86_64: runs-on: [self-hosted, linux, x64] + env: + arch: x64 + linux_cpu: x64 + target_triple: x86_64-unknown-linux-gnu + target_sysroot: debian_sid_amd64-sysroot + tag_debug: linux-engine-sdk-debug-x86_64-${{ inputs.srcrev }} + tag_debug_unopt: linux-engine-sdk-debug-unopt-x86_64-${{ inputs.srcrev }} + tag_release: linux-engine-sdk-release-x86_64-${{ inputs.srcrev }} + tag_profile: linux-engine-sdk-profile-x86_64-${{ 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 @@ -26,7 +43,7 @@ jobs: export PATH=$PATH:$PWD/depot_tools export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython gclient config --spec 'solutions=[{"name":"src/flutter","url":"https://github.com/flutter/engine.git","deps_file":"DEPS","managed":False,"custom_deps":{},"custom_vars":{"download_android_deps":False,"download_windows_deps":False,"download_linux_deps":True}}]' - gclient sync --force --shallow --no-history -R -D --revision ${{ inputs.SRCREV }} -j$(nproc) -v + gclient sync --force --shallow --no-history -R -D --revision ${{ inputs.srcrev }} -j$(nproc) -v PATCH_DIR=$PWD/patches @@ -46,31 +63,96 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu x64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_amd64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple x86_64-unknown-linux-gnu - ninja -C out/linux_debug_x64 + --target-triple $target_triple + ninja -C out/linux_debug_$arch - name: Prepare Debug Artifacts run: | - chmod +x scripts/prepare-sdk-x86-64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_amd64-sysroot - cd src/out/linux_debug_x64 - ../../../scripts/prepare-sdk-x86-64.sh + scripts/prepare-sdk-x86-64.sh src/out/linux_debug_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug.tar.gz 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: src/out/linux_debug_x64/engine-sdk/ + path: | + $tag_debug.tar.gz + $tag_debug.tar.gz.sha256 + + - name: Release - Debug Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src + run: | + export PATH=$PATH:$PWD/../depot_tools + export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython + ./flutter/tools/gn --runtime-mode=debug \ + --unoptimized \ + --embedder-for-target \ + --no-build-embedder-examples \ + --enable-impeller-3d \ + --no-goma --no-rbe \ + --no-stripped --no-enable-unittests \ + --linux-cpu $linux_cpu \ + --target-os linux \ + --target-sysroot $PWD/build/linux/$target_sysroot \ + --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ + --target-triple $target_triple + ninja -C out/linux_debug_unopt_$arch + + - name: Prepare Debug Unoptimized Artifacts + run: | + scripts/prepare-sdk-x86-64.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ + tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ - - name: Publish Debug Symbols + sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 + sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Publish Debug Unoptimized + if: ${{ inputs.release != 'true' }} uses: actions/upload-artifact@v4 with: - name: engine-sdk-debug-symbols - path: src/out/linux_debug_x64/.debug/ + name: engine-sdk-debug-unoptimized + path: | + $tag_debug_unopt.tar.gz + $tag_debug_unopt.tar.gz.sha256 + + - name: Publish Debug Unoptimized Symbols + if: ${{ inputs.release != 'true' }} + uses: actions/upload-artifact@v4 + with: + name: engine-sdk-debug-unoptimized-symbols + path: | + $tag_debug_unopt-symbols.tar.gz + $tag_debug_unopt-symbols.tar.gz.sha256 + + - name: Release - Debug Unoptimized Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -83,25 +165,39 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu x64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_amd64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple x86_64-unknown-linux-gnu - ninja -C out/linux_release_x64 + --target-triple $target_triple + ninja -C out/linux_release_$arch - name: Prepare Release Artifacts run: | - chmod +x scripts/prepare-sdk-x86-64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_amd64-sysroot - cd src/out/linux_release_x64 - ../../../scripts/prepare-sdk-x86-64.sh + scripts/prepare-sdk-x86-64.sh src/out/linux_release_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_release.tar.gz 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: src/out/linux_release_x64/engine-sdk/ + path: | + $tag_release.tar.gz + $tag_release.tar.gz.sha256 + + - name: Release - Publish Release + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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: src @@ -114,22 +210,36 @@ jobs: --enable-impeller-3d \ --no-goma --no-rbe \ --no-stripped --no-enable-unittests \ - --linux-cpu x64 \ + --linux-cpu $linux_cpu \ --target-os linux \ - --target-sysroot $PWD/build/linux/debian_sid_amd64-sysroot \ + --target-sysroot $PWD/build/linux/$target_sysroot \ --target-toolchain $PWD/flutter/buildtools/linux-x64/clang \ - --target-triple x86_64-unknown-linux-gnu - ninja -C out/linux_profile_x64 + --target-triple $target_triple + ninja -C out/linux_profile_$arch - name: Prepare Profile Artifacts run: | - chmod +x scripts/prepare-sdk-x86-64.sh - export SYSROOT=$PWD/src/build/linux/debian_sid_amd64-sysroot - cd src/out/linux_profile_x64 - ../../../scripts/prepare-sdk-x86-64.sh + scripts/prepare-sdk-x86-64.sh src/out/linux_profile_$arch $PWD/src/build/linux/$target_sysroot + + tar czfhv $tag_profile.tar.gz 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: src/out/linux_profile_x64/engine-sdk/ + path: | + $tag_profile.tar.gz + $tag_profile.tar.gz.sha256 + + - name: Release - Publish Profile + if: ${{ inputs.release == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + 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/README.md b/README.md index a1d2a0f..802c1dc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ # flutter-engine Flutter Engine Artifacts + +## engine sdk + +Contains libraries and tools for running Embedded Flutter on Linux + +## Download and checksum validation + +Example download +``` +arch=armv7hf +commit=c9b9d5780da342eb3f0f5e439a7db06f7d112575 +runtime=debug +curl -L -O https://github.com/meta-flutter/flutter-engine/releases/download/linux-engine-sdk-$runtime-$arch-$commit/linux-engine-sdk-$runtime-$arch-$commit.tar.gz +curl -L -O https://github.com/meta-flutter/flutter-engine/releases/download/linux-engine-sdk-$runtime-$arch-$commit/linux-engine-sdk-$runtime-$arch-$commit.tar.gz.sha256 +sha256sum -c linux-engine-sdk-$runtime-$arch-$commit.tar.gz.sha256 +``` + +If the downloaded files are good you will see +``` +linux-engine-sdk-debug-unopt-arm64-c9b9d5780da342eb3f0f5e439a7db06f7d112575.tar.gz: OK +``` + +Never use a binary build artifact from a server that you cannot validate the expected checksum. It's there for a reason, use it. + +## glibc version issue issues + +When running binaries on your Linux host, if it fails to execute due to interpreter error you can use the following pattern: +``` +unshare -mr chroot `pwd`/engine-sdk /usr/bin/gen_snapshot --version +Dart SDK version: 3.6.0-164.0.dev (dev) (Tue Aug 20 13:05:46 2024 -0700) on "linux_x64" +``` diff --git a/scripts/prepare-sdk-aarch64.sh b/scripts/prepare-sdk-arm64.sh similarity index 98% rename from scripts/prepare-sdk-aarch64.sh rename to scripts/prepare-sdk-arm64.sh index 9d3f10f..ed1c435 100755 --- a/scripts/prepare-sdk-aarch64.sh +++ b/scripts/prepare-sdk-arm64.sh @@ -1,5 +1,9 @@ #! /bin/bash +pushd $1 + +SYSROOT=$2 + mkdir -p engine-sdk/{data,bin,lib/aarch64-linux-gnu,usr/lib/aarch64-linux-gnu,usr/include,sdk/lib} # @@ -76,3 +80,5 @@ for file in $(pwd)/engine-sdk/lib/*; do fi done mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ + +popd diff --git a/scripts/prepare-sdk-armv7hf.sh b/scripts/prepare-sdk-armv7hf.sh index b549d7d..960792f 100755 --- a/scripts/prepare-sdk-armv7hf.sh +++ b/scripts/prepare-sdk-armv7hf.sh @@ -1,5 +1,9 @@ #! /bin/bash +pushd $1 + +SYSROOT=$2 + mkdir -p engine-sdk/{data,lib,bin,lib/arm-linux-gnueabihf,usr/lib/arm-linux-gnueabihf,bin/clang_x64,usr/include,sdk/lib} # @@ -80,3 +84,5 @@ for file in $(pwd)/engine-sdk/lib/*; do fi done mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ + +popd diff --git a/scripts/prepare-sdk-x86-64.sh b/scripts/prepare-sdk-x86-64.sh index a936aef..d57f484 100755 --- a/scripts/prepare-sdk-x86-64.sh +++ b/scripts/prepare-sdk-x86-64.sh @@ -1,5 +1,9 @@ #! /bin/bash +pushd $1 + +SYSROOT=$2 + mkdir -p engine-sdk/{data,bin,lib64,lib/x86_64-linux-gnu,usr/lib/x86_64-linux-gnu,usr/include,sdk/lib} # @@ -80,3 +84,5 @@ for file in $(pwd)/engine-sdk/lib/*; do fi done mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ + +popd