Skip to content

flutter-engine-arm* CI #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/flutter-engine-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Linux arm64

on:
pull_request:
types: [ opened, synchronize, reopened, closed ]
release:
types: [ published, created, edited ]
workflow_dispatch:

jobs:
linux-arm64:

env:
# TODO - hard coded for now
SRCREV: "c9b9d5780da342eb3f0f5e439a7db06f7d112575"

runs-on: [self-hosted, linux, x64]

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
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 $SRCREV -j$(nproc) -v

PATCH_DIR=$PWD/patches

# fetch arm64 sysroot
cd src
build/linux/sysroot_scripts/install-sysroot.py --arch=arm64

git apply $PATCH_DIR/0001-clang-toolchain.patch
cd flutter
git apply $PATCH_DIR/0001-export-GPU-symbols.patch

- name: Build Debug
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=debug \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm64 \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple aarch64-unknown-linux-gnu

ninja -C out/linux_debug_arm64

- name: Publish Debug
working-directory: src/out/linux_debug_arm64
run: |
ls -laR exe.unstripped
ls -la *.so

- name: Build Release
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=release \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm64 \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple aarch64-unknown-linux-gnu
ninja -C out/linux_release_arm64

- name: Publish Release
working-directory: src/out/linux_release_arm64
run: |
ls -laR exe.unstripped
ls -la *.so

- name: Build Profile
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=profile \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm64 \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm64-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple aarch64-unknown-linux-gnu
ninja -C out/linux_profile_arm64

- name: Publish Profile
working-directory: src/out/linux_profile_arm64
run: |
ls -laR exe.unstripped
ls -la *.so
121 changes: 121 additions & 0 deletions .github/workflows/flutter-engine-armv7hf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Linux armv7hf

on:
pull_request:
types: [ opened, synchronize, reopened, closed ]
release:
types: [ published, created, edited ]
workflow_dispatch:

jobs:
linux-armv7hf:

env:
# TODO - hard coded for now
SRCREV: "c9b9d5780da342eb3f0f5e439a7db06f7d112575"

runs-on: [self-hosted, linux, x64]

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
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 $SRCREV -j$(nproc) -v

PATCH_DIR=$PWD/patches

# fetch arm sysroot
cd src
build/linux/sysroot_scripts/install-sysroot.py --arch=arm

git apply $PATCH_DIR/0001-clang-toolchain.patch
cd flutter
git apply $PATCH_DIR/0001-export-GPU-symbols.patch

- name: Build Debug
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=debug \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm \
--arm-float-abi hard \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple armv7-unknown-linux-gnueabihf

ninja -C out/linux_debug_arm

- name: Publish Debug
working-directory: src/out/linux_debug_arm
run: |
ls -laR clang_x64/exe.unstripped
ls -la *.so

- name: Build Release
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=release \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm \
--arm-float-abi hard \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple armv7-unknown-linux-gnueabihf

ninja -C out/linux_release_arm

- name: Publish Release
working-directory: src/out/linux_release_arm
run: |
ls -laR clang_x64/exe.unstripped
ls -la *.so

- name: Build Profile
working-directory: src
run: |
export PATH=$PATH:$PWD/../depot_tools
export VPYTHON_VIRTUALENV_ROOT=$PWD/vpython
./flutter/tools/gn --runtime-mode=profile \
--embedder-for-target \
--no-build-embedder-examples \
--enable-impeller-3d \
--no-goma --no-rbe \
--no-stripped --no-enable-unittests \
--linux-cpu arm \
--arm-float-abi hard \
--target-os linux \
--target-sysroot $PWD/build/linux/debian_sid_arm-sysroot \
--target-toolchain $PWD/flutter/buildtools/linux-x64/clang \
--target-triple armv7-unknown-linux-gnueabihf

ninja -C out/linux_profile_arm

- name: Publish Profile
working-directory: src/out/linux_profile_arm
run: |
ls -laR clang_x64/exe.unstripped
ls -la *.so
33 changes: 33 additions & 0 deletions patches/0001-clang-toolchain.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From eb564c8be13a16158056890069deef5bad533529 Mon Sep 17 00:00:00 2001
From: Joel Winarske <[email protected]>
Date: Mon, 26 Aug 2024 12:25:58 -0700
Subject: [PATCH] clang toolchain

Signed-off-by: Joel Winarske <[email protected]>
---
build/toolchain/custom/BUILD.gn | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn
index 3da5f93..05de4d7 100644
--- a/build/toolchain/custom/BUILD.gn
+++ b/build/toolchain/custom/BUILD.gn
@@ -12,11 +12,11 @@ toolchain("custom") {
# these values in our scope.
cc = "${toolchain_bin}/clang"
cxx = "${toolchain_bin}/clang++"
- ar = "${toolchain_bin}/${custom_target_triple}-ar"
+ ar = "${toolchain_bin}/llvm-ar"
ld = "${toolchain_bin}/clang++"
- readelf = "${toolchain_bin}/${custom_target_triple}-readelf"
- nm = "${toolchain_bin}/${custom_target_triple}-nm"
- strip = "${toolchain_bin}/${custom_target_triple}-strip"
+ readelf = "${toolchain_bin}/llvm-readelf"
+ nm = "${toolchain_bin}/llvm-nm"
+ strip = "${toolchain_bin}/llvm-strip"

target_triple_flags = "--target=${custom_target_triple}"
sysroot_flags = "--sysroot ${custom_sysroot}"
--
2.43.5