Skip to content

feat(nxplpc): honor platform_packages override for ArduinoCore-LPC8xx (#663) - #682

Merged
zackees merged 1 commit into
mainfrom
fix/663-nxplpc-platform-packages-override
Jun 20, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/663-nxplpc-platform-packages-override

Conversation

@zackees

@zackees zackees commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #663. PlatformIO honors `platform_packages = framework-arduino-lpc8xx@#` and re-clones the framework per-pin; fbuild silently dropped that line because `ArduinoCoreLpc8xx` exposed only a default constructor over its const-pinned URL + sha256, and the nxplpc orchestrator never read `platform_packages` from `env_config`. This blocked FastLED/FastLED#3325 (LPC845-BRK JSON-RPC echo regression bisection) on the fbuild backend.

  • `arduino_core_lpc8xx.rs`: add `with_override(project_dir, url, version)` — cache subdir keys on URL + version so the override never collides with the default-pinned install, and sha256 is skipped (consumer is explicitly pinning their own commit).
  • `nxplpc/platform_packages.rs` (new): parser for the PIO `platform_packages` multi-line value. Handles `owner/repo#ref` shorthand, `https://github.com/owner/repo.git#ref\`, raw `https://github.com/owner/repo#ref\`, and bare archive URLs.
  • `nxplpc/orchestrator.rs`: read the override after env_config is loaded, log an INFO banner (`ArduinoCore-LPC8xx OVERRIDE: (default pinned: )`) for terminal scrollback, and construct `with_override` when set.

Scope is intentionally nxplpc-only; #664 catalogs the same gap across the other 15 framework packages and is the home for the shared-helper generalization.

Test plan

  • `soldr cargo check -p fbuild-build -p fbuild-packages` — clean
  • `soldr cargo clippy -p fbuild-build -p fbuild-packages --all-targets -- -D warnings` — clean
  • `soldr cargo test -p fbuild-build --lib nxplpc::platform_packages` — 11/11 parser cases (shorthand / git URL / archive URL / multiline / comments / wrong-framework / missing-key / empty-ref) pass
  • `soldr cargo test -p fbuild-packages --lib library::arduino_core_lpc8xx` — 5/5 pass; new `override_uses_distinct_cache_path` confirms override + default install to different paths under the same cache root
  • End-to-end: `platform_packages = framework-arduino-lpc8xx@zackees/ArduinoCore-LPC8xx#` in an `[env:lpc845brk]` fixture should fetch and link the consumer-specified commit (acceptance: per-step bisection edit→compile completes in seconds, not minutes). CI will exercise this via the existing lpc8xx acceptance jobs; manual bisection is the downstream FastLED#3325 use case.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Framework package overrides are now configurable through environment settings, allowing users to specify custom ArduinoCore-LPC8xx versions and sources with support for GitHub, archive URLs, and shorthand specifications.

…#663)

PlatformIO honors `platform_packages = framework-arduino-lpc8xx@<URL>#<sha>`
and re-clones the framework per-pin, so consumers can bisect across upstream
commits with a one-line edit. fbuild silently dropped that line because
`ArduinoCoreLpc8xx` exposed only a default constructor over its const-pinned
URL + sha256, and the nxplpc orchestrator never read `platform_packages` from
`env_config`.

This blocked FastLED/FastLED#3325 (LPC845-BRK JSON-RPC echo regression
bisection) on the fbuild backend: each step would require editing
`arduino_core_lpc8xx.rs`, recomputing sha256, and rebuilding fbuild from
source instead of being a single `platformio.ini` edit + compile.

Changes:

- `arduino_core_lpc8xx.rs`: add `with_override(project_dir, url, version)`.
  Cache subdir keys on URL + version, so the override never collides with
  the default-pinned install. sha256 is skipped — the consumer is explicitly
  pinning their own commit.
