Commit Graph
100 Commits
Author SHA1 Message Date
J. Nick Koston 478584354e Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-22 12:52:52 -05:00
J. Nick Koston 9c7f68b813 Hoist the boolean spelling tables to helpers so cv.boolean and the env parser share one source
cv.boolean's inline tuples and the ccache env tables were two copies of
the same spellings; TRUTHY_BOOL_STRINGS/FALSY_BOOL_STRINGS now live in
esphome/helpers.py, cv.boolean consumes them, and parse_enable_env
derives its tables by adding the 1/0 env convention.
2026-08-22 12:52:38 -05:00
J. Nick Koston b62d59ca26 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-22 12:47:07 -05:00
J. Nick Koston e52703617e Name the env boolean spelling tables like device-builder does
parse_enable_env's inline tuples become TRUTHY_ENV_STRINGS and
FALSY_ENV_STRINGS frozensets mirroring cv.boolean's spellings (enable
and disable included) plus the 1/0 env convention, matching
device-builder's TRUTHY_BOOL_STRINGS pattern.
2026-08-22 12:47:05 -05:00
J. Nick Koston 57cbadbe9f Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-22 12:46:30 -05:00
J. Nick Koston 315f41e884 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-22 12:46:29 -05:00
J. Nick Koston a6ca775a48 Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-22 12:46:29 -05:00
J. Nick Koston 65609bb94b Move the backend-agnostic library hardening down from the arduino backend PR
The typed IncompatiblePlatform exception, dependency_is_usable,
warn_properties_depends, the lex_build_flags helper (espidf switches to
it), the normalize_dependencies validation, the manifest shape check,
the component-level drop-warning split, and the SCons case-sensitive
.C/.C++ suffixes all harden the shared converter independently of the
arduino backend, so they belong in this PR; the provides hook and the
version-less reconciliation stay with the backend that needs them.
2026-08-22 12:46:16 -05:00
J. Nick Koston 4a1138820d Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-22 12:15:39 -05:00
J. Nick Koston 7c07276c71 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-22 12:15:38 -05:00
J. Nick Koston 072b65c0e2 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-22 12:15:38 -05:00
J. Nick Koston 60cf44de3b Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-22 12:15:38 -05:00
J. Nick Koston f71867ed2d Merge remote-tracking branch 'origin/dev' into esp8266-native-shared-helpers 2026-08-22 12:15:30 -05:00
J. Nick Koston 9676e0c0f0 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-22 11:55:58 -05:00
J. Nick Koston cedecf1f83 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-22 11:55:58 -05:00
J. Nick Koston f28be76c84 Fix comment drift: conditional cache refresh, future-tense generator consumer 2026-08-22 11:55:15 -05:00
J. Nick Koston cdde9dd230 Trim comment essays and hoist function-local test imports 2026-08-22 11:39:54 -05:00
J. Nick Koston 935db6a63c Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-22 11:38:49 -05:00
J. Nick Koston 90b29e231d Trim comment essays and hoist function-local test imports 2026-08-22 11:38:46 -05:00
J. Nick Koston 315abf21f8 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-22 11:37:21 -05:00
J. Nick Koston 24e5b1800f Trim comment essays and hoist function-local test imports 2026-08-22 11:37:16 -05:00
J. Nick Koston 11eca53a18 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-22 11:35:41 -05:00
J. Nick Koston f08e06f574 Trim comment essays and hoist function-local test imports 2026-08-22 11:35:35 -05:00
J. Nick Koston 27f4db8458 Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-22 11:34:57 -05:00
J. Nick Koston e99e0cc8b8 Trim comment essays and hoist function-local test imports 2026-08-22 11:34:32 -05:00
J. Nick Koston 4eb31c45da Isolate the preresolved-ccache test from ambient CCACHE_DIR, future-tense the sentinel comment 2026-08-21 21:27:49 -05:00
J. Nick Koston 4bea2dd058 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 21:01:47 -05:00
J. Nick Koston db0e52a36b Cover shell_token's Windows branch on the coverage-uploading runner 2026-08-21 21:01:37 -05:00
J. Nick Koston 6a963ba794 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 20:56:37 -05:00
J. Nick Koston cbf9e0ab14 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 20:56:37 -05:00
J. Nick Koston a527b21761 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-21 20:56:36 -05:00
J. Nick Koston 4d63564cdd Phrase the board-table regen comment imperatively 2026-08-21 20:56:27 -05:00
J. Nick Koston 012b571a2e Make the ccache sentinel public; sibling modules pass it as a default 2026-08-21 20:55:07 -05:00
J. Nick Koston 4a16365f13 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 20:51:56 -05:00
J. Nick Koston 587873a2da Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 20:51:56 -05:00
J. Nick Koston 4101ad4fb1 One owner for the toolchain tool layout, thread a pre-resolved ccache
toolchain_tool carries the bin/xtensa-lx106-elf-<name> pattern and the
Windows suffix that four call sites previously spelled out (only one of
which handled the suffix). ccache_env and get_build_env accept the
already-resolved ccache path so run_compile can resolve once instead of
paying the PATH scan and runnability probe three times per build.
2026-08-21 20:46:10 -05:00
J. Nick Koston e9d6132c61 Name the honored native-arduino pio options once
NATIVE_ARDUINO_PIO_OPTIONS is the single list the routing reads; the
backend's ignored-option warning consumes it too, so honoring a new key
is one edit instead of two synchronized ones.
2026-08-21 20:43:43 -05:00
J. Nick Koston 7298eed5b3 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 20:27:43 -05:00
J. Nick Koston 78a1e88915 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 20:27:43 -05:00
J. Nick Koston d8c02221cc Route board_build.ldscript through to the native ESP8266 generator too
Published configs override it to reserve a filesystem region
(SmartIntercom's eagle.flash.4m2m.ld) or to correct a board's assumed
flash size (2 MB ESP8285 plugs pinning eagle.flash.2m.ld); dropping it
changes the flash layout under them.
2026-08-21 20:27:33 -05:00
J. Nick Koston 76d8c9eb46 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 20:25:32 -05:00
J. Nick Koston a703acf85f Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 20:25:32 -05:00
J. Nick Koston 7fb18f395f Honor board_build.f_cpu under the native ESP8266 Arduino toolchain
Dropping it was a real regression: many published ESP8266 configs pin
board_build.f_cpu: 160000000L for timing-sensitive integrations
(MHI-AC-Ctrl documents the 160 MHz requirement in its example), and the
warn-and-drop left those devices at 80 MHz. The option now routes into
CORE.platformio_options under toolchain: arduino for the generator to
consume; other native toolchains keep the warning.
2026-08-21 20:25:23 -05:00
J. Nick Koston 97ed253c38 Say the floor's config-validation guard is future wiring, not present
Nothing at this commit enforces MIN_FRAMEWORK_VERSION during
validation; the native backend's validator arrives with the wiring PR.
The comment no longer invites skipping it.
2026-08-21 16:07:30 -05:00
J. Nick Koston cbf1241401 Resolve the ccache path on every call, matching the espidf backend
functools.cache froze the ESPHOME_CCACHE_ENABLE/PATH decision for the
process lifetime, which a long-lived host like device-builder never
restarts, and forced a cache_clear fixture in the tests. The docstring
and test now pin the uncached delegation.
2026-08-21 15:33:51 -05:00
J. Nick Koston 33aea420ac Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 15:19:10 -05:00
J. Nick Koston e3d29e9fff Name a non-list registry system field instead of a TypeError
file["system"] normalized None and str but let an int or dict fall
through to the in test, where an int raises TypeError and a dict
becomes a key test; both now raise the same Unexpected-response error
as the other shape guards.
2026-08-21 15:18:54 -05:00
J. Nick Koston 4dc2d34399 State the encoder's real registry parity and why the 3.1.1 floor exists
The docstring claimed exact registry names for every core above 2.6.2;
2.6.3, 3.0.0 and 3.0.1 ship with non-zero trailing components the
formula cannot produce. Name them, say which callers are safe (the ~
range on the PlatformIO path, the floored check_and_install), and
credit the floor with covering 3.0.0/3.0.1 as well as the absent 3.1.0.
2026-08-21 14:50:36 -05:00
J. Nick Koston c07a5a8da4 Match the encoder's lower bound to the PlatformIO era guard, drop the unused logger
<= 2.6.2 instead of < 2.6.3: a 2.6.2 pre-release sorts above 2.6.2 and
belongs to the package-major-3 encoding, so the helper now describes
the same set as _format_framework_arduino_version and a 2.6.2-b1 pin
formats as it does on dev. The module never logged, so its _LOGGER and
logging import go.
2026-08-21 14:32:27 -05:00
J. Nick Koston 93a768531d Anchor the 4.x error to the version key, bound the encoder, build PATH without empty entries
cv.Invalid now carries path=[CONF_VERSION] so the rejection lands on
the framework version line the comment promised, matching the esp32
convention. framework_package_version raises for cores before 2.6.3
instead of encoding them wrongly for a caller that skipped the
PlatformIO path's era guard. get_build_env joins PATH from filtered
parts so an absent PATH cannot leave a trailing separator that the
shell reads as the current directory.
2026-08-21 14:12:20 -05:00
J. Nick Koston e3cf2407ca Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 13:13:15 -05:00
J. Nick Koston 45cbe0aa4b Parse IDF_CCACHE_ENABLE strictly through the shared helper, fix the ccache docstrings
parse_enable_env carries the 1/true/yes/on and 0/false/no/off table for
both knobs, so IDF_CCACHE_ENABLE=off disables instead of reading as
truthy and suppressing the shared opt-out. The ccache module docstring
and the ESP-IDF _ccache_env docstring now describe the precedence this
PR actually ships, and the probe test duplicated by the helper move is
dropped from the PlatformIO toolchain tests.
2026-08-21 13:12:57 -05:00
J. Nick Koston 1f1cab9c37 Anchor the 4.x rejection to the framework version line, isolate the ccache env test
The installer's EsphomeError becomes cv.Invalid at the config
validator, and test_ccache_env clears the ambient environment so a
developer's exported CCACHE_DIR cannot fail it.
2026-08-21 12:51:09 -05:00
J. Nick Koston 85335de839 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 12:25:13 -05:00
J. Nick Koston 0f7cd3fada Single-quote POSIX shell tokens, share the tool probe, harden registry checks
shell_token now picks the quoting style per platform: single quotes on
POSIX (sh expands nothing inside them, so backslash runs, $VAR, and
backticks reach the compiler exactly as lexed, matching SCons's
no-shell spawn) and the CreateProcess argv rule on Windows. A test
round-trips every case through a real /bin/sh.

The ninja and ccache runnability probes collapse into one
tool_version_runs helper in framework_helpers. The registry names a
non-dict top-level payload like the inner guards, and the expect layout
check also runs on marker hits so a marked install that later lost
files fails by name. The ESP-IDF ccache gate defers to
resolve_ccache_path so ESPHOME_CCACHE_ENABLE=0 disables ccache there
too, with IDF_CCACHE_ENABLE still taking precedence.
2026-08-21 12:25:03 -05:00
J. Nick Koston 653f9e8f2a Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 11:14:35 -05:00
J. Nick Koston 510f667bd1 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 11:14:35 -05:00
J. Nick Koston c93cf55967 Skip the cache refresh when the CLI toolchain differs from the compile's
Platforms normalize toolchain-sensitive keys differently (the esp32
board name, for one), so a config validated under a mismatching
--toolchain must not overwrite the cache while the sidecar keeps the
compile's toolchain. The guard lives in _refresh_sidecar where the old
sidecar is already loaded; legacy sidecars without the field are
unaffected.
2026-08-21 11:14:26 -05:00
J. Nick Koston f3f6fe8a7d Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 09:58:44 -05:00
J. Nick Koston efe1b0e744 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 09:58:44 -05:00
J. Nick Koston 6cb446baf8 State what the cache refresh actually writes
The comment claimed the refresh's sidecar records the CLI toolchain;
_refresh_sidecar returns early when a compile-written sidecar exists,
so the compile's toolchain stands. Reword the comment and the test
docstring to match.
2026-08-21 09:58:32 -05:00
J. Nick Koston 0fa081cd80 Name malformed registry elements, parse ESPHOME_CCACHE_ENABLE strictly, require a package layout check
Registry version and file entries that are not dicts now raise the same
Unexpected-response error as the other shape guards instead of an
AttributeError traceback. install_package rejects an empty expect so
every install is layout-validated before the marker is written.
ESPHOME_CCACHE_ENABLE values outside 1/true/yes/on and 0/false/no/off
warn and are treated as unset instead of bool(str) flipping them to
enabled. The strip_win_long_path_prefix test moved next to the function
in test_framework_helpers, and a stale comment naming its old module is
fixed.
2026-08-21 09:58:16 -05:00
J. Nick Koston 8fd8766167 Sandbox ESPHOME_ARDUINO8266_PREFIX in the writer test isolation fixture
The autouse fixture pinned the idf and sdk-nrf prefixes but not the new
arduino8266 one, so running the suite with that env var exported deleted
the pointed-to install. Also adds the clean_all removal test the other
two native installs already have.
2026-08-21 09:35:53 -05:00
J. Nick Koston 225c62dbf1 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-21 01:05:51 -05:00
J. Nick Koston 0b0194cf41 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-21 01:05:51 -05:00
J. Nick Koston 8b9773c4bd Gate only the cache read on an explicit CLI toolchain, keep the refresh
The upload/logs cache split: an explicit --toolchain still skips the
read and runs the per-platform validators, but the freshly validated
config is saved again so a later plain run keeps the fast path (the
sidecar records the resolved toolchain). check_supported_toolchain is
module-private now since it has no caller outside config_validation,
and require_platformio_toolchain's docstring describes what actually
happens when another platform's toolchain is passed.
2026-08-21 01:05:38 -05:00
J. Nick Koston 078bcba473 Backend-neutral unsupported-core message, pin the PIO source formatter 2026-08-20 23:55:15 -05:00
J. Nick Koston 85acafb646 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 23:54:17 -05:00
J. Nick Koston 18a2aa2097 Probe the PATH ninja, chain import errors, harden registry payload checks, honest ccache docstring 2026-08-20 23:53:40 -05:00
J. Nick Koston 88f1c4474f Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 23:47:51 -05:00
J. Nick Koston 6ed01b06c3 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 23:47:51 -05:00
J. Nick Koston 24eb6354f9 Run validators when a CLI toolchain is given on the cache fast path, cover every LibreTiny family 2026-08-20 23:47:47 -05:00
J. Nick Koston 355d02ee6a Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 22:08:43 -05:00
J. Nick Koston f5ac480dff Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 22:08:43 -05:00
J. Nick Koston 19555e8eaf Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-20 22:08:43 -05:00
J. Nick Koston d47dc0d992 Pin fingerprint stability and sensitivity behaviorally, note the platform pairing 2026-08-20 22:08:41 -05:00
J. Nick Koston 6a363c1746 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 21:09:43 -05:00
J. Nick Koston b0a214830a Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 21:09:43 -05:00
J. Nick Koston 38744e4222 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-20 21:09:43 -05:00
J. Nick Koston 9624abcd57 Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-20 21:09:42 -05:00
J. Nick Koston 2c229debe8 Best-effort bad encodings, dedupe append warnings, tolerate structurally odd compile DBs 2026-08-20 21:09:38 -05:00
J. Nick Koston 5857bfcf52 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 20:53:32 -05:00
J. Nick Koston 378a01a838 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 20:53:31 -05:00
J. Nick Koston e266a449e0 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-20 20:53:31 -05:00
J. Nick Koston 6a0ce046fd Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-20 20:53:31 -05:00
J. Nick Koston 6b6344b454 Cover the healthy post-compile idedata path 2026-08-20 20:53:30 -05:00
J. Nick Koston a0e82cd000 Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 20:48:32 -05:00
J. Nick Koston a56c465d6d Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 20:48:32 -05:00
J. Nick Koston b3d908d10e Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-20 20:48:32 -05:00
J. Nick Koston 09fd3fb53b Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-20 20:48:32 -05:00
J. Nick Koston 73ab04330e Treat sys.exit(0) as script success, fail on an unreadable declared script 2026-08-20 20:48:30 -05:00
J. Nick Koston a255f3b07c Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 20:46:31 -05:00
J. Nick Koston 57b69cae81 Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra 2026-08-20 20:46:30 -05:00
J. Nick Koston 9fccf1ce33 Merge branch 'esp8266-native-build-surgery' into esp8266-native-toolchain-plumbing 2026-08-20 20:46:30 -05:00
J. Nick Koston b8bb4453e0 Merge branch 'esp8266-native-shared-helpers' into esp8266-native-build-surgery 2026-08-20 20:46:30 -05:00
J. Nick Koston 91eed262c8 Repr zero-arg script exceptions, surface a None idedata after an IDF build 2026-08-20 20:46:15 -05:00
J. Nick Koston c1a0ed0d46 Reject only unknown package majors: 2.6.3+ cores share the package-major-3 encoding 2026-08-20 20:44:24 -05:00
J. Nick Koston 4969d9bf4a Pin the lx106 layout, reject non-3.x cores, pin installer args, delegate ccache policy tests 2026-08-20 20:39:20 -05:00
J. Nick Koston 1c5441b69e Merge branch 'esp8266-native-build-infra' into esp8266-native-framework-installer 2026-08-20 20:38:30 -05:00
J. Nick Koston ec8437fea2 Quote empty tokens, honest docstrings, strict registry payloads, required layout checks, honest patch targets 2026-08-20 20:38:09 -05:00