From cb34923842370bf2605564c83768608c655b53fe Mon Sep 17 00:00:00 2001 From: zackees Date: Tue, 30 Jun 2026 12:57:55 -0700 Subject: [PATCH] fix(core): match `nxp-lpc` (hyphenated GitHub form) in platform parser The FastLED LPC8xx fork ships from `github.com/FastLED/platform-nxp-lpc8xx.git`. The PlatformIO registry name is `nxplpc` (no separator), but the GitHub URL spells the family as `nxp-lpc` (hyphenated). `Platform::from_platform_str` only substring-matched `nxplpc`, so a `platform = https://github.com/ FastLED/platform-nxp-lpc8xx.git#` spec in platformio.ini was classified as unsupported and aborted the build with `unsupported platform: `. Match both spellings. Add a test for the hyphenated GitHub URL form and for the bare `nxplpc` registry name (the existing tests covered neither). Reported from a `bash compile lpc845brk --examples AutoResearch` attempt on fastled3 master against fbuild 2.3.14; the AutoResearch LPC845-BRK bring-up tracked in FastLED#3300 / FastLED#3348 cannot proceed without this matcher fix. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/fbuild-core/src/lib.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/fbuild-core/src/lib.rs b/crates/fbuild-core/src/lib.rs index c60e1e8c..8268f032 100644 --- a/crates/fbuild-core/src/lib.rs +++ b/crates/fbuild-core/src/lib.rs @@ -162,7 +162,11 @@ impl Platform { Some(Self::Ch32v) } else if s.contains("nordicnrf52") { Some(Self::NordicNrf52) - } else if s.contains("nxplpc") { + // FastLED/fbuild#XXX: GitHub URL form is `platform-nxp-lpc8xx` + // (hyphenated). PlatformIO registry name is `nxplpc` (no separator). + // Match both so a `platform = https://github.com/FastLED/ + // platform-nxp-lpc8xx.git#` spec in platformio.ini resolves. + } else if s.contains("nxplpc") || s.contains("nxp-lpc") { Some(Self::NxpLpc) } else if s.contains("renesas") { Some(Self::RenesasRa) @@ -570,6 +574,18 @@ mod tests { ), Some(Platform::AtmelAvr) ); + // FastLED LPC8xx fork uses the hyphenated GitHub form + // `platform-nxp-lpc8xx` (PlatformIO registry name is `nxplpc`). + assert_eq!( + Platform::from_platform_str( + "https://github.com/FastLED/platform-nxp-lpc8xx.git#12265f765aebd3893465d6d7ad76be66d89ba015" + ), + Some(Platform::NxpLpc) + ); + assert_eq!( + Platform::from_platform_str("nxplpc"), + Some(Platform::NxpLpc) + ); } #[test]