Skip to content

fix(mcu): honor AVR framework registry package pins #1494

Closed

Description

@zackees

Context

The AVR resolver accepts a registry-version platform_packages entry but builds with the family default. A focused repro uses the existing tests/platform/atmega8 board fixture:

[env:atmega8]
platform = atmelavr
board = ATmega8
framework = arduino
platform_packages = framework-arduino-avr-minicore@3.1.0

The ATmega8 board metadata selects core = MiniCore (crates/fbuild-config/assets/boards/json/ATmega8.json). The PlatformIO platform-atmelavr manifest maps the MiniCore framework to package framework-arduino-avr-minicore with version ~3.1.0. fbuild’s registry-version warning recognizes the pin, but avr_packages only resolves URL overrides for framework-arduino-avr and framework-arduino-avr-attiny; avr_framework_package routes those overrides only for core keys arduino, tiny, and tinymodern. MiniCore falls through to AvrFramework::for_core, whose embedded registry resolves MCUdude/MiniCore 2.2.2 (crates/fbuild-library/assets/avr_frameworks.json). Thus an explicit registry framework pin can be accepted while fbuild selects its distinct 2.2.2 default.

This is separate from the completed URL-override wiring in #667 and #669: those cover the standard Arduino AVR and ATTiny canonical keys, not registry semver resolution for other AVR package names.

Proposal

Resolve valid AVR platform = name@version and platform_packages = package@version aliases against PlatformIO platform/package metadata, including core-specific framework mappings, and build with the requested packages. Fail before compilation only for unavailable versions or genuinely unsupported inputs. Keep standard AVR and ATTiny URL/archive override behavior intact.

PlatformIO alias requirement

Resolve PlatformIO-hosted platform and framework package aliases to exact archive URLs/checksums. The AVR core-to-package map must select the requested registry package, including MiniCore, rather than applying a generic AVR default; preserve explicit URL overrides.

Acceptance criteria

  • RED: add a focused resolution test or isolated build with the ini above and show the requested MiniCore package 3.1.0 is currently replaced with fbuild’s 2.2.2 default; cover that the warning does not make the pin effective.
  • GREEN: valid published AVR platform and framework package aliases resolve their requested versions plus compatible dependencies and build with them; the MiniCore 3.1.0 repro no longer selects the 2.2.2 default. Unavailable or unsupported aliases fail before compilation; rejecting a valid supported alias is not completion.
  • Cover core-specific package mappings, including MiniCore and the already-wired standard AVR / ATTiny packages; preserve URL/archive overrides.
  • Make requested and resolved framework/toolchain versions visible in output or machine-readable build metadata.
  • Unit tests: table-drive AtmelAvr and AtmelMegaAvr registry/manifest fixtures through the shared fbuild-core resolver, including MiniCore 3.1.0, Arduino AVR, and ATTiny package names; assert board-core mapping, exact payload URL/checksum, override precedence, and no fallback to the embedded 2.2.2 MiniCore default.

Decisions

  • Group AVR and megaAVR resolver work under this family because the AVR framework JSON and orchestrator are shared; this report uses the concrete atmelavr MiniCore mismatch.
  • Treat an explicit framework registry pin substituted by a family default as a correctness and reproducibility defect, even when fbuild emits the A pinned platform version is silently ignored — in platform and in platform_packages #1407 warning.
  • Use ATmega8 as the minimal repro because its checked-in board metadata selects MiniCore, making the actual default package unambiguous.

Related issues

Core and AVR testing gate

  • RED → GREEN: add failing exact-payload assertions for AVR and megaAVR to the shared offline fbuild-core generic-path suite before changing their adapters. Include MiniCore 3.1.0, standard Arduino AVR, and ATTiny; generic short, owner-qualified, and typed paths must resolve independently of the native platform enum.
  • Assert exact platform/framework/toolchain payload version, host URL/SHA-256, stable cache identity, manifest dependencies, board-core mapping, and explicit platform_packages precedence. The MiniCore fixture must never resolve to fbuild's embedded 2.2.2 default.
  • Separate AVR/megaAVR adapter/build tests must consume those core results, preserve URL/archive overrides, and report requested versus resolved identities. The shared core suite runs offline in CI without PlatformIO or compiler downloads.

Activity

  1. zackees commented on Sep 26, 2026

    @zackees
    MemberAuthor

    Testing-criteria clarification: this child’s representative platform fixture must pass through the public, platform-agnostic fbuild-core resolver specified in #1491, then through its native adapter. Assert the exact requested payload/source identities (including host-specific URL and checksum when published), manifest dependency and explicit override precedence, and no substitution by the family default. Core unit tests must also cover synthetic unknown-platform and generic PlatformIO package paths independently of native build support. Keep offline unit tests separate from the actual compile/build integration repro.

  2. zackees commented on Sep 27, 2026

    @zackees
    MemberAuthor

    Registry verification (2026-09-27): PlatformIO currently publishes framework-arduino-avr-minicore versions 3.1.2, 3.0.2, and 2.2.2, but not exact 3.1.0. The atmelavr manifest declares ~3.1.0, which can select the published 3.1.2 payload; platform_packages = framework-arduino-avr-minicore@3.1.0 must instead fail before compilation as unavailable, never fall back to fbuild’s embedded 2.2.2. I will use exact @3.1.2 for the successful pinned-build test and keep @3.1.0 as the unavailable-version regression. Registry source: https://api.registry.platformio.org/v3/packages/platformio/tool/framework-arduino-avr-minicore .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions