Commit Graph
119 Commits
Author SHA1 Message Date
J. Nick Koston a15dbe750f Pin that a non-default flash mode reaches the define and the image header 2026-08-23 17:46:53 -05:00
J. Nick Koston c97fb7744b Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-23 17:12:40 -05:00
J. Nick Koston 5990fbbf58 Warn on unrecognized flag shapes reaching the compile line, pin the IPv6 lwIP pair, fix stale comments 2026-08-23 17:12:31 -05:00
J. Nick Koston ad4c59873b Read flash mode from its real producer, share the mode set, store the scanf decision
flash_mode comes from the board_build.flash_mode option the component
already pins (validated by cv.one_of against the same BUILD_FLASH_MODES,
now living in const.py so the two sides cannot drift), retiring
KEY_FLASH_MODE from the generator. The scanf-float decision is stored in
CORE.data where it is computed instead of being a discarded local, so
KEY_SCANF_FLOAT has a producer in this PR. A trailing bare -include in
build_src_flags fails by name instead of degrading into the source dir.
2026-08-23 16:42:25 -05:00
J. Nick Koston f955c59fe4 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-23 15:33:42 -05:00
J. Nick Koston 9cbdfa07cb Require bodies on the MMU segment sizes, split driver link flags, warn on a stuck note
A bare -DMMU_IRAM_SIZE would preprocess to len = 1 and fail far away in
ld (or as a misleading testing-mode message), so MMU_CUSTOM requires a
body on both segment sizes before the shape check. -fuse-ld=/-specs=/
--specs= are driver options with no -Wl, spelling, so they get their
own rejection instead of advice that would make things worse. An
unremovable stale stderr note now warns with the clean hint, since its
consequence is a permanently unstamped cache.
2026-08-23 15:33:37 -05:00
J. Nick Koston a80b5a9dd0 Cover the flash-mode rejection and src-flag pass-through 2026-08-23 14:06:11 -05:00
J. Nick Koston 4cc3012d98 Read build_src_flags from its producer, share the ldscript rule, shape-check flash_mode
The throw_stubs force-include now comes from the build_src_flags option
esp8266/__init__ pins, collapsing the two spellings to one source of
truth; -include paths resolve against the source root. The ldscript
fallback consumes boards.board_ld_script instead of duplicating the
per-board rule, flash_mode is checked against its closed set before
landing unquoted in the elf2bin command, and the board-gate comment no
longer names a nonexistent validator.
2026-08-23 13:56:27 -05:00
J. Nick Koston 39f6425170 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-23 13:54:27 -05:00
J. Nick Koston 6b5b13c17e Pin the LOW_MEMORY lwIP fall-through, veto the stamp on a stuck stale note
LOW_MEMORY is upstream's else branch, so the default variant stands in
for it and every listed knob wins -- pinned for the ordinary SNTP
multi-server config where esp8266's HIGHER_BANDWIDTH_LOW_FLASH must
prevail. A stale warn note that cannot be removed now vetoes the stamp
(mirror of the lost-note case), and the unreadable-cached-note warning
names its cause.
2026-08-23 13:51:54 -05:00
J. Nick Koston 9f6d66a2e7 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	esphome/build_gen/arduino8266.py
#	tests/unit_tests/build_gen/test_arduino8266.py
2026-08-23 12:18:51 -05:00
J. Nick Koston eb982e07a7 Veto the ld-script cache stamp when the warn note is lost, widen the linker denylist
A failed stderr-sidecar write no longer stamps the cache: the next build
re-runs -E and re-derives the preprocessor diagnostic honestly instead
of losing it for the life of the build dir. The sidecar unlink joins the
best-effort contract. The plain-linker denylist gains the
-nodefaultlibs/-nostdlib/-rdynamic family and the -fuse-ld=/--specs=
prefixes, with a comment naming it best-effort rather than complete.
The damaged-file helper test now lives only in test_helpers.py beside
the OSError-branch coverage.
2026-08-23 12:17:43 -05:00
J. Nick Koston 10d82b129a Rely on the lex funnel's empty-argument drop
The funnel now warns and drops empty glued arguments itself, so the
raise here had nothing left to catch.
2026-08-23 12:15:52 -05:00
J. Nick Koston cd3cdde87c Preserve d1_wroom_02's shipped flash layout, refuse plain linker unflags, pin the real spaced-override outcome 2026-08-22 22:29:21 -05:00
J. Nick Koston a7e5ac9dea Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 22:11:44 -05:00
J. Nick Koston be5317ae46 Scope the hex-only MMU rule to the segment sizes the surgery parser reads 2026-08-22 22:11:42 -05:00
J. Nick Koston 476852c84f Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	esphome/build_gen/arduino8266.py
2026-08-22 22:11:14 -05:00
J. Nick Koston 2521f29782 Apply the 18559 simplify pass: surgery wrapper, shared clean hint, resilient write helper, unified knob lookups, test scaffolding 2026-08-22 22:09:36 -05:00
J. Nick Koston aadc10944c Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	esphome/build_gen/arduino8266.py
2026-08-22 21:49:06 -05:00
J. Nick Koston bb7ba38fd0 Hoist the knob tables to dicts and the shape checks to compiled module regexes 2026-08-22 21:48:41 -05:00
J. Nick Koston 822bb1d88f Drop the stale ccache_path patch from the write_project test 2026-08-22 21:29:50 -05:00
J. Nick Koston 9487cf6b7c Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 21:29:33 -05:00
J. Nick Koston 81afaca560 Unify the MMU guards: hex-only sizes, every valued MMU_* validated, no-knob refuses all 2026-08-22 21:29:31 -05:00
J. Nick Koston 53cfdc92ba Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 20:26:38 -05:00
J. Nick Koston c60b8d1b8b Validate custom MMU sizes, refuse raw NONOSDK defines, warn on a lost stderr note 2026-08-22 20:26:27 -05:00
J. Nick Koston 7460f8df1a Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 20:01:32 -05:00
J. Nick Koston 33987c9682 Merge branch 'esp8266-native-library-backend' into esp8266-native-build-spec 2026-08-22 20:01:32 -05:00
J. Nick Koston 8b8ef9bc61 Clean up the archive on any ar failure; state the link-order contract plainly 2026-08-22 20:00:22 -05:00
J. Nick Koston c3eeb3fa2a Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	tests/unit_tests/build_gen/test_arduino8266.py
2026-08-22 19:15:07 -05:00
J. Nick Koston 03dba8b63e Raise on empty-argument build flags, pin the preprocessor decode, soften bookkeeping writes 2026-08-22 19:13:41 -05:00
J. Nick Koston 39d18e7411 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 16:38:31 -05:00
J. Nick Koston 23fc61d9b1 Merge branch 'esp8266-native-library-backend' into esp8266-native-build-spec 2026-08-22 16:38:31 -05:00
J. Nick Koston f4844e2d69 Accept precompiled=false, keep same-file copies intact, ungate the empty-match warning 2026-08-22 16:38:21 -05:00
J. Nick Koston 0910604166 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 15:25:48 -05:00
J. Nick Koston db89d64c4e Merge branch 'esp8266-native-library-backend' into esp8266-native-build-spec 2026-08-22 15:25:48 -05:00
J. Nick Koston 040c91259d Mirror the URL rule in the bundled probe; fail on empty converted trees; harden build_tool argv
A URL-pinned dependency now skips the bundled probe (the walk resolves
the fork; adding the bundled copy would double the archive). A versioned
bundled candidate's non-platform manifest fault warns here since it
skips the walk's usability filter via provides(); version-less causes
stay at debug (the walk already warned). The pending drain logs a
manifest-name suppression at debug and drops its unreachable
bundled_names re-check. A converted tree with no sources and no headers
now fails by name at emit like the bundled case (test scaffolds gained
real source files). build_tool validates each mode's operand count and
a failed copy unlinks the partial output.
2026-08-22 15:25:37 -05:00
J. Nick Koston 7c47cbdb73 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	esphome/build_gen/arduino8266.py
2026-08-22 15:06:30 -05:00
J. Nick Koston 49dcc89130 Validate the board and flash-ld names; reject valued VTABLES defines; scope the damaged-cache recovery
The board name lands unquoted in two -D bodies and the flash linker
script name joins under the SDK and build ld dirs, so both are now
shape-validated like f_cpu. A VTABLES_IN_* define carrying a body would
split the compile line from the linker script and is refused. The
damaged-cache overwrite moves into a shared _write_generated helper
scoped to the comparison read: a corrupt existing copy is logged and
replaced (the testing-mode flash ld gets the same recovery), while a
genuine write failure still raises with its cause.
2026-08-22 15:05:58 -05:00
J. Nick Koston e8ceb241e1 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 13:10:55 -05:00
J. Nick Koston a9149aef28 Merge branch 'esp8266-native-library-backend' into esp8266-native-build-spec 2026-08-22 13:10:55 -05:00
J. Nick Koston efa3018123 Close the four diagnostic gaps in the library backend
An owner-qualified dependency name (Owner/Pkg, both halves safe) is the
converter's to resolve and no longer draws the malformed-entry warning,
which stays for genuinely unsafe shapes. A declared srcFilter matching
only inert files now warns like one matching nothing, while matched
headers still read as a header-only library. The short-name suppression
logs the assumed external at debug so an accidental collision is
attributable. A failing ar batch unlinks the truncated archive before
returning its exit code.
2026-08-22 13:10:44 -05:00
J. Nick Koston 43411106bb Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 12:26:39 -05:00
J. Nick Koston 01f7373d51 Merge branch 'esp8266-native-library-backend' into esp8266-native-build-spec 2026-08-22 12:26:39 -05:00
J. Nick Koston 6bdec7e907 Warn only for source-like suffix drops, batch ar argv, name non-iterable dependencies
The unmapped-suffix warning fired for every header-only library (the
default +<*> filter matches headers), so ArduinoJson would have warned
on every ESP8266 build. It now names exactly the source-like files
(.CPP, .ino and case-variants of the map) the case-sensitive suffix map
rejects, partial drops included, and stays quiet for headers and
metadata.