- `nxplpc/platform_packages.rs` (new): parser for the PIO `platform_packages`
  multi-line value. Resolves the framework override to an archive URL + ref.
  Handles `owner/repo#ref` shorthand, `https://github.com/owner/repo.git#ref`,
  raw `https://github.com/owner/repo#ref`, and bare archive URLs.
- `nxplpc/orchestrator.rs`: look up the override after parsing the
  environment, log an INFO banner with `default pinned: <sha>` for terminal
  scrollback, and construct `with_override` when set.

Scope is intentionally nxplpc-only; #664 catalogs the same
gap across the other 15 framework packages and is the home for the
shared-helper generalization.

Tests:
- 11 parser cases (shorthand / git URL / archive URL / multiline /
  comments / wrong-framework / missing-key / empty-ref).
- `override_uses_distinct_cache_path` confirms the override and default
  produce different `install_path()`s under the same cache root.

Closes #663.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 73f7858b-aaf7-492d-a36e-3cfb1f246f78

📥 Commits

Reviewing files that changed from the base of the PR and between e165ea4 and e647a39.

📒 Files selected for processing (4)
  • crates/fbuild-build/src/nxplpc/mod.rs
  • crates/fbuild-build/src/nxplpc/orchestrator.rs
  • crates/fbuild-build/src/nxplpc/platform_packages.rs
  • crates/fbuild-packages/src/library/arduino_core_lpc8xx.rs

📝 Walkthrough

Walkthrough

Adds environment-configurable platform_packages override support for the NXP LPC8xx Arduino core. A new platform_packages.rs module parses and resolves PlatformIO-style framework override specs. ArduinoCoreLpc8xx gains a with_override constructor for override-pinned installs. The nxplpc orchestrator's build() is updated to conditionally select the override or default core.

Changes

NXP LPC8xx platform_packages override

Layer / File(s) Summary
ArduinoCoreLpc8xx override constructor and cache isolation
crates/fbuild-packages/src/library/arduino_core_lpc8xx.rs
Adds with_override(project_dir, url, version) using PackageBase::new without a sha256 checksum so override installs use cache paths distinct from the default pinned install. Adds a test-only with_override_and_cache_root helper and a unit test asserting path isolation.
platform_packages parsing and override resolution
crates/fbuild-build/src/nxplpc/mod.rs, crates/fbuild-build/src/nxplpc/platform_packages.rs
Adds PlatformPackageOverride struct and lookup_override / parse_platform_packages_entry functions. Resolves GitHub shorthand, GitHub URLs with optional .git, and direct archive URLs into (archive_url, git_ref). Unit tests cover all spec forms, multi-line scanning, comment/blank-line stripping, missing keys, and empty ref rejection.
Orchestrator override integration
crates/fbuild-build/src/nxplpc/orchestrator.rs
Replaces the unconditional ArduinoCoreLpc8xx::new in build() with an env-config lookup via platform_packages::lookup_override. When an override is found, emits/logs an OVERRIDE banner and constructs the core with ArduinoCoreLpc8xx::with_override; otherwise falls back to ArduinoCoreLpc8xx::new.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • FastLED/fbuild#488: Introduces the NxpLpcOrchestrator that this PR extends with the override lookup in build().
  • FastLED/fbuild#570: Establishes the ArduinoCoreLpc8xx vendoring flow in the nxplpc orchestrator that this PR extends with the with_override constructor and conditional selection.

Poem

🐇 Hop hop, I've found a brand new trail,
A platform_packages path without fail!
Parse the spec — shorthand or URL so neat,
with_override makes the cache complete.
No more silent ignores, the override glows,
With a banner in logs wherever it goes! 🌟

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/663-nxplpc-platform-packages-override

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit cd998e0 into main Jun 20, 2026
84 of 91 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 21, 2026
@zackees
zackees deleted the fix/663-nxplpc-platform-packages-override branch October 16, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

nxplpc: framework-arduino-lpc8xx pin is hardcoded — platform_packages override in platformio.ini is silently ignored (blocks FastLED#3325 bisection)

1 participant