Skip to content

fix: restore ESP32 SD file noexcept compatibility - #4828

Merged
zackees merged 1 commit into
masterfrom
fix/sd-noexcept-4826
Oct 13, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/sd-noexcept-4826

Conversation

@zackees

@zackees zackees commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #4826.

ESP32 builds with the Arduino SD backend enabled fail in FastLED 3.10.7 because four error-method overrides in each of SDFileHandle and SdFatFileHandle omit the FL_NO_EXCEPT contract required by filebuf. Add the eight missing annotations without changing method behavior.

The regression came from #4774: FL_NO_EXCEPT became real noexcept on ESP and the base methods were annotated, but these conditional implementations were missed. Dependency discovery can enable SD even for a sketch that only uses LEDs. Native filesystem tests use the host backend; the AST checker also lacks these SDK headers. Two new compiler regressions extract the actual override declarations from both implementations and check them against the real base class, including completeness, without requiring SDK downloads in Python CI.

Validation:

  • Both new tests fail with the original declarations and pass with the fix; the full test_esp_noexcept module passes.
  • Real SDK compilation of both SD and SdFat branches: original fails / fixed passes with GCC 8.4 + Arduino ESP32 2.0.3 and GCC 14.2 + Arduino ESP32 3.3.11. Probes require the actual backend type, so an excluded branch cannot pass.
  • The reporter's unchanged sketch builds and links for LOLIN D32 using espressif32 6.13.0, Arduino ESP32 2.0.17, and GCC 8.4 patch5. Restoring the original header reproduces all four reported errors; reapplying the fix succeeds (522806 B flash, 30392 B RAM).
  • bash test --cpp: 320/320 unit tests and 96/96 examples pass. bash lint and repository code review pass.

Target validation ran on Linux via fbuild. A scratch fs.h forwarding to SDK FS.h emulates Windows case-insensitive lookup, and explicit SDK FS include paths/sources compensate for fbuild's omitted dependency. No Windows execution or physical hardware run is claimed.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a compile-time compatibility issue affecting both Arduino SD backends.
  • Tests
    • Added compile-time checks to verify the SD backends’ error-handling methods compile correctly.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a3621b4-1e28-4bfb-90f6-07994fcc0d3c
📥 Commits

Reviewing files that changed from the base of the PR and between 6062bee and 6bd941a.

📒 Files selected for processing (3)
  • agents/tasks/todo.md
  • ci/tests/test_esp_noexcept.py
  • src/fl/fs/sd/fs_sdcard_arduino.cpp.hpp

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

📝 Walkthrough

The Arduino SD file-handle overrides now declare FL_NO_EXCEPT, matching the base-class exception contract. A compile-time regression test checks both backends. The tracker records validation results and limits.

Changes: Arduino SD exception contract

Layer / File(s) Summary
Annotate SD error overrides
src/fl/fs/sd/fs_sdcard_arduino.cpp.hpp
The eight error overrides in SDFileHandle and SdFatFileHandle add FL_NO_EXCEPT. Their return values and behavior are unchanged.
Check override compatibility
ci/tests/test_esp_noexcept.py, agents/tasks/todo.md
A compile-time test checks both backends against the filebuf exception contract. The tracker records validation results, including that Windows execution and physical hardware testing were not performed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6bd94

The change addresses the reported ESP32 SD compile issue, with regression coverage for both backends; no actionable merge risk remains.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. (1 skipped: … 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 is concise, specific, and accurately describes the main change: restoring ESP32 SD file noexcept compatibility.
Linked Issues check Passed Issue #4826 requires the ESP32 Arduino SD build to compile after the FL_NO_EXCEPT mismatch. The PR adds FL_NO_EXCEPT to all four error overrides in both SDFileHandle and SdFatFileHandle. The n…
Out of Scope Changes check Passed The production diff only changes the eight affected exception specifications. The new test directly prevents regression of issue #4826 for both backends. The added tracker entry documents the same reg…
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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

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

@zackees
zackees merged commit f09d68c into master Oct 13, 2026
120 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Oct 13, 2026
@zackees
zackees deleted the fix/sd-noexcept-4826 branch November 5, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3.10.7 does not compile my simple sketch in Platformio

1 participant