diff --git a/esphome/espidf/bootloader.py b/esphome/espidf/bootloader.py index c514a5aaab9..2e4a3bfc323 100644 --- a/esphome/espidf/bootloader.py +++ b/esphome/espidf/bootloader.py @@ -396,7 +396,10 @@ def _install_cached(app_config: dict, compiler: str, verbose: bool) -> Path | No if _build_standalone(tmp, verbose) != 0: return None if (built_config := toolchain._load_sdkconfig_json(tmp)) is None: - _LOGGER.debug("Bootloader build produced no sdkconfig.json") + # After a successful build this most likely means an IDF change. + _LOGGER.warning( + "Bootloader build produced no %s", tmp / "config" / "sdkconfig.json" + ) return None # Only a build proven byte identical to a second one in a different # dir may be cached; timestamps or randomized signatures, present or diff --git a/tests/unit_tests/test_espidf_bootloader.py b/tests/unit_tests/test_espidf_bootloader.py index 1026bb61b56..1e238e112e4 100644 --- a/tests/unit_tests/test_espidf_bootloader.py +++ b/tests/unit_tests/test_espidf_bootloader.py @@ -563,7 +563,9 @@ def test_ensure_returns_build_failure(tmp_path: Path) -> None: assert not list(root.glob(".build-*")) -def test_ensure_soft_fails_when_build_yields_no_config(tmp_path: Path) -> None: +def test_ensure_soft_fails_when_build_yields_no_config( + tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: def build_without_config(build_dir: Path, verbose: bool) -> int: build_dir.mkdir(parents=True, exist_ok=True) return 0 @@ -571,8 +573,10 @@ def test_ensure_soft_fails_when_build_yields_no_config(tmp_path: Path) -> None: with ( _orchestration_env(tmp_path), patch.object(bootloader, "_build_standalone", side_effect=build_without_config), + caplog.at_level("WARNING"), ): assert bootloader.ensure_cached_bootloader() is False + assert "produced no" in caplog.text # names the expected path @pytest.mark.parametrize("damage", ["missing-elf", "corrupt-bin"])