diff --git a/esphome/components/host/__init__.py b/esphome/components/host/__init__.py index 654e160250..4a8fdb98cc 100644 --- a/esphome/components/host/__init__.py +++ b/esphome/components/host/__init__.py @@ -64,8 +64,9 @@ async def to_code(config: ConfigType) -> None: # Curated prefix for the pch (the script folds it plus defines.h): # host has no framework force-includes, and the per-TU cost is the # STL closure behind the core headers. Measured -43% compile CPU. - # Gated so ESPHOME_PCH_ENABLE=0 restores the strict view; a - # toolchain that cannot load its own pch hits the script's probe. + # Gated so ESPHOME_PCH_ENABLE=0 restores the strict view. When the + # .gch fails to build or load, the force-include stays and every TU + # parses the closure as text: correct, but slower than no pch. cg.add_platformio_option("build_src_flags", f"-include {HOST_PCH_PREFIX}") diff --git a/esphome/writer.py b/esphome/writer.py index a6b89c4108..27c580f45e 100644 --- a/esphome/writer.py +++ b/esphome/writer.py @@ -247,6 +247,7 @@ def copy_src_tree(): Path( "esphome/core/ring_buffer.h" ), # moved to components/ring_buffer/, removed in 2026.11.0 + Path("esphome/core/pch_prefix.h"), # build machinery, not user API } include_l = [] for target, _ in source_files_l: