Skip to content

ESP8266 build broken: SPI.h pulled in unconditionally via spi_output_template dispatch #2569

Closed

Description

@zackees

Symptom

Every ESP8266 CI build (esp8622 workflow) on master is failing with:

fastspi_esp8266.h:7:10: fatal error: SPI.h: No such file or directory

Every example fails the same way (AnalogOutput, Apa102, Blink, Blur, …). Reproducible run: https://github.com/FastLED/FastLED/actions/runs/26677701904

Root cause

src/platforms/spi_output_template.h (the dispatch header that chipsets.h includes unconditionally) currently routes ESP8266 to the platform SPI implementation without the FASTLED_ALL_PINS_HARDWARE_SPI guard:

#elif defined(FL_IS_ESP8266)
#include "platforms/esp/8266/spi_output_template.h"

platforms/esp/8266/spi_output_template.h unconditionally includes fastspi_esp8266.h, which unconditionally does #include <SPI.h> (Arduino library). The ESP8266 PlatformIO env doesn't list SPI in lib_deps, so the include resolves to nothing → fatal error.

How the guard was lost

Prior to commit 8d524accd (refactor(spi): centralize platform-specific SPI dispatch, 2026-01-16), fastled_esp8266.h controlled the include itself:

#ifdef FASTLED_ALL_PINS_HARDWARE_SPI
#include "platforms/esp/8266/fastspi_esp8266.h"
#endif

When the dispatch was centralized into platforms/spi_output_template.h, the Apollo3 path kept its FASTLED_ALL_PINS_HARDWARE_SPI guard:

#elif defined(FL_IS_APOLLO3) && defined(FASTLED_ALL_PINS_HARDWARE_SPI)

…but the ESP8266 path did not. With chipsets.h pulling the dispatch in for every build, ESP8266 now always drags in <SPI.h>.

Affected jobs

  • esp8622 (every example build)

Proposed fix

Add the same guard to the ESP8266 dispatch line and let the bitbang fallback handle the default case. One-line change in src/platforms/spi_output_template.h:

#elif defined(FL_IS_ESP8266) && defined(FASTLED_ALL_PINS_HARDWARE_SPI)
#include "platforms/esp/8266/spi_output_template.h"

ESP8266 builds without FASTLED_ALL_PINS_HARDWARE_SPI then fall through to platforms/shared/spi_bitbang/spi_output_template.h, matching pre-8d524accd behavior. Users who do define the macro continue to get hardware SPI (and bring their own lib_deps = SPI).

Repro

Any ESP8266 build of a stock example: bash compile esp8266 --examples Blink.


Filed automatically while triaging broken builds; intent is to fix and open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions