Skip to content

fix(build): fail oversize images, compile only reached lib/ libraries, warn on ignored version pins - #1473

Merged
zackees merged 3 commits into
mainfrom
fix/stevenmunn-issues-1407-1409-1410
Sep 26, 2026
Merged

zackees merged 3 commits into
mainfrom
fix/stevenmunn-issues-1407-1409-1410

Conversation

@zackees

@zackees zackees commented Sep 26, 2026

Copy link
Copy Markdown
Member

Fixes #1407, fixes #1409, fixes #1410.

#1409 — oversize firmware exited 0

  • Linker::link_all calls enforce_size_limits after sizing, on both the fresh-link and the skip-relink path. Flash over the board maximum fails the build with PlatformIO's checkprogsize wording.
  • RAM over the maximum is fatal on AVR (AvrLinker::ram_overflow_is_fatal), where data + bss is exactly the single SRAM, matching arduino-cli. Elsewhere it is a Warning! line in the size report, as in PlatformIO, because data + bss over-counts on multi-region MCUs (Teensy 4 DMAMEM/EXTMEM).
  • bloat_analysis builds (--noinhibit-exec) still accept oversize images, since that mode exists to analyze them.
  • ESP32 checks against the app partition from the resolved partitions CSV (factory, else ota_0), the way PlatformIO's espressif32 builder does. Most ESP32 board JSONs carry the chip flash size, and a few carry odd values (for example weactstudio_esp32c3coreboard: 393216). max_flash still drives esptool --flash-size, so this uses a separate with_app_size_limit.

#1410 — every lib/ library was compiled

  • New framework_libs::select_local_libraries runs the LDF walk from project translation units over lib/*, following library-to-library edges. lib_deps names force selection (new fbuild_library_select::resolve_declared).
  • The walk is textual (every #if arm is scanned). The active scan treats compiler builtins (__XTENSA__, __AVR__) as defined nowhere and could drop a library the compiler includes. The textual walk can only over-select, and over-selecting is what the old behavior did for every library.
  • The generic pipeline and the ESP32 pipeline both compile only the selection. Framework-library seeding also uses only the selected local libraries, so "what compiles is what seeds" still holds. When there is no src/, the sketch-root walk no longer seeds from lib/.

#1407 — version pins were ignored silently

  • fbuild_config::ignored_version_pins flags platform = name@version and bare platform_packages = name@version entries. BuildContext writes them to the build output. The existing ESP32 warning only reached the daemon log via tracing. Each warning names the URL form that is honored.

Validation

  • Unit tests: SizeInfo::{flash,ram}_overflow, enforce_size_limits, partition CSV parsing, ignored_version_pins, and six local-lib selection cases (the report's layout, a transitive local lib, a builtin-macro guard, lib_deps, a sketch at the project root, and an unselected lib not seeding framework selection). bash test passes and clippy -D warnings is clean.
  • End-to-end with the built CLI (FBUILD_DEV_MODE=1):

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ccd84fe3-690f-4257-bb53-d61dbdacaf48

📥 Commits

Reviewing files that changed from the base of the PR and between 1c0ebfa and 82171de.

📒 Files selected for processing (18)
  • .github/workflows/check-ubuntu.yml
  • crates/fbuild-build-engine/src/build_output.rs
  • crates/fbuild-build-engine/src/framework_libs.rs
  • crates/fbuild-build-engine/src/framework_libs_local_tests.rs
  • crates/fbuild-build-engine/src/linker.rs
  • crates/fbuild-build-engine/src/pipeline/compile.rs
  • crates/fbuild-build-engine/src/pipeline/context.rs
  • crates/fbuild-build-engine/src/pipeline/sequential.rs
  • crates/fbuild-build-esp/src/esp32/esp32_linker.rs
  • crates/fbuild-build-esp/src/esp32/orchestrator/boot_artifacts.rs
  • crates/fbuild-build-esp/src/esp32/orchestrator/build.rs
  • crates/fbuild-build-esp/src/esp32/orchestrator/local_libs.rs
  • crates/fbuild-build-mcu/src/avr/avr_linker.rs
  • crates/fbuild-config/src/lib.rs
  • crates/fbuild-config/src/platform_packages.rs
  • crates/fbuild-core/src/lib.rs
  • crates/fbuild-library-select/src/lib.rs
  • docs/architecture/library-selection.md

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.

…, warn on ignored version pins

Fixes #1407, #1409, #1410.

#1409: an image that cannot fit the target linked and exited 0 (Uno at
135% flash / 2059% RAM). `Linker::link_all` now fails when flash exceeds
the board maximum (PlatformIO `checkprogsize` / arduino-cli semantics) on
both the fresh-link and skip-relink paths. RAM overflow is fatal on AVR,
where data+bss is exactly its single SRAM, and a visible warning elsewhere
(multi-region MCUs over-count). Bloat analysis keeps accepting oversize
images. ESP32 checks against the app partition from the partitions CSV
(factory, else ota_0), as PlatformIO does, instead of the chip flash size
most ESP32 board JSONs carry.

#1410: every lib/ directory was compiled regardless of includes, so a
SAMD-only library broke AVR builds. `select_local_libraries` runs the LDF
walk (textual, so compiler-builtin guards cannot drop a needed library)
from project sources; lib_deps names force selection. Both the generic
and ESP32 pipelines compile only the selection, and only selected local
libraries seed framework-library selection.

#1407: `platform = name@version` and bare `platform_packages` version pins
were dropped silently. They now produce a warning in the build output
naming the ignored pin and the URL form that is honored.
The guards triggered an editable build of fbuild through its pinned soldr
build backend, whose daemon collided with the newer broker setup-soldr
started, failing ci-minimal on main and every PR.
@zackees
zackees force-pushed the fix/stevenmunn-issues-1407-1409-1410 branch from 03cbdc5 to 82171de Compare September 26, 2026 08:56
@zackees
zackees merged commit ae0cf3a into main Sep 26, 2026
17 checks passed
@zackees
zackees deleted the fix/stevenmunn-issues-1407-1409-1410 branch September 26, 2026 09:10
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

1 participant