Skip to content

fbuild-python DaemonConnection drops PLATFORMIO_SRC_DIR so FastLED autoresearch builds the wrong sketch #274

Description

@zackees

Tracked from FastLED/FastLED#2510.

Symptom

On the ESP32-P4-EV autoresearch path, FastLED sets PLATFORMIO_SRC_DIR=examples/AutoResearch before calling into fbuild-python via connect_daemon(...).deploy(...). The daemon build/deploy request sent by the Python binding does not include src_dir, so the daemon falls back to platformio.ini's default src_dir = examples/Sailboat and autoresearch fails before it can flash/run the AutoResearch firmware.

Observed locally from C:/Users/niteris/dev/fastled7:

bash autoresearch esp32p4 --parlio --skip-lint --timeout 120
...
[fbuild] operation failed: build error: build failed: compilation failed for
C:\Users\niteris\dev\fastled7\.fbuild\build\esp32p4\release\src\Sailboat.ino.cpp:
.fbuild/build/esp32p4/release/src/Sailboat.ino.cpp:1:10: fatal error: Arduino.h: No such file or directory

The fbuild CLI path does work when the same env var is forwarded:

$env:PLATFORMIO_SRC_DIR=(Resolve-Path examples\AutoResearch).Path
.\.venv\Scripts\fbuild.exe . build -e esp32p4 -v

That produces AutoResearch.ino_*, AutoResearchRemote_*, etc. under .fbuild/build/esp32p4/release/src/, confirming that the daemon/build side can honor src_dir when it receives it.

Root cause

The Rust CLI forwards PLATFORMIO_SRC_DIR into BuildRequest/DeployRequest.src_dir, but the PyO3 DaemonConnection/AsyncDaemonConnection request model omits src_dir entirely. FastLED's autoresearch wrapper uses the Python binding path, so the caller env override is lost.

Expected fix

Forward the caller's PLATFORMIO_SRC_DIR through fbuild-python build/deploy requests, preferably by adding src_dir to the shared OpRequest and populating it from std::env::var(PLATFORMIO_SRC_DIR) when non-empty. Keep existing Python signatures backwards compatible.

Done

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