Skip to content

ci: consolidate per-arch engine builds into one matrix on build-engine.sh - #22

Draft
jwinarske wants to merge 2 commits into
mainfrom
adopt-build-engine-sh
Draft

ci: consolidate per-arch engine builds into one matrix on build-engine.sh#22
jwinarske wants to merge 2 commits into
mainfrom
adopt-build-engine-sh

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Summary

Replaces the four per-arch workflows (flutter-engine-{arm64,armv7hf,riscv64,x86_64}.yaml) — each of which inlined the same depot_tools → gclient → gn → ninja → prepare-sdk orchestration, differing only by arch/triple/sysroot — with one matrix workflow driving a shared scripts/build-engine.sh. That recipe is the single source of truth also consumed by emb (and, next, a meta-flutter Yocto recipe), so the engine-build orchestration lives in exactly one place.

Changes

  • scripts/build-engine.shfetch (gclient sync) + build (patch → gn → ninja → prepare-sdk) phases. Derives linux_cpu/triple/sysroot from the arch, applies the per-arch patch series, and stages engine-sdk/. Validated locally producing engines for x86_64, arm64, riscv64, armv7hf (byte-comparable to the currently published SDKs).
  • patches/series-{default,riscv64} — the existing per-arch patch sets, expressed as a series with a strip level so the recipe applies exactly the patches git apply reads today. No patch files were changed.
  • .github/workflows/flutter-engine.yaml — matrix over the four arches × their modes (arm64/armv7hf/x86_64: debug/debug-unopt/profile/release; riscv64: debug/profile/release). Preserves the exact linux-engine-sdk-<mode>-<arch>-<srcrev> tag names and the draft/create/upload/publish release flow.
  • Removes the four old per-arch workflows.

⚠️ Why this is a draft — needs one self-hosted workflow_dispatch before merge

The recipe is validated locally, but the CI wiring hasn't run on meta-flutter's self-hosted runners. Before this replaces the working release pipeline, please dispatch it against a known srcrev (with release: false) and confirm:

  1. Patch application on the target commit. The recipe's local validation succeeded without 0001-clang-toolchain.patch — it patches build/toolchain/custom/BUILD.gn, which recent engine commits already ship, so it may be obsolete for current srcrevs (it would then fail to apply). The series preserves the current set; a dispatch confirms it still applies to the commit you build. If it's obsolete, drop it from the series files.
  2. Tag names + artifacts match what emb and ivi-homescreen fetch.
  3. The debug-unopt out-dir (linux_debug_unopt_<cpu>) staging.

Once a dispatch is green, flip to ready and merge.

…e.sh

The four per-arch workflows each inlined the same depot_tools/gclient/gn/ninja/
prepare-sdk orchestration, differing only by arch, triple, and sysroot. Replace
them with a single matrix workflow that drives scripts/build-engine.sh — the
shared recipe (also consumed by emb and, next, a meta-flutter Yocto recipe), so
the orchestration lives in exactly one place.

- Add scripts/build-engine.sh: fetch (gclient sync) + build (patch -> gn ->
  ninja -> prepare-sdk) phases; derives linux_cpu/triple/sysroot from the arch,
  applies the per-arch patch series, and stages engine-sdk/. Validated locally
  producing byte-comparable engines for x86_64/arm64/riscv64/armv7hf.
- Add patches/series-{default,riscv64}: the existing per-arch patch sets, with a
  strip level so the recipe applies the same patches git apply reads today (no
  patch files changed).
- flutter-engine.yaml matrix builds all arches x their modes (arm64/armv7hf/
  x86_64: debug/debug-unopt/profile/release; riscv64: debug/profile/release),
  preserving the exact linux-engine-sdk-<mode>-<arch>-<srcrev> tag names and the
  draft/upload release flow.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
workflow_dispatch only works once a workflow is on the default branch, so add a
branch-scoped push trigger (default srcrev, release=false) to exercise this on
the adoption branch. Revert this commit before merging.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant