Merge branch 'platformio-pch-rp2' into platformio-pch-libretiny

This commit is contained in:
J. Nick Koston
2026-09-23 23:13:21 +01:00
2 changed files with 13 additions and 9 deletions
+11 -9
View File
@@ -949,23 +949,16 @@ def write_project(paths: InstalledPaths, ccache: str | None) -> bool:
raise EsphomeError(f"Invalid flash mode {flash_mode!r}")
flash_ld_name = _flash_ld_name(board)
generate_ld_scripts(paths, config, flash_ld_name)
sdk = framework / "tools" / "sdk"
core_dir = framework / "cores" / "esp8266"
variant_dir = framework / "variants" / board_build["variant"]
src_dir = CORE.relative_src_path()
libraries = resolve_libraries(
framework,
pio_platform="espressif8266",
board_mcu="esp8266",
cache_key="arduino8266",
)
if not src_dir.is_dir():
# Generated project state, not install state: clean-all would not help
raise EsphomeError(f"Generated source directory {src_dir} is missing")
# Completeness checks run before generate_ld_scripts spawns gcc so a
# half-extracted install names the missing path, not a gcc error.
# A missing install directory would otherwise surface as a wall of
# include errors; failing here names the path instead.
include_dirs = [
@@ -991,6 +984,15 @@ def write_project(paths: InstalledPaths, ccache: str | None) -> bool:
raise EsphomeError(
f"{_INCOMPLETE_INSTALL}: missing {required_file}; {_CLEAN_HINT}"
)
generate_ld_scripts(paths, config, flash_ld_name)
libraries = resolve_libraries(
framework,
pio_platform="espressif8266",
board_mcu="esp8266",
cache_key="arduino8266",
)
for lib in libraries:
include_dirs += lib.include_dirs
@@ -1820,6 +1820,8 @@ def test_write_project_rejects_spaced_ldscript_override(tmp_path: Path) -> None:
CORE.platformio_options = {"board_build.ldscript": "my script.ld"}
paths = _make_framework(tmp_path)
_set_flags()
# The completeness checks run first; give them a src dir to pass
CORE.relative_src_path().mkdir(parents=True, exist_ok=True)
with pytest.raises(EsphomeError, match="Invalid flash linker script name"):
arduino8266.write_project(paths, None)