{"record":{"id":"746d5ab8c77cf537","repo":"slint-ui/slint","slug":"idf-py-not-found-skipping-esp32-p4-home-automation-needs-an","errorCode":null,"errorMessage":"idf.py not found, skipping ESP32-P4 home-automation (needs an ESP-IDF >= 6.0 env)","messagePattern":"idf\\.py not found, skipping ESP32-P4 home-automation \\(needs an ESP-IDF >= 6\\.0 env\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/build-demo-images.py","lineNumber":300,"sourceCode":"            {\n                \"feature\": board.feature,\n                \"name\": board.name,\n                \"method\": board.method,\n                \"file\": board.image_name,\n                \"chip\": board.chip,\n                \"offset\": \"0x0\" if board.method == \"esp\" else \"\",\n                \"demo\": DEFAULT_DEMO,\n            }\n        )\n    return records, failed\n\n\ndef build_p4(out: Path) -> tuple[list[dict], list[str]]:\n    directory = ROOT / \"demos/home-automation/esp-idf\"\n    image = \"home-automation-esp32-p4.bin\"\n    if not shutil.which(\"idf.py\"):\n        # ESP-IDF is an optional prerequisite: a plain run still produces the MCU images.\n        warn(\n            \"idf.py not found, skipping ESP32-P4 home-automation (needs an ESP-IDF >= 6.0 env)\"\n        )\n        return [], []\n    log(\"home-automation: ESP32-P4 (ESP-IDF)\")\n    env = idf_env()\n    try:\n        run([\"idf.py\", \"set-target\", \"esp32p4\"], cwd=directory, env=env)\n        run([\"idf.py\", \"build\"], cwd=directory, env=env)\n        # Merge the built artifacts directly (idf.py merge-bin re-runs the build and trips\n        # the esp Rust toolchain; build/flash_args has the offsets).\n        run(\n            [\n                \"python\",\n                \"-m\",\n                \"esptool\",\n                \"--chip\",\n                \"esp32p4\",\n                \"merge_bin\",","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/scripts/build-demo-images.py#L282-L318","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install ESP-IDF >= 6.0 and source its export.sh so idf.py is on PATH","Run the build inside an activated ESP-IDF environment (idf_env)","Ignore the warning if ESP32-P4 images are not needed — the rest of the build still completes","Verify installation: which idf.py && idf.py --version"],"exampleFix":"# before\n./scripts/build-demo-images.py   # idf.py not found, skipping ESP32-P4...\n# after\n. ~/esp/esp-idf/export.sh && ./scripts/build-demo-images.py","handlingStrategy":"fallback","validationCode":"import shutil\nif not shutil.which(\"idf.py\"):\n    print(\"ESP-IDF missing: P4 image will be skipped\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source ESP-IDF export.sh in the same shell/CI step that runs the build","Pin ESP-IDF >= 6.0 in your environment setup","Accept the skip when P4 images are not needed — it is non-fatal by design","Verify with 'which idf.py' before starting long build runs"],"tags":["esp32","esp-idf","build","optional-dependency"],"backgroundTag":"command-not-found","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}