From 0451874509bfd00a625103eb8c5fc4558955b11b Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sat, 28 Mar 2026 22:11:21 +0800 Subject: [PATCH] Add win-arm64 platform support to tools schema The ESP-IDF tools.json manifest added a win-arm64 platform variant for Windows ARM64. Add it to PlatformOverrideInfoPlatformsItem enum, VersionInfo struct, and the OS matcher in parse_tools to prevent panics when parsing manifests that include this platform. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 1 + src/espidf.rs | 1 + src/espidf/tools_schema.rs | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41bc881..e07c3c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [main] - TBD - Add CACHEDIR.TAG to idf and pio temporary directories, to prevent Linux backups from picking them up (see TODO, no support is added for MacOS/Windows). +- Fix build on esp-idf master branch (new platform). ## [0.33.1] - 2025-07-27 - Fix a bug where the cmake utilities refused to work with CMake 4 due to a broken version check diff --git a/src/espidf.rs b/src/espidf.rs index 5b2ba1f..ee1b095 100644 --- a/src/espidf.rs +++ b/src/espidf.rs @@ -257,6 +257,7 @@ fn parse_tools( ("macos", "aarch64") => info.macos_arm64.clone(), ("windows", "x86") => info.win32.clone(), ("windows", "x86_64") => info.win64.clone(), + ("windows", "aarch64") => info.win_arm64.clone(), _ => None, } }; diff --git a/src/espidf/tools_schema.rs b/src/espidf/tools_schema.rs index 1676fd1..a304ae6 100644 --- a/src/espidf/tools_schema.rs +++ b/src/espidf/tools_schema.rs @@ -409,6 +409,8 @@ pub(crate) enum PlatformOverrideInfoPlatformsItem { Win32, #[serde(rename = "win64")] Win64, + #[serde(rename = "win-arm64")] + WinArm64, } impl From<&PlatformOverrideInfoPlatformsItem> for PlatformOverrideInfoPlatformsItem { fn from(value: &PlatformOverrideInfoPlatformsItem) -> Self { @@ -426,6 +428,7 @@ impl ToString for PlatformOverrideInfoPlatformsItem { Self::MacosArm64 => "macos-arm64".to_string(), Self::Win32 => "win32".to_string(), Self::Win64 => "win64".to_string(), + Self::WinArm64 => "win-arm64".to_string(), } } } @@ -441,6 +444,7 @@ impl std::str::FromStr for PlatformOverrideInfoPlatformsItem { "macos-arm64" => Ok(Self::MacosArm64), "win32" => Ok(Self::Win32), "win64" => Ok(Self::Win64), + "win-arm64" => Ok(Self::WinArm64), _ => Err("invalid value".into()), } } @@ -735,6 +739,8 @@ pub(crate) struct VersionInfo { pub(crate) win32: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub(crate) win64: Option, + #[serde(rename = "win-arm64", default, skip_serializing_if = "Option::is_none")] + pub(crate) win_arm64: Option, } impl From<&VersionInfo> for VersionInfo { fn from(value: &VersionInfo) -> Self {