Skip to content

ESP32 compile on Windows: 'Cannot create temporary file in C:\Windows\' — uncovered tempfile callsite #875

Description

@zackees

Symptom

bash compile esp32s3 --examples Blink (or any ESP32-family compile) fails on Windows with:

build error: build failed: compilation failed for
  C:\Users\niteris\.fbuild\prod\cache\platforms\framework-arduinoespressif32\9ef436ac06b7bf7f\3.3.7\esp32-core-3.3.7\cores\esp32\FunctionalInterrupt.cpp:
  Cannot create temporary file in C:\Windows\: Permission denied

Then:

ERROR fbuild::output: …
running-process broker: direct daemon fallback (failed to connect to broker: The system cannot find the file specified. (os error 2))

Environment

  • fbuild 2.3.14 (latest, pinned in FastLED pyproject.toml)
  • Windows 10 Pro 19045
  • Invoked from C:\Users\niteris\dev\fastled (writable user dir)
  • Toolchain: xtensa-esp-elf-gcc 14.2.0

Diagnosis

The compiler subprocess is being launched with cwd = C:\Windows\ (or with TMP / TEMP unset, so the compiler's default-tempfile path falls back to the cwd, which on the system PATH ends up being C:\Windows\). Either way, the compiler tries to write a temp object/preprocess file there, hits ACL denial, and bails before producing output.

PR #850 (fix(tempfile): root 4 production callers via fbuild_paths::temp_subdir) routed four production callers through fbuild_paths::temp_subdir. This particular path — the per-source compile subprocess spawn during ESP32 framework-library compilation — is evidently not one of the four covered callers.

Repro

git clone https://github.com/FastLED/FastLED
cd FastLED
# pyproject.toml already pins fbuild 2.3.14
uv sync
bash compile esp32s3 --examples Blink

Ask

  1. Confirm whether the per-source compile spawn in the ESP32 orchestrator (crates/fbuild-build/src/esp32/orchestrator.rs or wherever the per-.cpp invocation lives) inherits a writable cwd / TEMP env.
  2. Extend the fbuild_paths::temp_subdir rooting to that spawn site.
  3. Set TMP/TEMP in the subprocess env explicitly to fbuild_paths::temp_subdir().as_os_str() so the compiler's default-tempfile path can't fall back to cwd.

This blocks all ESP32-family local compile on Windows for the FastLED dev pass, including hardware validation of the in-flight bus enum migration (#3439).

Workarounds tried

  • Re-running with the daemon down (fbuild daemon stop) — same error.
  • Setting TMP / TEMP in the parent shell — propagates one level but the compiler subprocess still fails the same way.

Related: zackees/soldr#1105 (MSVC LIB auto-injection) is a sister Windows-toolchain ergonomics issue but separate root cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions