Skip to content

Commit 872a291

Browse files
authored
fix(boards): catch up tinyuf2 partition rename + whitelist cmsis_dsp_lib (clears 27/39 drift) (#318)
* fix(lint): annotate Python daemon Command::new sites for subprocess-spawn lint After f86817a (refactor lib.rs → submodules) the four std::process::Command::new sites in fbuild-python/daemon.rs ended up inside `match` arms two lines below their `allow-direct-spawn:` comment. The detector in ci/find_direct_subprocess.py only looks at "same line or the line immediately above", so the annotation no longer covered the actual call sites and CI started reporting: NEW direct spawns without an `allow-direct-spawn: <reason>` marker: crates/fbuild-python/src/daemon.rs:96 crates/fbuild-python/src/daemon.rs:97 crates/fbuild-python/src/daemon.rs:247 crates/fbuild-python/src/daemon.rs:248 This blocks every PR's "Lint subprocess spawns" check (e.g. #306 for fbuild#304, which is the actual FastLED-vs-PIO size regression we need to land). Fix: add an inline `// allow-direct-spawn:` annotation immediately above each of the four arms. Behavior unchanged. * fix(boards): catch up tinyuf2 partition rename + esp_sr drift; whitelist cmsis_dsp_lib `Validate Board Definitions` workflow has been failing 39 boards drifted from PlatformIO. The two largest categories are pure schema drift that this PR resolves; the remaining ~14 are configuration- choice differences that need maintainer review. ## Fixed: tinyuf2 partition CSV rename (18 boards) Upstream Adafruit (and the espressif32 platform's Adafruit board defs) renamed `tinyuf2-partitions-<size>.csv` -> `partitions-<size>-tinyuf2.csv`. Our bundled board JSONs still pointed to the old name. Renamed in: adafruit_feather_esp32s2{,_reversetft,_tft} adafruit_feather_esp32s3{,_nopsram,_reversetft,_tft} adafruit_funhouse_esp32s2 adafruit_magtag29_esp32s2 adafruit_matrixportal_esp32s3 adafruit_metro_esp32s2 adafruit_metro_esp32s3 adafruit_qtpy_esp32s2 adafruit_qtpy_esp32s3_n4r2 adafruit_qtpy_esp32s3_nopsram adafruit_qualia_s3_rgb666 featheresp32-s2 wt32-sc01-plus All swaps are mechanical s/tinyuf2-partitions-<N>MB.csv/partitions-<N>MB-tinyuf2.csv/. ## Fixed: 4d_systems_esp32s3_gen4_r8n16 partitions `esp_sr_16.csv` -> `default_16MB.csv` per upstream. ## Fixed: validator whitelist for cmsis_dsp_lib (8 teensy boards) `build.cmsis_dsp_lib` was added by fbuild#300 (PR#313) as an intentional fbuild-only schema extension — Teensyduino's makefile picks the matching `arm_cortexM*_math` archive at link time, but fbuild needs it declared statically. The validator was flagging all 8 teensy variants because the diff treats every extra key in the actual asset as drift. Added `FBUILD_EXTENSION_BUILD_FIELDS` whitelist (currently just `cmsis_dsp_lib`) and strip those from the actual side before diffing. Documented in-place so future fbuild-only extensions have a place to land with a one-line note. ## Not in scope Remaining ~14 boards have configuration-choice drift (UM boards `-DARDUINO_USB_MODE=1` difference, m5stack variant rename, seeed_ xiao_esp32c6 USB defines, arduino_nano_esp32 BOARD_USES_HW_GPIO_NUMBERS vs BOARD_HAS_PIN_REMAP, um_tinys2 extras). Each requires a real decision about which value is correct for fbuild's compile path — not auto-resolvable by a snapshot rebase. Leaving those for a separate maintainer-driven sweep.
1 parent 8d8fb32 commit 872a291

20 files changed

Lines changed: 38 additions & 26 deletions

