[core] Leave the precompiled header off on Windows for a GCC with bug 14940 (#19875)

This commit is contained in:
J. Nick Koston
2026-09-29 18:51:12 +02:00
committed by GitHub
parent a7e0afeb46
commit b22f2e6b4c
17 changed files with 410 additions and 35 deletions
+12 -3
View File
@@ -178,6 +178,15 @@ def held_lock() -> Callable[..., Callable[..., None]]:
@pytest.fixture(autouse=True)
def _default_pch_knobs(monkeypatch: pytest.MonkeyPatch) -> None:
"""The precompiled header knobs change what the generators emit; a value
exported in the developer's or CI's shell must not reach the tests."""
monkeypatch.delenv("ESPHOME_PCH_ENABLE", raising=False)
"""The knob changes what the generators emit: no ambient value, and on,
so the Windows runner asks no compiler."""
monkeypatch.setenv("ESPHOME_PCH_ENABLE", "1")
@pytest.fixture
def windows_gcc_rule(monkeypatch: pytest.MonkeyPatch) -> None:
"""Windows host, knob unset: the compiler version decides."""
from esphome.build_helpers import pch
monkeypatch.delenv("ESPHOME_PCH_ENABLE")
monkeypatch.setattr(pch.sys, "platform", "win32")