mirror of
https://github.com/esphome/esphome.git
synced 2026-10-19 04:32:50 +00:00
Merge branch 'platformio-pch-libretiny' into pch-strict-ci
This commit is contained in:
@@ -954,23 +954,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 = [
|
||||
@@ -996,6 +989,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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user