Fix comment drift: conditional cache refresh, future-tense generator consumer

This commit is contained in:
J. Nick Koston
2026-08-22 11:55:15 -05:00
parent 24e5b1800f
commit f28be76c84
3 changed files with 7 additions and 7 deletions
+2 -1
View File
@@ -2735,7 +2735,8 @@ def run_esphome(argv):
args.command in ("upload", "logs") and not command_line_substitutions
)
# An explicit --toolchain must re-run the per-platform validators, so
# gate only the cache read; the refresh below still saves the result.
# gate only the cache read; the refresh below saves the result unless
# the sidecar records a different toolchain.
cache_read_eligible = cache_write_eligible and args.toolchain is None
if cache_read_eligible:
from esphome.compiled_config import load_compiled_config
+3 -3
View File
@@ -555,9 +555,9 @@ def _add_library_str(lib: str) -> None:
cg.add_library(lib, None)
# platformio_options keys the native ESP8266 Arduino generator honors; the
# backend's ignored-option warning consumes this too so the two lists cannot
# drift (a drift is either a spurious warning or a silently dropped option)
# platformio_options keys the native ESP8266 Arduino generator (a later PR
# in this chain) will honor; its ignored-option warning will consume the same
# list so the two cannot drift
NATIVE_ARDUINO_PIO_OPTIONS = frozenset({"board_build.f_cpu", "board_build.ldscript"})
+2 -3
View File
@@ -7227,9 +7227,8 @@ def test_cli_toolchain_skips_the_validated_config_cache(tmp_path: Path) -> None:
def test_cli_toolchain_still_refreshes_the_validated_config_cache(
tmp_path: Path,
) -> None:
"""An explicit --toolchain gates only the cache read; the freshly
validated config is still saved so a later plain run keeps the fast
path (an existing compile-written sidecar keeps its toolchain)."""
"""An explicit --toolchain gates only the cache read; with a matching
sidecar the freshly validated config is still saved."""
conf = tmp_path / "device.yaml"
conf.write_text("esphome:\n name: t\n")
argv = ["esphome", "--toolchain", "platformio", "logs", str(conf)]