Skip to content

ci(esp32): build and link a real bare ESP-IDF app - #5009

Merged
zackees merged 6 commits into
masterfrom
agent/bare-idf-app
Nov 3, 2026
Merged

zackees merged 6 commits into
masterfrom
agent/bare-idf-app

Conversation

@zackees

@zackees zackees commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Adds a real bare ESP-IDF app and validates configuration, compilation and linking without Arduino. The app registers WS2812 LEDs, sets RGB colors and calls FastLED.show() from app_main(). The workflow uses official espressif/idf:v5.5 for esp32, rejects Arduino components, enables FL_NO_ARDUINO, requires ELF/bin output and uploads build evidence.

The real build exposed library defects, now fixed:

  • Global size_t and ptrdiff_t come only from toolchain <stddef.h> and its system guards; FastLED keeps namespace aliases and no longer declares these global types twice.
  • ESP dispatchers use normalized detection, including native IDF's ESP_PLATFORM.
  • The FastLED component declares esp_adc for IDF 5+ and mbedtls; OTA includes its timer API header.
  • ESP32 derives F_CPU from SDK configuration when no explicit override is supplied.
  • Matching master pushes run the existing job, addressing CodeRabbit's original review.

Validation on head 3ac74fb068a24484b063d294f2b43ced13df55ac:

  • Hosted bare-IDF build: SUCCESS, linked ELF and 240,368-byte application .bin, uploaded bare-idf-v5.5-esp32 artifact.
  • Official-image local IDF 5.5/esp32 build: linked successfully, same 240,368-byte .bin.
  • bash test --py: passed (340.86 seconds).
  • bash test --cpp: 329/329 unit targets and 95/95 examples passed.
  • bash lint: passed.
  • bash bare-idf-probe: 36/36 passed, zero offenders.
  • 159 focused include-order, platform/CPU configuration, component selection and README-badge tests passed; independent code review clean.

The app and its CI compile/link checks retain their semantics; no workaround definitions or disabled checks hide library failures. Only IDF 5.5/esp32 is validated here. Other versions/chips and hardware execution remain unverified.

Related to #3724; completes the real build/link evidence in step 4. Leave this non-draft PR unmerged as requested.

@zackees zackees added the ci-platform:esp32dev_idf5_component Select FastLED board CI cells label Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

This change adds a bare ESP-IDF application and a workflow for ESP-IDF 5.5 on ESP32. It updates ESP32 platform detection and component requirements. It also changes FastLED size-type declarations and adds compile tests for header include order.

Changes: Bare ESP-IDF CI

Layer / File(s) Summary
ESP-IDF platform and component support
src/platforms/esp/is_esp.h, src/platforms.h, src/led_sysdefs.h, src/platforms/int.h, src/platforms/esp/32/core/led_sysdefs_esp32.h, src/platforms/esp/32/ota/ota_impl.cpp.hpp, CMakeLists.txt, ci/tests/test_bare_idf_cmake.py, ci/tests/test_esp_noexcept.py
ESP32 detection and header selection now use FastLED platform macros. The ESP32 sysdefs add a guarded F_CPU fallback from ESP-IDF configuration. Component requirements and related tests include mbedtls and esp_adc.
ESP-IDF application and component boundary
ci/idf_app/CMakeLists.txt, ci/idf_app/main/*, ci/idf_app/.gitignore, ci/idf_app/README.md, bare-idf-probe, ci/bare_idf_probe.py
The project configures the checkout as an ESP-IDF project and rejects resolved component names containing “Arduino.” The app registers FastLED as a requirement and adds an app_main example that configures and displays three WS2812 LEDs. The probe runs as a Python module. The README describes the harness, build setup, and validation limits.
Workflow build and artifact handling
.github/workflows/build_bare_idf.yml, README.md
The workflow adds dispatch, push, and pull-request triggers, build conditions, and an ESP-IDF 5.5/ESP32 build. It checks the ELF and BIN outputs, reports BIN size, and uploads build and diagnostic artifacts. The repository README links to the workflow.

Size-type header consistency

Layer / File(s) Summary
Size-type aliases and header integration
src/fl/stl/cstddef.h, src/fl/stl/stdint.h, ci/lint_cpp_rs/src/lint_core/banned_header_data.rs
fl::size_t and fl::ptrdiff_t now alias the global types supplied by <stddef.h>. stdint.h includes the cstddef wrapper and removes its duplicate aliases. The header lint exception allows <stddef.h> in that wrapper.
Include-order compile validation
ci/tests/test_size_type_include_order.py, ci/tests/test_esp32_user_app_main.py
A new compile test checks all permutations of three size-type headers under native and supported 32-bit compiler arguments. The existing ESP32 preprocessing test changes only its formatting.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as build_bare_idf workflow
  participant Docker as ESP-IDF Docker image
  participant App as ci/idf_app
  participant Artifacts as workflow artifacts
  Workflow->>Docker: build ci/idf_app for ESP32
  Docker->>App: compile and link application
  App-->>Workflow: provide ELF and BIN outputs
  Workflow->>Artifacts: upload build outputs
Loading

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#5008 — This PR updates the probe and component requirements introduced in #5008, and uses its FL_NO_ARDUINO contract in a bare ESP-IDF application.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding CI coverage to build and link a real bare ESP-IDF application.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 15 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 30cec2e and 3ac74fb.

Files selected for processing: 11
  • CMakeLists.txt
  • README.md
  • ci/idf_app/README.md
  • ci/tests/test_bare_idf_cmake.py
  • ci/tests/test_esp_noexcept.py
  • src/led_sysdefs.h
  • src/platforms.h
  • src/platforms/esp/32/core/led_sysdefs_esp32.h
  • src/platforms/esp/32/ota/ota_impl.cpp.hpp
  • src/platforms/esp/is_esp.h
  • src/platforms/int.h
Files skipped from review as they are similar to previous changes: 1
  • ci/idf_app/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

coderabbitai[bot]
coderabbitai Bot previously requested changes Nov 3, 2026

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .github/workflows/build_bare_idf.yml Resolved
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, 0 is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (0) 136 (0)
esp32dev 287,675 (0) 18,651 (0)
esp32s3 320,459 (0) 22,451 (0)
esp8266 264,671 (0) 6,808 (0)

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .github/workflows/build_bare_idf.yml Resolved
@zackees

zackees commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Both findings are about the push trigger keeping master CI red, which is no longer true: after the header-conflict fix (src/fl/stl/cstddef.h / stdint.h) the job now links and produces firmware.

Evidence from the latest run (41628653341, job 125892646646):

Bare IDF v5.5 / esp32: 240368 bytes
upload-artifact: ci/idf_app/build/fastled_bare_idf.bin

So the push trigger is now the regression guard that proves a bare-IDF app keeps building on master - keeping it. No code change made for these two comments.

@zackees
zackees dismissed coderabbitai[bot]’s stale review November 3, 2026 11:42

Findings answered in a PR comment: the push trigger is now green (bare-IDF app links, 240368-byte .bin).

@zackees
zackees merged commit 327fdcb into master Nov 3, 2026
130 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-platform:esp32dev_idf5_component Select FastLED board CI cells

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant