Skip to content

ci(build_template): cap Symbol Analysis + Optimization Report at 5 min - #2655

Merged
zackees merged 1 commit into
masterfrom
fix/2641-cap-postbuild-step-timeout
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2641-cap-postbuild-step-timeout

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Add timeout-minutes: 5 to the Symbol Analysis and Optimization Report steps in build_template.yml. Both are post-build analysis already marked continue-on-error: true, so they should never turn a green build red — but a hang in either script currently kills the entire runner.

Why

xiaoblesense_adafruit post-merge run 26700835813 succeeded at every compile step (all 65 example builds green — variant.h / PCA10056 / LTO fixes from #2636 / #2638 / #2642 all worked) but the runner was killed at 04:20 after ci/optimization_report.py --first produced no log output for 37 minutes. The underlying script bug (likely fbuild vs PIO artifact-path divergence — readelf/nm/objdump returned exit 1 on the firmware.elf earlier in the same run) is filed separately.

A 5-minute timeout keeps the analysis steps from hanging the job; the build itself still passes when they get skipped.

Refs #2641.

Test plan

  • Next push to master with a successful build matrix shows Optimization Report either completes within 5 min or is marked timed-out without failing the job.
  • build_xiaoblesense_adafruit workflow goes green post-merge.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated workflow configuration to add timeout limits to analysis steps, improving build efficiency and resource management during the deployment process.

xiaoblesense_adafruit post-merge run 26700835813 succeeded at every
compile step (all 65 example builds green — the variant.h / PCA10056 /
LTO fixes from #2636 / #2638 / #2642 all worked) but the runner was
killed 37 minutes after the last log line during the Optimization Report
step (`uv run ci/optimization_report.py --first`).

Both Symbol Analysis and Optimization Report are post-build analysis
steps already marked `continue-on-error: true`, so they should never
turn a green build red. A 5-minute `timeout-minutes` cap keeps them from
hanging the entire job when a downstream script (e.g. fbuild vs PIO
artifact-path divergence — readelf/nm/objdump returned exit 1 on the
firmware.elf earlier in the same run) gets stuck in a wait loop. The
build itself still passes; the report is just skipped for that run.

Filed the underlying optimization_report.py / symbol_analysis_runner.py
fbuild-path bug separately for proper investigation.

Refs #2641.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@zackees
zackees merged commit 7d834f2 into master May 31, 2026
3 of 4 checks passed
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a225bfc-3cd9-4894-bbe2-31410131fc4f

📥 Commits

Reviewing files that changed from the base of the PR and between 715b73a and 6ecece2.

📒 Files selected for processing (1)
  • .github/workflows/build_template.yml

📝 Walkthrough

Walkthrough

This pull request adds timeout-minutes: 5 to two steps (Symbol Analysis and Optimization Report) in the GitHub Actions build workflow. Both steps retain their existing if: always() and continue-on-error: true conditions while now being limited to 5-minute execution times.

Changes

CI Step Timeout Configuration

Layer / File(s) Summary
Step timeout limits
.github/workflows/build_template.yml
Symbol Analysis and Optimization Report steps are each configured with a 5-minute execution timeout while maintaining their existing always-run and continue-on-error settings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • FastLED/FastLED#2298: Also adjusts GitHub Actions timeout-minutes in workflow configurations to cap CI execution times.

Poem

A rabbit hops through workflows keen,
With timeouts set to five, pristine,
No more the endless wait and weep,
These steps now take their bounded leap! 🐰⏱️

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2641-cap-postbuild-step-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

zackees added a commit that referenced this pull request May 31, 2026
…alive (#2658)

* ci(optimization-report): cap stdout dump at 1 MiB to keep GHA runner alive

With `-fopt-info-all` applied across the full example matrix (~110
sketches on nrf52840_dk + Adafruit BSP boards), the per-board
optimization_report.txt routinely exceeds 100 MB. The Optimization
Report step in build_template.yml prints the entire file to the GitHub
Actions log, which overruns the runner's log-buffer limit and triggers
an external shutdown signal — see master CI for nrf52840_supermini
(run 26705682359) and adafruit_feather_nrf52840_sense (run 26705682371)
where the build step succeeded but Optimization Report cancelled at
~37s with the runner dying mid-step, leaving downstream cleanup steps
unrun and the workflow marked FAILURE despite the build being green.

Default to printing the LAST 1 MiB of the report (most-recently emitted
optimizer info, which is what's most useful for size-driven debugging),
with a `--max-bytes 0` escape hatch for the rare local case where the
full dump is desired. Snap the tail to the next line boundary so we
don't lead with a truncated half-line, and announce up front how many
bytes were elided.

Refs #2641, #2653. Counterpart to #2655 (which added timeout-minutes:5
to the Symbol Analysis + Optimization Report steps but couldn't help
when the runner shutdown comes faster than the step timeout).

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(optimization_report): env-var override + doc artifact-upload follow-up

Address review feedback:
- Allow FL_OPT_REPORT_MAX_BYTES env var to override the 1 MiB default so
  devs can bump it locally without editing the script. `0` disables the
  cap. The --max-bytes CLI flag still wins.
- Document the durable fix (upload optimization_report.txt as a build
  artifact + print only a summary) as a follow-up so this PR remains a
  focused stop-gap.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(optimization_report): inject argv into parse_args per repo contract

Address CodeRabbit comment on PR #2658: make parse_args / main accept
an optional argv list[str] | None so tests can supply arguments
deterministically.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
@zackees
zackees deleted the fix/2641-cap-postbuild-step-timeout branch August 21, 2026 19:15
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