From c2f46abdb3331f9cbb8648d1d52a5ac0e36593a2 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Mon, 8 Jun 2026 01:28:25 -0700 Subject: [PATCH 1/3] ci: skip ffmpeg-static CDN download on ubuntu; retry Windows FFmpeg install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu-24.04 runners ship /usr/bin/ffmpeg. Set FFMPEG_BIN so ffmpeg-static's postinstall script skips its GitHub-release binary download, preventing bun install failures when that CDN is unavailable. For Windows: increase BtbN/FFmpeg-Builds download max-attempts 3→8 with longer backoff (30×attempt s) and set FFMPEG_BIN after install so bun install also skips ffmpeg-static's download in both render and test jobs. Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/install-ffmpeg-windows/action.yml | 4 ++-- .github/workflows/ci.yml | 4 ++++ .github/workflows/windows-render.yml | 12 ++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-ffmpeg-windows/action.yml b/.github/actions/install-ffmpeg-windows/action.yml index 43dea7b92..9b55cc7dd 100644 --- a/.github/actions/install-ffmpeg-windows/action.yml +++ b/.github/actions/install-ffmpeg-windows/action.yml @@ -19,7 +19,7 @@ inputs: max-attempts: description: Max download attempts before failing. required: false - default: "3" + default: "8" runs: using: composite @@ -44,7 +44,7 @@ runs: } catch { Write-Warning "Download failed: $($_.Exception.Message)" if ($attempt -eq $maxAttempts) { throw } - Start-Sleep -Seconds (10 * $attempt) + Start-Sleep -Seconds (30 * $attempt) } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f40a28af..e9d97e5d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,10 @@ permissions: # External users' CI continues to emit telemetry unless they set this themselves. env: HYPERFRAMES_NO_TELEMETRY: "1" + # ubuntu-24.04 runners ship with /usr/bin/ffmpeg. Setting FFMPEG_BIN makes + # ffmpeg-static's postinstall script skip its GitHub-release binary download, + # preventing spurious bun-install failures when that CDN is unavailable. + FFMPEG_BIN: /usr/bin/ffmpeg on: pull_request: diff --git a/.github/workflows/windows-render.yml b/.github/workflows/windows-render.yml index e040e2503..e8d9f5b63 100644 --- a/.github/workflows/windows-render.yml +++ b/.github/workflows/windows-render.yml @@ -108,6 +108,12 @@ jobs: - name: Install FFmpeg uses: ./.github/actions/install-ffmpeg-windows + - name: Set FFMPEG_BIN for bun install + shell: pwsh + run: | + $path = (Get-Command ffmpeg.exe).Source + "FFMPEG_BIN=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # ----------------------------------------------------------------- # Verify FFmpeg feature inventory. # @@ -394,6 +400,12 @@ jobs: - name: Install FFmpeg uses: ./.github/actions/install-ffmpeg-windows + - name: Set FFMPEG_BIN for bun install + shell: pwsh + run: | + $path = (Get-Command ffmpeg.exe).Source + "FFMPEG_BIN=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Install Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 From 5f69ac35acf68a0b5e95a6c68a5787d01677e87b Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Mon, 8 Jun 2026 01:44:27 -0700 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20fix=20FFMPEG=5FBIN=20approach=20?= =?UTF-8?q?=E2=80=94=20use=20writable=20copy=20via=20composite=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /usr/bin/ffmpeg is not writable by the runner user. When bun runs ffmpeg-static's postinstall script in a context where process.exit(0) is intercepted, the skip-if-exists check has no effect and the download proceeds to the destination path. Pointing FFMPEG_BIN at a system path (/usr/bin/ffmpeg) therefore causes EACCES even when the CDN returns 200. Replace the top-level env var with a prepare-ffmpeg-bin composite action that copies the system ffmpeg to $RUNNER_TEMP (writable). Call it before every bun install step in the CI workflow. Whether the postinstall script skips or overwrites, the write target is now writable and the job succeeds. Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/prepare-ffmpeg-bin/action.yml | 23 +++++++++++++++++++ .github/workflows/ci.yml | 14 +++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .github/actions/prepare-ffmpeg-bin/action.yml diff --git a/.github/actions/prepare-ffmpeg-bin/action.yml b/.github/actions/prepare-ffmpeg-bin/action.yml new file mode 100644 index 000000000..76f7d2798 --- /dev/null +++ b/.github/actions/prepare-ffmpeg-bin/action.yml @@ -0,0 +1,23 @@ +name: Prepare FFMPEG_BIN for bun install +description: >- + Copies the system ffmpeg binary to a writable temp location and sets + FFMPEG_BIN in the environment. ffmpeg-static's postinstall script checks + whether a file already exists at FFMPEG_BIN; if it does and process.exit(0) + is respected by the runtime, the CDN download is skipped entirely. If the + runtime intercepts process.exit(0) and the download proceeds anyway, using + a writable target prevents the EACCES failure that occurs when the + destination is a system path like /usr/bin/ffmpeg. + +runs: + using: composite + steps: + - name: Copy ffmpeg to writable path + shell: bash + run: | + FFMPEG=$(which ffmpeg 2>/dev/null || echo "") + if [ -z "$FFMPEG" ]; then + sudo apt-get install -y --no-install-recommends ffmpeg + FFMPEG=/usr/bin/ffmpeg + fi + cp "$FFMPEG" "$RUNNER_TEMP/hf-ffmpeg" + echo "FFMPEG_BIN=$RUNNER_TEMP/hf-ffmpeg" >> "$GITHUB_ENV" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d97e5d8..92993fde1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,6 @@ permissions: # External users' CI continues to emit telemetry unless they set this themselves. env: HYPERFRAMES_NO_TELEMETRY: "1" - # ubuntu-24.04 runners ship with /usr/bin/ffmpeg. Setting FFMPEG_BIN makes - # ffmpeg-static's postinstall script skip its GitHub-release binary download, - # preventing spurious bun-install failures when that CDN is unavailable. - FFMPEG_BIN: /usr/bin/ffmpeg on: pull_request: @@ -71,6 +67,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run build @@ -88,6 +85,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run lint @@ -121,6 +119,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - name: Run fallow audit id: audit @@ -176,6 +175,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run format:check @@ -193,6 +193,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run build - run: bun run --filter '*' typecheck @@ -211,6 +212,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run test:scripts - run: bun run --cwd packages/core build:hyperframes-runtime @@ -230,6 +232,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run --filter @hyperframes/core test:hyperframe-runtime-ci @@ -247,6 +250,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run --cwd packages/core build:hyperframes-runtime - name: Start studio and check for runtime errors @@ -312,6 +316,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 + - uses: ./.github/actions/prepare-ffmpeg-bin - run: bun install --frozen-lockfile - run: bun run build @@ -387,6 +392,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y ffmpeg + - uses: ./.github/actions/prepare-ffmpeg-bin - name: Install dependencies run: bun install --frozen-lockfile - name: Build monorepo From a8b5eea6d20b54585ab5937106b08dabd7138ad0 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Mon, 8 Jun 2026 10:11:54 -0700 Subject: [PATCH 3/3] ci: skip apt fallback in prepare-ffmpeg-bin; use stub when ffmpeg absent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu-24.04 GHA runners do not have ffmpeg pre-installed. The apt-get fallback triggered the install of ffmpeg and its dependencies, but the Azure apt mirror returned 404 for libcaca0, aborting the composite action. ffmpeg-static's postinstall only needs a regular file to exist at FFMPEG_BIN in order to reach the statSync check and call process.exit(0) — it does not need a real executable. Write a minimal shell stub when 'which ffmpeg' returns empty. Jobs that require an actual ffmpeg binary (cli-smoke-required) install it via apt before calling this action, so 'which ffmpeg' returns the real path and the copy branch runs instead. Co-Authored-By: Claude Sonnet 4.6 --- .github/actions/prepare-ffmpeg-bin/action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/actions/prepare-ffmpeg-bin/action.yml b/.github/actions/prepare-ffmpeg-bin/action.yml index 76f7d2798..de6540798 100644 --- a/.github/actions/prepare-ffmpeg-bin/action.yml +++ b/.github/actions/prepare-ffmpeg-bin/action.yml @@ -15,9 +15,14 @@ runs: shell: bash run: | FFMPEG=$(which ffmpeg 2>/dev/null || echo "") - if [ -z "$FFMPEG" ]; then - sudo apt-get install -y --no-install-recommends ffmpeg - FFMPEG=/usr/bin/ffmpeg + if [ -n "$FFMPEG" ]; then + cp "$FFMPEG" "$RUNNER_TEMP/hf-ffmpeg" + else + # ffmpeg not pre-installed; write a stub so ffmpeg-static's postinstall + # finds a file at FFMPEG_BIN and exits early (statSync check) without + # attempting the CDN download. Jobs that need a real ffmpeg binary + # install it via apt before calling this action. + printf '#!/bin/sh\nexec ffmpeg "$@"\n' > "$RUNNER_TEMP/hf-ffmpeg" fi - cp "$FFMPEG" "$RUNNER_TEMP/hf-ffmpeg" + chmod +x "$RUNNER_TEMP/hf-ffmpeg" echo "FFMPEG_BIN=$RUNNER_TEMP/hf-ffmpeg" >> "$GITHUB_ENV"