From 25ed95661018712d7f0d1232bf68ea4e4b19f861 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 24 May 2026 09:31:21 +0300 Subject: [PATCH] build-one: add firmware_ref input for cross-repo bisect (#94) When investigating a regression that lives in OpenIPC/firmware (or its referenced packages like hisilicon-opensdk) but only manifests in a builder build, you previously had to either roll firmware master back or fork builder.sh manually. Adds a clean way: gh workflow run build-one.yml -f platform=hi3516ev200_fpv \ -f firmware_ref= The workflow exports OPENIPC_FW_REV as env, which builder.sh now honours: when set, it does a full clone (not --depth=1) and checks out the requested ref before invoking the firmware build. When unset, behaviour is unchanged (shallow clone of master HEAD). Immediate motivation: bisect the +180 KB rootfs growth in hi3516ev200_fpv between 2026-05-08 (5016 KB) and 2026-05-24 (5196 KB, 76 KB over partition limit). Per kaeru 'hi3516ev200-ev300-fpv-rootfs-size-overflow-2026-05-24'. Suspect is recent hisilicon-opensdk bumps that brought in source-built sensor drivers for ev200; bisect across firmware commits varying HISILICON_OPENSDK_VERSION will pinpoint which bump pushed us past the 5120 KB limit. Generally useful long after this specific incident: - Reproducing user-reported regressions at a specific firmware tag. - Locking builds to a known-good firmware revision when builder is ahead of firmware. - Future cross-repo bisects of any kind. Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/build-one.yml | 6 +++++- builder.sh | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-one.yml b/.github/workflows/build-one.yml index a33d7b2..dd36bd3 100644 --- a/.github/workflows/build-one.yml +++ b/.github/workflows/build-one.yml @@ -6,7 +6,10 @@ on: description: 'Platform to build (e.g. hi3518ev200_lite_switcam-hs303-v2)' required: true commit: - description: 'Commit SHA to build (optional; defaults to current branch HEAD). Use this from `git bisect run` or for one-off historic rebuilds.' + description: 'Builder commit SHA to build (optional; defaults to current branch HEAD). Use this from `git bisect run` or for one-off historic rebuilds.' + required: false + firmware_ref: + description: 'OpenIPC/firmware ref (SHA/tag/branch) to clone — for cross-repo bisect of size/regression issues. Defaults to firmware HEAD.' required: false jobs: @@ -60,6 +63,7 @@ jobs: BUILD_ID: ${{ needs.resolve.outputs.tag_name }} BUILD_SHA: ${{ needs.resolve.outputs.ref }} BUILD_PLATFORM: ${{ inputs.platform }} + OPENIPC_FW_REV: ${{ inputs.firmware_ref }} run: | export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA}) export GIT_BRANCH=${GITHUB_REF_NAME} diff --git a/builder.sh b/builder.sh index 1a55699..aadf7c6 100755 --- a/builder.sh +++ b/builder.sh @@ -124,9 +124,18 @@ echo_c 33 "\nUpdating Builder" git pull rm -rf openipc +# OPENIPC_FW_REV pins firmware to a specific ref (branch, tag, or SHA) for +# cross-repo bisect of size/regression issues — set by build-one.yml's +# firmware_ref input. When unset, clones HEAD of master as before. if [ ! -d "$FIRMWARE_DIR" ]; then - echo_c 33 "\nDownloading Firmware" - git clone --depth=1 https://github.com/OpenIPC/firmware.git "$FIRMWARE_DIR" + if [ -n "$OPENIPC_FW_REV" ]; then + echo_c 33 "\nDownloading Firmware @ ${OPENIPC_FW_REV}" + git clone https://github.com/OpenIPC/firmware.git "$FIRMWARE_DIR" + git -C "$FIRMWARE_DIR" checkout "$OPENIPC_FW_REV" + else + echo_c 33 "\nDownloading Firmware" + git clone --depth=1 https://github.com/OpenIPC/firmware.git "$FIRMWARE_DIR" + fi cd "$FIRMWARE_DIR" else echo_c 33 "\nUpdating Firmware"