Skip to content

fix(esp8266): honor registry version pins #1496

Closed

Description

@zackees

Context

An older valid ESP8266 PlatformIO platform release pins a different Arduino core generation, but fbuild accepts the request, warns, then succeeds with its const-pinned framework instead.

Minimal repro:

[env:esp8266]
platform = [email protected]
board = nodemcuv2
framework = arduino

PlatformIO registry metadata for platformio/espressif8266 4.0.1 (downloaded from https://dl.registry.platformio.org/download/platformio/platform/espressif8266/4.0.1/espressif8266-4.0.1.tar.gz) declares:

  • framework-arduinoespressif8266 ~3.30002.0, which resolves to registry version 3.30002.0 / Arduino ESP8266 core 3.0.2.
  • toolchain-xtensa ~2.100300.0, which resolves to 2.100300.220621 / GCC 10.3.0.

Observed fbuild selection for the same ini: build warning says platform 4.0.1 is ignored; output reports GCC 10.3.0; the daemon log records downloading/installing esp8266-arduino 3.1.2; firmware.elf and firmware.bin are produced and the build exits 0. Thus the build uses Arduino framework 3.1.2 (and its bundled SDK) instead of the requested 3.0.2 package generation. The toolchain GCC major/minor happens to match, but fbuild’s package pin 3.2.0-gcc10.3 is not the PlatformIO registry pin 2.100300.220621.

Repro evidence from the audit run:

  • Isolated ini: /tmp/fbuild-esp8266-registry-audit.sK0hxd/platformio.ini
  • Build command: FBUILD_DEV_MODE=1 FBUILD_NO_UPDATE_CHECK=1 target/debug/fbuild build /tmp/fbuild-esp8266-registry-audit.sK0hxd -e esp8266 --no-timestamp
  • Build output: successful, with the ignored-pin warning and 3.1.2 framework fetch.
  • Daemon log: /home/niteris/.fbuild/dev/daemon/daemon.log, entries around 2026-09-26 22:38:11–22:38:20 show download, extraction, installation of esp8266-arduino v3.1.2 and “ESP8266 framework ready”.
  • Selection code: crates/fbuild-build-esp/src/esp8266/orchestrator.rs::esp8266_packages and crates/fbuild-library/src/library/esp8266_framework.rs (fixed 3.1.2 release); toolchain pin in crates/fbuild-toolchain/src/toolchain/esp8266.rs.
  • PlatformIO package metadata archive above contains platform.json with the 4.0.1 framework/toolchain constraints.

Root path and impact

esp8266_packages only calls resolve_override for URL/archive forms of framework-arduinoespressif8266. For a registry-version platform pin, no platform or platform.json is resolved; it constructs Esp8266Toolchain::new and Esp8266Framework::new. The shared ignored_version_pins path adds a warning but does not stop the build. Registry-version entries under platform_packages likewise parse to no override and fall through to the same defaults.

A consumer targeting the 3.0.2 framework/API/SDK receives a successful firmware built against 3.1.2 instead, so the ini is not a reproducible description of the artifact.

PlatformIO alias requirement

Resolve the short or owner-qualified ESP8266 platform alias through PlatformIO registry metadata to the exact platform archive, then follow its framework/toolchain requirements and any explicit platform_packages aliases. The resolver must use PlatformIO-hosted artifacts or their verified source URLs, not the unrelated fbuild defaults.

Acceptance criteria

  • RED: preserve this 4.0.1 fixture and capture that fbuild exits successfully, warns that 4.0.1 is ignored, and selects framework 3.1.2 rather than registry framework 3.30002.0 / Arduino core 3.0.2.
  • GREEN: valid ESP8266 platform and package registry aliases resolve their requested platform/framework/toolchain/SDK package set and build with it; [email protected] selects the 3.0.2 Arduino core generation, not fbuild's 3.1.2 default. Invalid/unavailable versions or unsupported hosts fail early; refusing this valid alias is not completion.
  • URL/archive overrides for framework-arduinoespressif8266 continue to work.
  • Build output or machine-readable metadata identifies requested and resolved versions.
  • Unit tests: feed an offline [email protected] registry/platform-manifest fixture through the shared fbuild-core resolver and assert the 3.0.2-generation framework plus the platform's toolchain package payloads, URL/checksum and host choice; also assert an explicit platform_packages framework alias wins over the manifest default and no 3.1.2 fallback occurs.

Decisions

  • Scope this child to ESP8266 registry-version pins for both platform and framework packages; they share one fixed-package resolver path.
  • The concrete failure is the framework/SDK generation mismatch. GCC 10.3.0’s numeric version overlaps, but its PlatformIO package version and artifact are not selected from the requested registry release.
  • Require actual resolution and build support for valid published aliases; warnings, default substitution, or early refusal of a valid alias are insufficient.
  • Priority P1 because a successful build can silently produce a different framework/SDK generation from the explicit configuration.

Related issues

Core and ESP8266 testing gate

  • RED → GREEN: add the [email protected] counterexample to the shared offline fbuild-core generic-path suite before changing the ESP8266 adapter. Resolve short, owner-qualified, and typed platform/package paths independently of the native platform enum.
  • Assert the exact platform payload and host-specific URL/SHA-256, cache identity, and manifest-derived Arduino core 3.0.2-generation framework plus toolchain/SDK dependencies. An explicit framework package pin must win over the manifest default; neither may fall back to fbuild's 3.1.2 framework.
  • A separate ESP8266 adapter/build test must consume that core result, preserve URL/archive overrides, and report requested versus resolved identities. Shared core tests run 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.

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