Skip to content

fix(esp32): drop dangling -specs paths baked into an SDK's ld_flags (red ESP32-C2 main) - #2102

Merged
zackees merged 1 commit into
mainfrom
agent/c2-dangling-specs
Nov 19, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/c2-dangling-specs

Conversation

@zackees

@zackees zackees commented Nov 19, 2026

Copy link
Copy Markdown
Member

What

Build ESP32-C2 is red on main (run 44512457992 on 3199f00c), and the cause is a flag in the shipped SDK:

riscv32-esp-elf-gcc: fatal error: cannot read spec file
'/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/build/specs/nano.specs': No such file or directory

pioarduino's c2-skeleton package ships esp32c2/flags/ld_flags with that lib-builder absolute path baked in, so no consumer machine can link. The same esp32-arduino-libs 4.0.0 release carries no -specs entry for esp32c3/esp32c6, and the paired SDK is ESP-IDF 6.1 whose default libc is picolibc — newlib-nano specs do not apply there anyway.

Change

fixups::effective_sdk_ld_flags drops a -specs= / --specs= entry only when it names an absolute path that does not exist on this machine. Relative spec names and real local absolute paths pass through untouched. Both call sites in orchestrator/build.rs already go through this function.

Verification

  • soldr cargo test -p fbuild-build-esp --lib esp32::fixups — 15 passed / 0 failed, incl. two new tests (dangling_absolute_specs_are_dropped, existing_absolute_specs_and_relative_specs_survive).
  • soldr cargo clippy -p fbuild-build-esp --all-targets --no-deps -- -D warnings — clean; cargo fmt --check clean.
  • End-to-end on the failing configuration: fbuild build tests/platform/esp32c2 -e esp32c2 --quick with platform-espressif32@stable → [email protected], ESP-IDF SDK=6.1.0. Before the fix the same command reproduced the CI error verbatim; after it: build succeeded in 3.6s (flash: 244337 bytes, ram: 12952 bytes), zero nano.specs mentions in the log. A 3.3.12 build (no baked flag) still succeeds, so the 3.x path is untouched.

No issue is closed by this PR.

pioarduino's ESP32-C2 skeleton ships flags/ld_flags generated on the
lib-builder host, so it carries that host's absolute path:

  --specs=/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/build/specs/nano.specs

GCC then fails every ESP32-C2 link with "cannot read spec file" and the
Build ESP32-C2 workflow is red (run 44512457992 on 3199f00). The flag is
stale in two ways: the path cannot exist outside the builder, and the
paired SDK is ESP-IDF 6.1, whose default libc is picolibc - newlib-nano
specs do not apply. The sibling targets (esp32c3/esp32c6) carry no specs
entry at all in the same libs release.

effective_sdk_ld_flags now drops a -specs=/--specs= entry only when it
names an absolute path that does not exist, so a relative spec name or a
real local absolute path is passed through untouched.
@coderabbitai

coderabbitai Bot commented Nov 19, 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

@zackees
zackees added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit e144f86 Nov 19, 2026
38 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 20, 2026
@zackees
zackees deleted the agent/c2-dangling-specs branch November 24, 2026 21:36
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