Skip to content

build(release): LTO dist profile + debug-info sidecars on GitHub releases - #1846

Merged
zackees merged 3 commits into
mainfrom
build/release-lto-debug-sidecars
Nov 2, 2026
Merged

zackees merged 3 commits into
mainfrom
build/release-lto-debug-sidecars

Conversation

@zackees

@zackees zackees commented Nov 1, 2026

Copy link
Copy Markdown
Member

Ports zccache's release size and debug-sidecar pattern to fbuild.

Changes

  • [profile.release]: debug = "line-tables-only", split-debuginfo = "packed". Line tables go into a per-binary sidecar: .dwp on Linux, .dSYM on macOS, .pdb on Windows MSVC.
  • New [profile.dist] (inherits = "release", lto = "fat", codegen-units = 1). Only release-auto.yml uses it, through the new template input cargo_profile: dist. CI and build.yml stay on the fast release profile.
  • template_native_build.yml:
    • New inputs cargo_profile and require_debug_sidecars.
    • New "Install LLVM dSYM tools" step for the Linux→mac cross lanes. rustc runs dsymutil itself at link time when split-debuginfo is packed, which is why this mirrors zccache.
    • Strips with --strip-debug. The cross lanes (aarch64 Linux, both macOS) must use llvm-strip, so macOS binaries are now stripped. A missing strip tool or a failed strip now fails the step instead of being swallowed by || true.
    • New "Stage debug sidecars" step and a separate debug-<target> artifact.
    • Timeouts are wider for dist only: build step 45→100 min, Python extension 30→60, job 90→200, SOLDR_CARGO_WAIT_TIMEOUT_SECS 2700→6000.
  • release-auto.yml:
    • Passes cargo_profile: dist and requires sidecars, except on aarch64-pc-windows-msvc, which only warns (same carve-out as zccache).
    • Packages fbuild-<ver>-<target>-debug.{tar.gz,zip} as GitHub release assets. They are covered by the SHA256SUMS file and the attestation.
    • Runs ci/wheel_check.py on the wheels before the PyPI artifact is uploaded.
  • ci/wheel_check.py (ported from zccache, with tests in ci/test_wheel_check.py):
    • Rejects wheels whose ELF, Mach-O or PE binaries embed debug info.
    • Adds Mach-O STABS debug-map detection, which zccache's __DWARF-only check misses.
    • Budgets: 40 MiB per wheel, 200 MiB per release.

Why fat LTO and not thin

Measured on the Linux fbuild-daemon, stripped:

profile size gzip -9
default release (today) 54.2 MB 20.8 MB
lto = "thin" 55.5 MB 21.5 MB (no gain)
lto = "fat", cgu=1 34.1 MB 13.6 MB

Thin LTO buys nothing, so dist uses fat LTO. Fat LTO costs link time, so it lives in its own profile with wider timeouts instead of slowing every CI build.

Before / after

Before: the published 2.5.49 wheels are 41.0–45.2 MiB each, 214.2 MiB total. uv run --no-project ci/wheel_check.py --pypi 2.5.49 fails: both macOS wheels ship unstripped binaries with STABS debug maps.

After, from a local soldr build --profile dist --target x86_64-unknown-linux-musl -p fbuild-cli -p fbuild-daemon (18m19s wall on a 16-core workstation) followed by strip --strip-debug:

binary stripped gzip -9 sidecar
fbuild 35.7 MB 13.5 MB fbuild.dwp 53.8 MB
fbuild-daemon 38.1 MB 14.5 MB fbuild-daemon.dwp 61.4 MB

That is about 30 MiB per wheel, down from about 42. --strip-debug keeps the symbol table, as zccache does, so backtraces still show function names without the sidecar. That is why the daemon is 38.1 MB here and not the 34.1 MB of a full strip.

Validation

  • Local Linux dist build: done (numbers above). Both .dwp sidecars were produced and the stripped binary runs.
  • uv run --no-project python -m unittest for ci.test_wheel_check, test_rust_toolchain_pins, test_workflow_concurrency, test_no_legacy_cross, test_fractional_workflows, test_publish_quota and test_setup_action: 78 tests pass. Both workflows parse as valid YAML.

Not verified (needs a publish=false release-auto dry run)

  • Cross lanes:
    • Linux→mac: does dsymutil produce the .dSYM at link time, and does llvm-strip --strip-debug handle Mach-O correctly?
    • Linux→MSVC: does lld-link under soldr write fbuild.pdb and fbuild_daemon.pdb?
    • aarch64-musl: does it get its .dwp?
  • Release-lane wall time: fat LTO on 2-core runners with CARGO_BUILD_JOBS=1 has not been measured. The 100-minute step budget is an estimate.
  • soldr's cached rustc may restore a binary without its packed sidecar. zccache has a "repair missing Linux sidecars" rebuild step for this, which this PR does not port. The dry run will show whether it is needed, because the sidecar requirement fails the lane loudly.

…ases

- [profile.release]: debug=line-tables-only, split-debuginfo=packed
- [profile.dist] (release-auto only): fat LTO + codegen-units=1
- template_native_build: cargo_profile/require_debug_sidecars inputs,
  dsymutil for Linux->mac cross, llvm-strip for cross lanes (macOS now
  stripped), loud strip failures, Stage debug sidecars + debug-<target>
  artifact, widened timeouts for dist
- release-auto: dist profile, -debug sidecar assets on the GitHub release,
  ci/wheel_check.py gate before PyPI upload
- ci/wheel_check.py ported from zccache (+ Mach-O STABS detection)
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…ed to produce them

- release-auto: unset matrix key now means required (zccache idiom);
  'x != false' coerced null to false and disabled the check everywhere
- template: soldr's compile cache drops the apple-darwin .dSYM on both
  hit and miss, and post-hoc dsymutil yields a stub (debug map points at
  vanished staging objects). Relink fbuild-cli/fbuild-daemon with
  soldr --no-cache when a sidecar is missing; reject stub dSYMs.
@zackees
zackees added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit bebd679 Nov 2, 2026
28 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 2, 2026
@zackees
zackees deleted the build/release-lto-debug-sidecars branch November 5, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant