Symptom
FastLED's clone and compile job, which runs fbuild build on the root project (src_dir = examples/Sailboat, default_envs = esp32s3), has failed on every master run since it switched to fbuild (e.g. FastLED/FastLED run 35323494299):
.fbuild/build/esp32s3/release/src/Sailboat.ino.cpp:3:10: fatal error: Audio.h: No such file or directory
Cause
The sketch includes a Teensy-only header behind a guard:
#include <FastLED.h>
#if defined(FL_IS_TEENSY)
#include <Audio.h>
#endif
fbuild 2.5.23 generates this Sailboat.ino.cpp, with every #include lifted above the #line directive and the #if dropped:
#include <Arduino.h>
#include <FastLED.h>
#include <Audio.h> // <- was inside #if defined(FL_IS_TEENSY)
#include "fl/channels/config.h"
...
#line 1 "Sailboat/Sailboat.ino"
So the include is compiled unconditionally on esp32s3, where the PJRC Audio library does not exist.
Expected
Match arduino-cli / arduino-builder: leave the sketch's #include lines where they are, inside their preprocessor conditionals, and insert only #include <Arduino.h> and the generated prototypes. Prototypes go after the last include, like the fix for #1196 / #1275.
Scope
About ten FastLED examples use a platform-guarded #include in the .ino (Audio, AudioReactive, AudioUrl, BeatDetection, ElPanelReactive, Animartrix, Sailboat, AudioInput, SmartMatrix, AutoResearch). Any of them fails as the root src_dir. FastLED's own example sweep is unaffected, because it wraps the sketch in a generated main.cpp that #includes the .ino and so never goes through this conversion.
Repro
git clone https://github.com/FastLED/FastLED && cd FastLED
fbuild build # platformio.ini: src_dir = examples/Sailboat, default_envs = esp32s3
🤖 Generated with Claude Code
Symptom
FastLED's
clone and compilejob, which runsfbuild buildon the root project (src_dir = examples/Sailboat,default_envs = esp32s3), has failed on every master run since it switched to fbuild (e.g. FastLED/FastLED run 35323494299):Cause
The sketch includes a Teensy-only header behind a guard:
fbuild 2.5.23 generates this
Sailboat.ino.cpp, with every#includelifted above the#linedirective and the#ifdropped:So the include is compiled unconditionally on esp32s3, where the PJRC Audio library does not exist.
Expected
Match arduino-cli / arduino-builder: leave the sketch's
#includelines where they are, inside their preprocessor conditionals, and insert only#include <Arduino.h>and the generated prototypes. Prototypes go after the last include, like the fix for #1196 / #1275.Scope
About ten FastLED examples use a platform-guarded
#includein the.ino(Audio, AudioReactive, AudioUrl, BeatDetection, ElPanelReactive, Animartrix, Sailboat, AudioInput, SmartMatrix, AutoResearch). Any of them fails as the rootsrc_dir. FastLED's own example sweep is unaffected, because it wraps the sketch in a generatedmain.cppthat#includes the.inoand so never goes through this conversion.Repro
🤖 Generated with Claude Code