Merge branch 'host-pch' into esp32-pio-pch

This commit is contained in:
J. Nick Koston
2026-09-23 23:06:08 +01:00
4 changed files with 12 additions and 34 deletions
+5 -14
View File
@@ -27,10 +27,7 @@ _MAX_RAM_SIZE = 81920
def _warn_ignored_platformio_options() -> None:
"""Warn for component-added platformio options the native build drops.
The consumed set lives next to the routing in core/config.py so the
two cannot drift."""
"""Warn for component-added platformio options the native build drops."""
from esphome.core.config import NATIVE_ARDUINO_CONSUMED_PIO_OPTIONS
consumed = NATIVE_ARDUINO_CONSUMED_PIO_OPTIONS
@@ -235,11 +232,8 @@ def _parse_app_size(build_dir: Path, paths: framework.InstalledPaths) -> int | N
def _print_size_summary(build_dir: Path, paths: framework.InstalledPaths) -> bool:
"""Print the PlatformIO-shaped RAM/Flash lines; False when skipped.
The exact shape (including the bar) is parsed by
``script/ci_memory_impact_extract.py``; ``print_size_line`` matches it.
"""
"""Print the RAM/Flash lines ``ci_memory_impact_extract.py`` parses;
False when skipped."""
from esphome.build_helpers.size_summary import print_size_line
size_tool = _toolchain_tool("size")
@@ -293,11 +287,8 @@ _CCACHE_UNRESOLVED: Any = object()
def get_idedata(ccache: str | None = _CCACHE_UNRESOLVED) -> dict | None:
"""Derive idedata from the build's compile_commands.json.
Same contract as ``espidf.toolchain.get_idedata``: the fields IDE
integrations, clang-tidy, and the memory analyzer expect.
"""
"""Derive idedata from the build's compile_commands.json (same
contract as ``espidf.toolchain.get_idedata``)."""
from esphome.build_helpers.idedata import load_or_build_idedata
if ccache is _CCACHE_UNRESOLVED:
+2 -5
View File
@@ -36,11 +36,8 @@ IDEDATA_BEST_EFFORT_ERRORS = (
def warn_if_idedata_missing(get_idedata: Callable[[], dict | None]) -> None:
"""Run an idedata generator, downgrading any failure to a warning.
Shared by the native backends: the firmware already built, so a missing
or broken idedata must not fail a successful build.
"""
"""Run an idedata generator, downgrading any failure to a warning:
the firmware already built."""
try:
if get_idedata() is None:
_LOGGER.warning("No idedata was generated for this build")
+1 -5
View File
@@ -317,11 +317,7 @@ CONFIG_SCHEMA = cv.All(
def native_toolchain_module():
"""The native build backend for the resolved toolchain, if any.
``__main__`` dispatches from its own toolchain-keyed table; this helper
serves the component's internal callers.
"""
"""The native build backend for the resolved toolchain, if any."""
if not CORE.using_toolchain_arduino:
return None
from esphome.arduino8266 import toolchain
+4 -10
View File
@@ -564,10 +564,8 @@ def _path_or_file_trigger(
@cache
def _cached_components_closure(files: tuple[str, ...]) -> frozenset[str]:
"""Dependency closure of the changed components, from the changed files.
The walk is expensive and every toolchain smoke-test job asks for the
same file list, so compute it once per run."""
"""Dependency closure of the changed components; cached because the
walk is expensive and every smoke-test job asks for the same list."""
component_files = [f for f in files if filter_component_and_test_files(f)]
return frozenset(get_components_with_dependencies(component_files, True))
@@ -723,12 +721,8 @@ def _esp8266_native_path_or_file_trigger(files: list[str]) -> bool:
def esp8266_native_components_to_test(branch: str | None = None) -> list[str]:
"""Subset of ``ESP8266_NATIVE_TEST_COMPONENTS`` the job needs to compile.
Same narrowing logic as ``esp32_platformio_components_to_test``: the full
list on core or infrastructure changes, otherwise the intersection with
the changed-component dependency closure (empty list skips the job).
"""
"""Subset of ``ESP8266_NATIVE_TEST_COMPONENTS`` the job needs to
compile (same narrowing as ``esp32_platformio_components_to_test``)."""
return _toolchain_components_to_test(
branch, ESP8266_NATIVE_TEST_COMPONENTS, _esp8266_native_path_or_file_trigger
)