The ar shim batches the expanded object list by argv length (rc then q
appends), keeping the command line under the Windows 32767-char limit
the rspfile existed to avoid. A non-iterable dependencies value in a
manifest now warns by library name instead of raising a bare
TypeError.
2026-08-22 12:26:24 -05:00
J. Nick Koston 10a22d7d74 Quote an overridden ldscript name on the link line; note the deliberate board-derived --flash_size
The -T script name was the one user-controlled token on the link line
that skipped shell_token, so a space or dollar sign in a
board_build.ldscript override corrupted the emitted linkflags. The
elf2bin comment now records that --flash_size deliberately stays
board-derived, matching PlatformIO (which reads upload.maximum_size,
not the ldscript).
2026-08-22 12:02:33 -05:00
J. Nick Koston 905b056756 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission
# Conflicts:
#	esphome/build_gen/arduino8266.py
2026-08-22 12:01:44 -05:00
J. Nick Koston dc1bbac385 Harden the build spec: content-hashed ld cache, strict f_cpu, loud diagnostics
The linker-script stamp now records the sha256 of the written content, so
an externally edited or truncated cached script regenerates instead of
passing a SECTIONS substring probe, and a non-UTF-8 cached script is
overwritten by the regeneration instead of aborting it. The cached
preprocessor diagnostic re-emit no longer swallows its own read failure.

board_build.f_cpu is validated (digits with an optional L) before landing
unquoted on the compile line, _pio_option rejects empty and blank values
instead of silently reverting to the default, and user MMU define bodies
re-quote through shell_token like every other user token. The plain-form
linker denylist is a named constant the _project_flags docstring points
at, so the two cannot drift.
2026-08-22 12:01:08 -05:00
J. Nick Koston 512a31b3fc Trim comment essays and hoist function-local test imports 2026-08-22 11:44:09 -05:00
J. Nick Koston 3134239d52 Merge branch 'esp8266-native-build-spec' into esp8266-native-ninja-emission 2026-08-22 11:43:02 -05:00
J. Nick Koston 67544598c5 Trim comment essays 2026-08-22 11:42:55 -05:00