diff --git a/esphome/arduino8266/toolchain.py b/esphome/arduino8266/toolchain.py index d81b6b39ca..6b3977d68b 100644 --- a/esphome/arduino8266/toolchain.py +++ b/esphome/arduino8266/toolchain.py @@ -27,7 +27,9 @@ _MAX_RAM_SIZE = 81920 # never reaches CORE.platformio_options under the native toolchain (it is # read from the raw config at upload time), so anything here came from a # component and genuinely is dropped; warn for it. -_CONSUMED_PIO_OPTIONS = frozenset({"lib_ignore"}) +_CONSUMED_PIO_OPTIONS = frozenset( + {"lib_ignore", "board_build.f_cpu", "board_build.ldscript"} +) _RAM_SECTIONS = (".data", ".rodata", ".bss") diff --git a/tests/unit_tests/test_arduino8266_toolchain.py b/tests/unit_tests/test_arduino8266_toolchain.py index 55fad4f3da..7dbb2183e0 100644 --- a/tests/unit_tests/test_arduino8266_toolchain.py +++ b/tests/unit_tests/test_arduino8266_toolchain.py @@ -326,15 +326,20 @@ def test_print_size_summary_missing_section_skips_summary( def test_warn_ignored_platformio_options(caplog: pytest.LogCaptureFixture) -> None: - """Component-added options the native build drops are warned by name.""" + """Component-added options the native build drops are warned by name; + the honored ones (lib_ignore, f_cpu, ldscript) stay quiet.""" CORE.platformio_options = { - "board_build.ldscript": "eagle.flash.4m.ld", + "board_build.ldscript": "eagle.flash.4m2m.ld", + "board_build.f_cpu": "160000000L", + "board_build.filesystem": "littlefs", "lib_ignore": ["Updater"], "upload_speed": "460800", } warn_ignored_platformio_options(toolchain._CONSUMED_PIO_OPTIONS, "arduino") - assert "platformio_options->board_build.ldscript is ignored" in caplog.text + assert "platformio_options->board_build.filesystem is ignored" in caplog.text assert "native 'arduino' toolchain" in caplog.text + assert "board_build.ldscript is ignored" not in caplog.text + assert "board_build.f_cpu is ignored" not in caplog.text assert "lib_ignore" not in caplog.text # Component-added upload_speed never gets read under the native # toolchain, so it must warn