Skip to content

Switch CI board manager URL to the CN package index#219

Merged
lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:ai/ci-board-manager-url
Jul 7, 2026
Merged

Switch CI board manager URL to the CN package index#219
lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:ai/ci-board-manager-url

Conversation

@ainyan03

@ainyan03 ainyan03 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The M5Stack board manager index used by the Arduino build CI,
https://static-cdn.m5stack.com/resource/arduino/package_m5stack_index.json, currently returns 404, breaking all m5stack:esp32 matrix entries.

This PR makes the CI resilient to that outage without changing the matrix URLs:

  1. Index URL auto-selection: the primary index URL is tried first; if unreachable, CI falls back to the _cn variant (package_m5stack_index_cn.json, currently reachable). When the upstream index recovers, CI automatically returns to the primary with no further changes.
  2. Index patching: the CN index renames all tools with a -cn suffix, but the toolsDependencies of older platforms (2.x and <= 3.2.1) still reference the pre-rename versions, so m5stack:esp32@2.1.4 fails with tool version esp-2021r2-patch5-8.4.0 not found (155 such stale entries overall). A small script rewrites those dependencies to their -cn equivalents; it is a no-op on a consistent index. The fetched index is used locally via file://.

Verification

  • Primary URL: HTTP 404 (confirmed 2026-07-07); no alternative mirror of the non-CN index found.
  • CN URL: HTTP 200, contains both platform versions used by the CI matrix (2.1.4, 3.2.5); all download hosts it references verified reachable.
  • Fallback loop verified locally: primary 404 -> falls back to CN -> patch fixes 155 stale entries.
  • With the patched index, arduino-cli core install m5stack:esp32@2.1.4 resolves dependencies and starts the toolchain download (verified locally); the unpatched CN index fails dependency resolution.
  • First CI run on this PR confirmed the diagnosis: 3.2.5 passed with the CN index, 2.1.4 failed exactly on the stale dependency.

Note: since CI is currently broken on develop, merging this first will let other open PRs (e.g. #218) run a meaningful Arduino build check.

The M5Stack board manager index at
https://static-cdn.m5stack.com/resource/arduino/package_m5stack_index.json
currently returns 404, which breaks the Arduino build CI for the
m5stack:esp32 matrix entries.

Switch to package_m5stack_index_cn.json, which is reachable (HTTP 200)
and contains both platform versions used by the CI matrix (2.1.4 and
3.2.5). The package and tool download URLs it references
(static-cdn.m5stack.com, m5stack.oss-cn-shenzhen.aliyuncs.com,
dl.espressif.cn) were all verified reachable as well.
The CN index renames all tools with a "-cn" suffix but the
toolsDependencies of older platforms (2.x and <= 3.2.1) still reference
the pre-rename versions, so arduino-cli fails to install
m5stack:esp32@2.1.4 with "tool version esp-2021r2-patch5-8.4.0 not
found" (155 such stale entries in the index overall).

Fetch the index in CI, rewrite those dependencies to their "-cn"
equivalents, and use the patched file as a local (file://) index.
Verified locally: dependency resolution succeeds and the toolchain
download starts with the patched index.
lovyan03 pushed a commit to ainyan03/M5Unified that referenced this pull request Jul 7, 2026
The CN index renames all tools with a "-cn" suffix but the
toolsDependencies of older platforms (2.x and <= 3.2.1) still reference
the pre-rename versions, so arduino-cli fails to install
m5stack:esp32@2.1.4 with "tool version esp-2021r2-patch5-8.4.0 not
found" (155 such stale entries in the index overall).

Fetch the index in CI, rewrite those dependencies to their "-cn"
equivalents, and use the patched file as a local (file://) index.
Verified locally: dependency resolution succeeds and the toolchain
download starts with the patched index.

Same fix as m5stack/M5GFX#219.
Instead of hardcoding the CN index, keep the primary index URL in the
matrix and fall back to the "_cn" variant only when the primary is
unreachable. When the upstream index recovers, CI automatically returns
to it with no further changes. The patch script runs on whichever index
was fetched and is a no-op when the index is consistent.

Verified locally: with the primary currently 404, the loop falls back
to the CN index and the patch step fixes its 155 stale entries.
lovyan03 pushed a commit to ainyan03/M5Unified that referenced this pull request Jul 7, 2026
Instead of hardcoding the CN index, keep the primary index URL in the
matrix and fall back to the "_cn" variant only when the primary is
unreachable. When the upstream index recovers, CI automatically returns
to it with no further changes. The patch script runs on whichever index
was fetched and is a no-op when the index is consistent.

Verified locally: with the primary currently 404, the loop falls back
to the CN index and the patch step fixes its 155 stale entries.

Same fix as m5stack/M5GFX#219.
@lovyan03
lovyan03 merged commit 70b9d22 into m5stack:develop Jul 7, 2026
23 checks passed
@lovyan03
lovyan03 deleted the ai/ci-board-manager-url branch July 7, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants