Merge branch 'esp8266-native-ninja-emission' into esp8266-arduino-toolchain

This commit is contained in:
J. Nick Koston
2026-08-20 20:46:31 -05:00
3 changed files with 32 additions and 2 deletions
+2 -1
View File
@@ -861,7 +861,8 @@ def compile_program(args: ArgsProtocol, config: ConfigType) -> int:
toolchain.create_ota_bin()
toolchain.create_elf_copy()
try:
toolchain.get_idedata()
if toolchain.get_idedata() is None:
_LOGGER.warning("No idedata was generated for this build")
except (EsphomeError, OSError, RuntimeError, ValueError) as err:
# The firmware already built; idedata is a bonus artifact here.
# Broad on purpose: a vanished compiler (OSError), a failed
+1 -1
View File
@@ -214,7 +214,7 @@ def run_extra_script(
# build could produce wrong-output firmware that links cleanly. The
# warning plus the resulting loud link error point back here.
_LOGGER.warning(
"PIO extra-script %s (in %s) raised %s; ignoring its output",
"PIO extra-script %s (in %s) raised %r; ignoring its output",
script_path,
library_dir.name,
e,
+29
View File
@@ -7298,3 +7298,32 @@ def test_compile_program_espidf_idedata_failure_does_not_fail_build(
):
assert compile_program(MagicMock(), {}) == 0
assert "Could not generate idedata" in caplog.text
def test_compile_program_espidf_idedata_none_warns(
caplog: pytest.LogCaptureFixture,
) -> None:
"""A silent None from the post-compile idedata refresh is made visible."""
from esphome.const import (
KEY_CORE,
KEY_TARGET_FRAMEWORK,
KEY_TARGET_PLATFORM,
Toolchain,
)
from esphome.core import CORE
CORE.toolchain = Toolchain.ESP_IDF
CORE.data[KEY_CORE] = {
KEY_TARGET_PLATFORM: "esp32",
KEY_TARGET_FRAMEWORK: "esp-idf",
}
with (
patch("esphome.espidf.toolchain.run_compile", return_value=0),
patch("esphome.espidf.toolchain.create_factory_bin"),
patch("esphome.espidf.toolchain.create_ota_bin"),
patch("esphome.espidf.toolchain.create_elf_copy"),
patch("esphome.espidf.toolchain.get_idedata", return_value=None),
patch("esphome.__main__._check_and_emit_build_info"),
):
assert compile_program(MagicMock(), {}) == 0
assert "No idedata was generated" in caplog.text