slint-ui/slint · warning

idf.py not found, skipping ESP32-P4 home-automation (needs…

Error message

idf.py not found, skipping ESP32-P4 home-automation (needs an ESP-IDF >= 6.0 env)

What it means

build_p4 builds the ESP32-P4 home-automation demo image using ESP-IDF's idf.py. If idf.py is not found on PATH, the script warns 'idf.py not found, skipping ESP32-P4 home-automation (needs an ESP-IDF >= 6.0 env)' and returns empty results so the run continues producing the MCU images. This is an intentional soft-skip: ESP-IDF is treated as an optional prerequisite.

Solutions

  1. Install ESP-IDF >= 6.0 and source its export.sh so idf.py is on PATH
  2. Run the build inside an activated ESP-IDF environment (idf_env)
  3. Ignore the warning if ESP32-P4 images are not needed — the rest of the build still completes
  4. Verify installation: which idf.py && idf.py --version

Example fix

# before
./scripts/build-demo-images.py   # idf.py not found, skipping ESP32-P4...
# after
. ~/esp/esp-idf/export.sh && ./scripts/build-demo-images.py
Defensive patterns

Strategy: fallback

Validate before calling

import shutil
if not shutil.which("idf.py"):
    print("ESP-IDF missing: P4 image will be skipped")

Prevention

When it happens

Trigger: Running scripts/build-demo-images.py on a machine where idf.py (from ESP-IDF >= 6.0) is not installed or its environment (idf_env exports) has not been sourced, so shutil.which('idf.py') returns None.

Common situations: Building only MCU images on a dev box without ESP-IDF; forgetting to run the ESP-IDF export script before the build; having an older ESP-IDF version installed whose environment isn't activated.

Related errors


AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16). Data as JSON: /api/errors/746d5ab8c77cf537. Report an issue: GitHub.

Appendix: source

Thrown at scripts/build-demo-images.py:300

            {
                "feature": board.feature,
                "name": board.name,
                "method": board.method,
                "file": board.image_name,
                "chip": board.chip,
                "offset": "0x0" if board.method == "esp" else "",
                "demo": DEFAULT_DEMO,
            }
        )
    return records, failed


def build_p4(out: Path) -> tuple[list[dict], list[str]]:
    directory = ROOT / "demos/home-automation/esp-idf"
    image = "home-automation-esp32-p4.bin"
    if not shutil.which("idf.py"):
        # ESP-IDF is an optional prerequisite: a plain run still produces the MCU images.
        warn(
            "idf.py not found, skipping ESP32-P4 home-automation (needs an ESP-IDF >= 6.0 env)"
        )
        return [], []
    log("home-automation: ESP32-P4 (ESP-IDF)")
    env = idf_env()
    try:
        run(["idf.py", "set-target", "esp32p4"], cwd=directory, env=env)
        run(["idf.py", "build"], cwd=directory, env=env)
        # Merge the built artifacts directly (idf.py merge-bin re-runs the build and trips
        # the esp Rust toolchain; build/flash_args has the offsets).
        run(
            [
                "python",
                "-m",
                "esptool",
                "--chip",
                "esp32p4",
                "merge_bin",

View on GitHub (pinned to bb937076de)