Skip to content

fix(ch32v): honor PlatformIO VCS platform source and package pins #1495

Closed

Description

@zackees

Actual reproducer

The CH32V platform manifest says version 1.1.0, but [email protected] is not published in the PlatformIO registry. PlatformIO cannot resolve either that pin or unpinned ch32v; the upstream project instructs users to install its GitHub source. The valid pinned source repro is:

[env:ch32v003]
platform = https://github.com/Community-PIO-CH32V/platform-ch32v.git#b7397c29a71101175bfc94f6ab06f9daac336458
board = genericCH32V003F4P6
framework = arduino

At this commit, platform.py sets FORCE_DOWNGRADE_TO_GCC8 = True. For Arduino on Linux it selects the default branch of toolchain-riscv-linux.git (GCC 8.2.0, riscv-none-embed-*) and the board-selected OpenWCH framework source. The old native fbuild adapter instead selected its fixed xPack GCC 14.2.0 and fixed framework commit. A registry pin such as [email protected] must fail clearly, never continue with those defaults.

Required behavior

  • Use the shared generic PlatformIO source/requirement resolver from meta: resolve PlatformIO package aliases and build requested stacks #1491. Resolve a selected CH32V VCS platform ref to an immutable commit and use its manifest, host-specific toolchain selection, board/core framework choice, and explicit platform_packages precedence. Preserve archive/URL overrides.
  • Resolve selected VCS packages to immutable commit archives and registry package pins to their exact host payloads/checksums. Do not substitute fbuild's default xPack/OpenWCH packages for an unavailable alias, ref, host, or unsupported package.
  • Discover the actual compiler executable family from the selected toolchain, preserve the selected board ISA/ABI, and include requested/resolved platform, compiler, and framework identities in build output. A changed resolved ref must invalidate the build fast path.
  • Keep unpinned bare platform = ch32v compatible with the legacy native defaults until a real registry alias exists.

Testing criteria

  • Offline core test: parse and lock the pinned VCS platform source, assert stable source identity, manifest package requirements, and explicit package-pin precedence. Generic host/payload and typed/qualified path cases remain covered by the shared core tests from meta: resolve PlatformIO package aliases and build requested stacks #1491.
  • Offline adapter tests: select Linux GCC 8/OpenWCH from a 1.1.0 platform fixture; cover explicit override precedence, unsupported hosts, and unavailable refs without fallback.
  • Real-source integration test: download the pinned platform/toolchain/framework in an isolated cache, verify GCC 8.2.0 and its executable prefix, and build the checked-in CH32V003 sketch. Assert requested/resolved identities in the build log.
  • Install check/dry-run must fail before fetching an uncached repository platform source.

Evidence

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

    Revalidation on 2026-09-27 found the short-name registry repro is invalid upstream: uvx --from platformio pio pkg show -t platform [email protected] reports Could not find ... package in the PlatformIO Registry; unpinned ch32v also fails. The registry API returns 404 for community-ch32v/platform/ch32v (control: platformio/platform/espressif32 returns 200). The upstream CH32V README instructs installation by GitHub URL, and its platform.json version 1.1.0 is not evidence of registry publication. I am treating the valid CH32V case as a GitHub/VCS platform source and checking its host-specific package resolution; the short alias must fail early rather than silently use fbuild defaults. The RED/GREEN criteria above need this correction before they can be claimed satisfied.

  3. zackees commented on Sep 27, 2026

    @zackees
    MemberAuthor

    Further correction from the actual platform source at commit b7397c29a71101175bfc94f6ab06f9daac336458 (manifest version 1.1.0): its platform.py sets FORCE_DOWNGRADE_TO_GCC8 = True and clears gcc_branch for Arduino, then selects the host-specific toolchain-riscv-linux.git default branch on Linux. That branch contains riscv-none-embed-gcc 8.2.0; #gcc12 is not selected for this pinned Arduino repro. The valid GitHub-source acceptance test must assert GCC 8.2.0 / riscv-none-embed-*, not GCC 12. I caught this by fetching the pinned platform archive in an isolated cache and running a real-source resolution test; the initial simplified fixture had missed the downgrade branch.

  4. changed the title [-]fix(ch32v): honor platform registry version and toolchain pins[/-] [+]fix(ch32v): honor PlatformIO VCS platform source and package pins[/+] on Sep 27, 2026
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