ci/validate_boards.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@
2727
# Must match enrich_boards.rs exactly
2828
BUILD_FIELDS = ("core", "variant", "extra_flags", "f_cpu", "f_flash", "f_image", "flash_mode", "mcu")
2929
ARDUINO_FIELDS = ("ldscript", "partitions", "memory_type")
30+
31+
# Intentional fbuild-only extensions to the board schema that PlatformIO does
32+
# not carry upstream. Stripped from the actual side before diffing so they
33+
# aren't reported as drift. Keep this list short and document why each entry
34+
# is here — every addition is a place where fbuild semantically extends PIO.
35+
FBUILD_EXTENSION_BUILD_FIELDS = frozenset(
36+
{
37+
# Teensy 3.x/4.x CMSIS-DSP per-MCU library name (FastLED/fbuild#300).
38+
# PlatformIO leaves this implicit and lets Teensyduino's makefile pick
39+
# the matching `-l...` flag; fbuild needs it declared so the linker can
40+
# auto-link the right `arm_cortexM*_math` archive.
41+
"cmsis_dsp_lib",
42+
}
43+
)
3044
UPLOAD_FIELDS = (
3145
"protocol",
3246
"speed",
@@ -208,6 +222,10 @@ def validate_board(board_path: Path, pio_dir: Path) -> list[str] | None:
208222
if isinstance(pio_build, dict):
209223
expected_build = extract_build(pio_build)
210224
actual_build = board.get("build", {})
225+
# Strip intentional fbuild-only extensions from the actual side so
226+
# they aren't reported as drift (see FBUILD_EXTENSION_BUILD_FIELDS).
227+
if isinstance(actual_build, dict) and any(k in actual_build for k in FBUILD_EXTENSION_BUILD_FIELDS):
228+
actual_build = {k: v for k, v in actual_build.items() if k not in FBUILD_EXTENSION_BUILD_FIELDS}
211229
if expected_build and expected_build != actual_build:
212230
diffs.extend(diff_dicts(expected_build, actual_build, "build"))
213231

@@ -268,13 +286,7 @@ def run_external_comparison(output_json: bool = False) -> int:
268286
"external_board_count": total_external,
269287
"missing_count": total_missing,
270288
"errors": [{"source": r.source_id, "error": r.error} for r in errors],
271-
"missing_by_source": {
272-
src: [
273-
{"name": b.name, "architecture": b.architecture, "vendor": b.vendor}
274-
for b in boards
275-
]
276-
for src, boards in sorted(missing.items())
277-
},
289+
"missing_by_source": {src: [{"name": b.name, "architecture": b.architecture, "vendor": b.vendor} for b in boards] for src, boards in sorted(missing.items())},
278290
}
279291
print(json.dumps(out, indent=2))
280292
else:

crates/fbuild-config/assets/boards/json/4d_systems_esp32s3_gen4_r8n16.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
55
"memory_type": "qio_opi",
6-
"partitions": "esp_sr_16.csv"
6+
"partitions": "default_16MB.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ESP32_S3R8N16 -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s2_out.ld",
55
"memory_type": "qio_qspi",
6-
"partitions": "tinyuf2-partitions-4MB.csv"
6+
"partitions": "partitions-4MB-tinyuf2.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=1",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s2_reversetft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"arduino": {
44
"ldscript": "esp32s2_out.ld",
5-
"partitions": "tinyuf2-partitions-4MB.csv"
5+
"partitions": "partitions-4MB-tinyuf2.csv"
66
},
77
"core": "esp32",
88
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=1",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s2_tft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s2_out.ld",
55
"memory_type": "qio_qspi",
6-
"partitions": "tinyuf2-partitions-4MB.csv"
6+
"partitions": "partitions-4MB-tinyuf2.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=1",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
5-
"partitions": "tinyuf2-partitions-4MB.csv"
5+
"partitions": "partitions-4MB-tinyuf2.csv"
66
},
77
"core": "esp32",
88
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S3 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DBOARD_HAS_PSRAM",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s3_nopsram.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
55
"memory_type": "qio_qspi",
6-
"partitions": "tinyuf2-partitions-8MB.csv"
6+
"partitions": "partitions-8MB-tinyuf2.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s3_reversetft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
55
"memory_type": "qio_qspi",
6-
"partitions": "tinyuf2-partitions-4MB.csv"
6+
"partitions": "partitions-4MB-tinyuf2.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DBOARD_HAS_PSRAM",

crates/fbuild-config/assets/boards/json/adafruit_feather_esp32s3_tft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
55
"memory_type": "qio_qspi",
6-
"partitions": "tinyuf2-partitions-4MB.csv"
6+
"partitions": "partitions-4MB-tinyuf2.csv"
77
},
88
"core": "esp32",
99
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DBOARD_HAS_PSRAM",

crates/fbuild-config/assets/boards/json/adafruit_funhouse_esp32s2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"arduino": {
44
"ldscript": "esp32s2_out.ld",
5-
"partitions": "tinyuf2-partitions-4MB.csv"
5+
"partitions": "partitions-4MB-tinyuf2.csv"
66
},
77
"core": "esp32",
88
"extra_flags": "-DARDUINO_FUNHOUSE_ESP32S2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=1",

0 commit comments

Comments
 (0)