Stop warning about the now-honored f_cpu and ldscript overrides

This commit is contained in:
J. Nick Koston
2026-08-21 20:31:12 -05:00
parent c9a40e550c
commit f2a878cb25
2 changed files with 11 additions and 4 deletions
+3 -1
View File
@@ -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")
@@ -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