[espidf] Warn with the expected path when the build yields no sdkconfig

This commit is contained in:
J. Nick Koston
2026-09-29 23:30:31 +02:00
parent efaaaa90ef
commit e77ae52d00
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -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
+5 -1
View File
@@ -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"])