From 6a347f1f09b0076af868dcd63d9139081c92172b Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 14 Aug 2025 13:36:39 +0200 Subject: feat: add semver checks and releasing to releaser * List dependencies of a crate * List dependents of a crate * Perform semver-checks of a crate * Prepare a release for a crate and all dependents * Use a single release.toml for cargo-release * Add changelogs where missing --- cyw43-pio/release.toml | 5 - cyw43/release.toml | 5 - embassy-boot/CHANGELOG.md | 11 + embassy-embedded-hal/release.toml | 5 - embassy-executor/release.toml | 5 - embassy-futures/release.toml | 5 - embassy-net-adin1110/CHANGELOG.md | 11 + embassy-net-driver-channel/release.toml | 5 - embassy-net-driver/CHANGELOG.md | 3 + embassy-net-esp-hosted/CHANGELOG.md | 11 + embassy-net-nrf91/CHANGELOG.md | 13 + embassy-net-nrf91/Cargo.toml | 4 +- embassy-net-ppp/CHANGELOG.md | 3 + embassy-net-wiznet/CHANGELOG.md | 13 + embassy-net/CHANGELOG.md | 3 +- embassy-nrf/release.toml | 5 - embassy-release/Cargo.toml | 12 - embassy-release/src/main.rs | 303 ------------------- embassy-rp/release.toml | 5 - embassy-stm32/release.toml | 5 - embassy-sync/CHANGELOG.md | 3 +- embassy-time-driver/release.toml | 5 - embassy-time-queue-utils/CHANGELOG.md | 3 +- embassy-time/release.toml | 5 - embassy-usb-dfu/CHANGELOG.md | 11 + embassy-usb-driver/release.toml | 5 - embassy-usb-logger/CHANGELOG.md | 3 +- embassy-usb-synopsys-otg/CHANGELOG.md | 3 +- embassy-usb/release.toml | 5 - release/Cargo.toml | 15 + release/config.toml | 45 +++ release/release.toml | 5 + release/src/main.rs | 519 ++++++++++++++++++++++++++++++++ 33 files changed, 672 insertions(+), 387 deletions(-) delete mode 100644 cyw43-pio/release.toml delete mode 100644 cyw43/release.toml create mode 100644 embassy-boot/CHANGELOG.md delete mode 100644 embassy-embedded-hal/release.toml delete mode 100644 embassy-executor/release.toml delete mode 100644 embassy-futures/release.toml create mode 100644 embassy-net-adin1110/CHANGELOG.md delete mode 100644 embassy-net-driver-channel/release.toml create mode 100644 embassy-net-esp-hosted/CHANGELOG.md create mode 100644 embassy-net-nrf91/CHANGELOG.md create mode 100644 embassy-net-wiznet/CHANGELOG.md delete mode 100644 embassy-nrf/release.toml delete mode 100644 embassy-release/Cargo.toml delete mode 100644 embassy-release/src/main.rs delete mode 100644 embassy-rp/release.toml delete mode 100644 embassy-stm32/release.toml delete mode 100644 embassy-time-driver/release.toml delete mode 100644 embassy-time/release.toml create mode 100644 embassy-usb-dfu/CHANGELOG.md delete mode 100644 embassy-usb-driver/release.toml delete mode 100644 embassy-usb/release.toml create mode 100644 release/Cargo.toml create mode 100644 release/release.toml create mode 100644 release/src/main.rs diff --git a/cyw43-pio/release.toml b/cyw43-pio/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/cyw43-pio/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/cyw43/release.toml b/cyw43/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/cyw43/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-boot/CHANGELOG.md b/embassy-boot/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-boot/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. diff --git a/embassy-embedded-hal/release.toml b/embassy-embedded-hal/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-embedded-hal/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-executor/release.toml b/embassy-executor/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-executor/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-futures/release.toml b/embassy-futures/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-futures/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-net-adin1110/CHANGELOG.md b/embassy-net-adin1110/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-net-adin1110/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. diff --git a/embassy-net-driver-channel/release.toml b/embassy-net-driver-channel/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-net-driver-channel/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-net-driver/CHANGELOG.md b/embassy-net-driver/CHANGELOG.md index 165461eff..0c7c27d6e 100644 --- a/embassy-net-driver/CHANGELOG.md +++ b/embassy-net-driver/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased - ReleaseDate + ## 0.2.0 - 2023-10-18 - Added support for IEEE 802.15.4 mediums. diff --git a/embassy-net-esp-hosted/CHANGELOG.md b/embassy-net-esp-hosted/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-net-esp-hosted/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. diff --git a/embassy-net-nrf91/CHANGELOG.md b/embassy-net-nrf91/CHANGELOG.md new file mode 100644 index 000000000..52cbf5ef3 --- /dev/null +++ b/embassy-net-nrf91/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-14 + +- First release with changelog. diff --git a/embassy-net-nrf91/Cargo.toml b/embassy-net-nrf91/Cargo.toml index 9201dc84c..387627491 100644 --- a/embassy-net-nrf91/Cargo.toml +++ b/embassy-net-nrf91/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "embassy-net-nrf91" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "embassy-net driver for Nordic nRF91-series cellular modems" keywords = ["embedded", "nrf91", "embassy-net", "cellular"] @@ -36,4 +36,4 @@ target = "thumbv7em-none-eabi" features = ["defmt", "nrf-pac/nrf9160"] [package.metadata.docs.rs] -features = ["defmt"] +features = ["defmt", "nrf-pac/nrf9160"] diff --git a/embassy-net-ppp/CHANGELOG.md b/embassy-net-ppp/CHANGELOG.md index 6ce64ddcb..b364608d2 100644 --- a/embassy-net-ppp/CHANGELOG.md +++ b/embassy-net-ppp/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased - ReleaseDate + ## 0.2.0 - 2025-01-12 - Update `ppproto` to v0.2. diff --git a/embassy-net-wiznet/CHANGELOG.md b/embassy-net-wiznet/CHANGELOG.md new file mode 100644 index 000000000..52cbf5ef3 --- /dev/null +++ b/embassy-net-wiznet/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-14 + +- First release with changelog. diff --git a/embassy-net/CHANGELOG.md b/embassy-net/CHANGELOG.md index 8773772ce..39bc6c0f0 100644 --- a/embassy-net/CHANGELOG.md +++ b/embassy-net/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + +## Unreleased - ReleaseDate No unreleased changes yet... Quick, go send a PR! diff --git a/embassy-nrf/release.toml b/embassy-nrf/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-nrf/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-release/Cargo.toml b/embassy-release/Cargo.toml deleted file mode 100644 index de548e650..000000000 --- a/embassy-release/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "embassy-release" -version = "0.1.0" -edition = "2021" - -[dependencies] -clap = { version = "4.5.1", features = ["derive"] } -walkdir = "2.5.0" -toml = "0.8.8" -toml_edit = { version = "0.23.1", features = ["serde"] } -serde = { version = "1.0.198", features = ["derive"] } -regex = "1.10.4" diff --git a/embassy-release/src/main.rs b/embassy-release/src/main.rs deleted file mode 100644 index 321d3872c..000000000 --- a/embassy-release/src/main.rs +++ /dev/null @@ -1,303 +0,0 @@ -use std::collections::{HashMap, HashSet}; -use std::fs; -use std::path::{Path, PathBuf}; -use std::process::Command as ProcessCommand; - -use clap::{Parser, Subcommand, ValueEnum}; -use regex::Regex; -use serde::Deserialize; -use toml_edit::{DocumentMut, Item, Value}; -use walkdir::WalkDir; - -/// Tool to traverse and operate on intra-repo Rust crate dependencies -#[derive(Parser, Debug)] -#[command(author, version, about)] -struct Args { - /// Path to the root crate - #[arg(value_name = "CRATE_PATH")] - crate_path: PathBuf, - - /// Command to perform on each crate - #[command(subcommand)] - command: Command, - - /// Traversal order - #[arg(short, long, default_value = "post")] - order: TraversalOrder, -} - -#[derive(Debug, Clone, ValueEnum, PartialEq)] -enum TraversalOrder { - Pre, - Post, -} - -#[derive(Debug, Subcommand)] -enum Command { - /// Print all dependencies - Dependencies, - - /// Release crate - Release { - #[command(subcommand)] - kind: ReleaseKind, - }, -} - -#[derive(Debug, Subcommand, Clone, Copy, PartialEq)] -enum ReleaseKind { - Patch, - Minor, -} - -#[derive(Debug, Deserialize)] -struct CargoToml { - package: Option, - dependencies: Option, -} - -#[derive(Debug, Deserialize)] -struct Package { - name: String, - version: Option, -} - -#[derive(Debug, Deserialize)] -#[serde(untagged)] -enum Dep { - Version(String), - DetailedTable(HashMap), -} - -type Deps = std::collections::HashMap; - -#[derive(Debug, Deserialize)] -struct CrateConfig { - features: Option>, - target: Option, -} - -type ReleaseConfig = HashMap; - -fn find_path_deps(cargo_path: &Path) -> Vec { - let content = fs::read_to_string(cargo_path).unwrap_or_else(|_| { - panic!("Failed to read {:?}", cargo_path); - }); - let parsed: CargoToml = toml::from_str(&content).unwrap_or_else(|e| { - panic!("Failed to parse {:?}: {}", cargo_path, e); - }); - - let mut paths = vec![]; - if let Some(deps) = parsed.dependencies { - for (_name, dep) in deps { - match dep { - Dep::Version(_) => { - // External dependency — skip - } - Dep::DetailedTable(table) => { - if let Some(toml::Value::String(path)) = table.get("path") { - let dep_path = cargo_path.parent().unwrap().join(path).canonicalize().unwrap(); - paths.push(dep_path); - } - } - } - } - } - - paths -} - -fn visit_recursive( - root_crate: &Path, - visited: &mut HashSet, - output: &mut Vec, - order: &TraversalOrder, -) { - if !visited.insert(root_crate.to_path_buf()) { - return; - } - - let cargo_toml = root_crate.join("Cargo.toml"); - let deps = find_path_deps(&cargo_toml); - - if *order == TraversalOrder::Pre { - output.push(root_crate.to_path_buf()); - } - - let mut deps_sorted = deps; - deps_sorted.sort(); - for dep in deps_sorted { - visit_recursive(&dep, visited, output, order); - } - - if *order == TraversalOrder::Post { - output.push(root_crate.to_path_buf()); - } -} - -fn get_crate_metadata(crate_path: &Path) -> Option<(String, String)> { - let cargo_toml = crate_path.join("Cargo.toml"); - let content = fs::read_to_string(&cargo_toml).ok()?; - let parsed: CargoToml = toml::from_str(&content).ok()?; - let pkg = parsed.package?; - let name = pkg.name; - let version = pkg.version?; - Some((name, version)) -} - -fn load_release_config() -> ReleaseConfig { - let config_path = PathBuf::from("release/config.toml"); - if !config_path.exists() { - return HashMap::new(); - } - let content = fs::read_to_string(&config_path).expect("Failed to read release/config.toml"); - toml::from_str(&content).expect("Invalid TOML format in release/config.toml") -} - -fn bump_dependency_versions(crate_name: &str, new_version: &str) -> Result<(), String> { - let mut cargo_files: Vec = WalkDir::new(".") - .into_iter() - .filter_map(Result::ok) - .filter(|e| e.file_name() == "Cargo.toml") - .map(|e| e.into_path()) - .collect(); - - cargo_files.sort(); - - for path in cargo_files { - let content = fs::read_to_string(&path).map_err(|e| format!("Failed to read {}: {}", path.display(), e))?; - - let mut doc: DocumentMut = content - .parse() - .map_err(|e| format!("Failed to parse TOML in {}: {}", path.display(), e))?; - - let mut changed = false; - - for section in ["dependencies", "dev-dependencies", "build-dependencies"] { - if let Some(Item::Table(dep_table)) = doc.get_mut(section) { - if let Some(item) = dep_table.get_mut(crate_name) { - match item { - // e.g., foo = "0.1.0" - Item::Value(Value::String(_)) => { - *item = Item::Value(Value::from(new_version)); - changed = true; - } - // e.g., foo = { version = "...", ... } - Item::Value(Value::InlineTable(inline)) => { - if inline.contains_key("version") { - inline["version"] = Value::from(new_version); - changed = true; - } - } - _ => {} // Leave unusual formats untouched - } - } - } - } - - if changed { - fs::write(&path, doc.to_string()).map_err(|e| format!("Failed to write {}: {}", path.display(), e))?; - println!("🔧 Updated {} to {} in {}", crate_name, new_version, path.display()); - } - } - - Ok(()) -} - -fn run_release_command( - crate_path: &Path, - crate_name: &str, - version: &str, - kind: &ReleaseKind, - config: Option<&CrateConfig>, -) -> Result<(), String> { - let kind_str = match kind { - ReleaseKind::Patch => "patch", - ReleaseKind::Minor => "minor", - }; - - if *kind == ReleaseKind::Minor { - bump_dependency_versions(crate_name, version)?; - } - - let mut args: Vec = vec!["release".into(), kind_str.into()]; - - if let Some(cfg) = config { - if let Some(features) = &cfg.features { - args.push("--features".into()); - args.push(features.join(",")); - } - if let Some(target) = &cfg.target { - args.push("--target".into()); - args.push(target.clone()); - } - } - - let status = ProcessCommand::new("cargo") - .args(&args) - .current_dir(crate_path) - .status() - .map_err(|e| format!("Failed to run cargo release: {}", e))?; - - if !status.success() { - return Err(format!("`cargo release {}` failed in crate {}", kind_str, crate_name)); - } - - //args.push("--execute".into()); - //let status = ProcessCommand::new("cargo") - // .args(&args) - // .current_dir(crate_path) - // .status() - // .map_err(|e| format!("Failed to run cargo release --execute: {}", e))?; - - //if !status.success() { - // return Err(format!( - // "`cargo release {kind_str} --execute` failed in crate {crate_name}" - // )); - //} - - Ok(()) -} - -fn main() { - let args = Args::parse(); - let root = args.crate_path.canonicalize().expect("Invalid root crate path"); - - match args.command { - Command::Dependencies => { - let mut visited = HashSet::new(); - let mut ordered = vec![]; - visit_recursive(&root, &mut visited, &mut ordered, &args.order); - for path in ordered { - if let Some((name, _)) = get_crate_metadata(&path) { - println!("{name}"); - } else { - eprintln!("Warning: could not read crate name from {:?}", path); - } - } - } - Command::Release { kind } => { - let config = load_release_config(); - let path = root; - match get_crate_metadata(&path) { - Some((name, version)) => { - println!("🚀 Releasing {name}..."); - let crate_cfg = config.get(&name); - match run_release_command(&path, &name, &version, &kind, crate_cfg) { - Ok(_) => { - println!("✅ Released {name}"); - } - Err(e) => { - eprintln!("❌ Error releasing {name}:\n{e}"); - eprintln!("\nYou may retry with: `cargo run -- {path:?} release {kind:?}`"); - std::process::exit(1); - } - } - } - None => { - eprintln!("Warning: Could not parse crate metadata in {:?}", path); - } - } - } - } -} diff --git a/embassy-rp/release.toml b/embassy-rp/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-rp/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-stm32/release.toml b/embassy-stm32/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-stm32/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-sync/CHANGELOG.md b/embassy-sync/CHANGELOG.md index fa0340c68..7418ead8d 100644 --- a/embassy-sync/CHANGELOG.md +++ b/embassy-sync/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + +## Unreleased - ReleaseDate - Add `get_mut` to `LazyLock` - Add more `Debug` impls to `embassy-sync`, particularly on `OnceLock` diff --git a/embassy-time-driver/release.toml b/embassy-time-driver/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-time-driver/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-time-queue-utils/CHANGELOG.md b/embassy-time-queue-utils/CHANGELOG.md index 26200503c..510c29d58 100644 --- a/embassy-time-queue-utils/CHANGELOG.md +++ b/embassy-time-queue-utils/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + +## Unreleased - ReleaseDate - Removed the embassy-executor dependency diff --git a/embassy-time/release.toml b/embassy-time/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-time/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-usb-dfu/CHANGELOG.md b/embassy-usb-dfu/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-usb-dfu/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. diff --git a/embassy-usb-driver/release.toml b/embassy-usb-driver/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-usb-driver/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/embassy-usb-logger/CHANGELOG.md b/embassy-usb-logger/CHANGELOG.md index 79ea25839..c88b3ed6a 100644 --- a/embassy-usb-logger/CHANGELOG.md +++ b/embassy-usb-logger/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + +## Unreleased - ReleaseDate ## 0.5.0 - 2025-07-22 diff --git a/embassy-usb-synopsys-otg/CHANGELOG.md b/embassy-usb-synopsys-otg/CHANGELOG.md index 9913ee533..55eef0a1e 100644 --- a/embassy-usb-synopsys-otg/CHANGELOG.md +++ b/embassy-usb-synopsys-otg/CHANGELOG.md @@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + +## Unreleased - ReleaseDate ## 0.3.0 - 2025-07-22 diff --git a/embassy-usb/release.toml b/embassy-usb/release.toml deleted file mode 100644 index fb6feaf21..000000000 --- a/embassy-usb/release.toml +++ /dev/null @@ -1,5 +0,0 @@ -pre-release-replacements = [ - {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, - {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, - {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, -] diff --git a/release/Cargo.toml b/release/Cargo.toml new file mode 100644 index 000000000..cc1b155e2 --- /dev/null +++ b/release/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "embassy-release" +version = "0.1.0" +edition = "2021" + +[dependencies] +clap = { version = "4.5.1", features = ["derive"] } +walkdir = "2.5.0" +toml = "0.8.8" +toml_edit = { version = "0.23.1", features = ["serde"] } +serde = { version = "1.0.198", features = ["derive"] } +regex = "1.10.4" +anyhow = "1" +petgraph = "0.8.2" +semver = "1.0.26" diff --git a/release/config.toml b/release/config.toml index 2292f4077..6b23217fa 100644 --- a/release/config.toml +++ b/release/config.toml @@ -1 +1,46 @@ + +embassy-stm32 = { features = ["defmt", "unstable-pac", "exti", "time-driver-any", "time", "stm32h755zi-cm7", "dual-bank"], target = "thumbv7em-none-eabi" } +embassy-nrf = { features = ["nrf52840", "time", "defmt", "unstable-pac", "gpiote", "time-driver-rtc1"], target = "thumbv7em-none-eabihf" } + embassy-rp = { features = ["defmt", "unstable-pac", "time-driver", "rp2040"], target = "thumbv6m-none-eabi" } +cyw43 = { features = ["defmt", "firmware-logs"], target = "thumbv6m-none-eabi" } +#cyw43-pio = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } + +embassy-boot = { features = ["defmt"] } +#embassy-boot-nrf = { features = ["defmt", "embassy-nrf/nrf52840"], target = "thumbv7em-none-eabihf" } +#embassy-boot-rp = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } +#embassy-boot-stm32 = { features = ["defmt", "embassy-stm32/stm32f429zi"], target = "thumbv7em-none-eabi" } + +embassy-time = { features = ["defmt", "std"] } +embassy-time-driver = { } +embassy-time-queue-utils = { features = ["defmt"] } + +embassy-futures = { } +embassy-embedded-hal = { features = ["time"] } +embassy-hal-internal = { } +embassy-executor = { features = ["defmt", "arch-cortex-m", "executor-thread", "executor-interrupt"], target = "thumbv7em-none-eabi" } +embassy-executor-macros = { } +embassy-sync = { } + +embassy-net = { features = ["defmt", "tcp", "udp", "raw", "dns", "icmp", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "multicast", "dhcpv4-hostname"] } +embassy-net-ppp = { } +embassy-net-esp-hosted = {} +embassy-net-driver-channel = {} +embassy-net-wiznet = {} +embassy-net-nrf91 = { features = ["defmt", "nrf9160"] } +embassy-net-driver = {} +embassy-net-tuntap = {} +embassy-net-adin1110 = {} +embassy-net-enc28j60 = {} + +embassy-usb-driver = { } +embassy-usb-dfu = { features = ["dfu"] } +embassy-usb-synopsys-otg = { } +embassy-usb = { features = ["defmt", "usbd-hid"] } +embassy-usb-logger = { } + +# Unreleased +# embassy-stm32-wpan = {} +# embassy-imxrt = {} +# embassy-nxp = {} +# embassy-mspm0 = {} diff --git a/release/release.toml b/release/release.toml new file mode 100644 index 000000000..fb6feaf21 --- /dev/null +++ b/release/release.toml @@ -0,0 +1,5 @@ +pre-release-replacements = [ + {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, + {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, + {file="CHANGELOG.md", search="", replace="\n## Unreleased - ReleaseDate\n", exactly=1}, +] diff --git a/release/src/main.rs b/release/src/main.rs new file mode 100644 index 000000000..38bb728a8 --- /dev/null +++ b/release/src/main.rs @@ -0,0 +1,519 @@ +use std::collections::{BTreeMap, HashMap}; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Command as ProcessCommand; + +use anyhow::{anyhow, Result}; +use clap::{Parser, Subcommand}; +use petgraph::graph::{Graph, NodeIndex}; +use petgraph::visit::Bfs; +use petgraph::{Directed, Direction}; +use serde::Deserialize; +use toml_edit::{DocumentMut, Item, Value}; + +/// Tool to traverse and operate on intra-repo Rust crate dependencies +#[derive(Parser, Debug)] +#[command(author, version, about)] +struct Args { + /// Path to embassy repository + #[arg(short, long)] + repo: PathBuf, + + /// Command to perform on each crate + #[command(subcommand)] + command: Command, +} + +#[derive(Debug, Subcommand)] +enum Command { + /// All crates and their direct dependencies + List, + /// List all dependencies for a crate + Dependencies { + /// Crate name to print dependencies for. + #[arg(value_name = "CRATE")] + crate_name: String, + }, + /// List all dependencies for a crate + Dependents { + /// Crate name to print dependencies for. + #[arg(value_name = "CRATE")] + crate_name: String, + }, + + /// SemverCheck + SemverCheck { + /// Crate to check. Will traverse that crate an it's dependents. If not specified checks all crates. + #[arg(value_name = "CRATE")] + crate_name: String, + }, + /// Prepare to release a crate and all dependents that needs updating + /// - Semver checks + /// - Bump versions and commit + /// - Create tag. + PrepareRelease { + /// Crate to release. Will traverse that crate an it's dependents. If not specified checks all crates. + #[arg(value_name = "CRATE")] + crate_name: String, + }, +} + +#[derive(Debug, Subcommand, Clone, Copy, PartialEq)] +enum ReleaseKind { + Patch, + Minor, +} + +#[derive(Debug, Deserialize)] +struct CargoToml { + package: Option, + dependencies: Option, +} + +#[derive(Debug, Deserialize)] +struct Package { + name: String, + version: Option, +} + +#[derive(Debug, Deserialize)] +#[serde(untagged)] +enum Dep { + Version(String), + DetailedTable(BTreeMap), +} + +type Deps = std::collections::BTreeMap; + +#[derive(Debug, Clone, Deserialize)] +struct CrateConfig { + features: Option>, + target: Option, +} + +type ReleaseConfig = HashMap; + +fn load_release_config(repo: &Path) -> ReleaseConfig { + let config_path = repo.join("release/config.toml"); + if !config_path.exists() { + return HashMap::new(); + } + let content = fs::read_to_string(&config_path).expect("Failed to read release/config.toml"); + toml::from_str(&content).expect("Invalid TOML format in release/config.toml") +} + +fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { + let path = &c.path; + c.id.version = new_version.to_string(); + let content = fs::read_to_string(&path)?; + let mut doc: DocumentMut = content.parse()?; + for section in ["package"] { + if let Some(Item::Table(dep_table)) = doc.get_mut(section) { + dep_table.insert("version", Item::Value(Value::from(new_version))); + } + } + fs::write(&path, doc.to_string())?; + Ok(()) +} + +fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Result<()> { + let path = &to_update.path; + let content = fs::read_to_string(&path)?; + let mut doc: DocumentMut = content.parse()?; + let mut changed = false; + for section in ["dependencies", "dev-dependencies", "build-dependencies"] { + if let Some(Item::Table(dep_table)) = doc.get_mut(section) { + if let Some(item) = dep_table.get_mut(&dep.name) { + match item { + // e.g., foo = "0.1.0" + Item::Value(Value::String(_)) => { + *item = Item::Value(Value::from(new_version)); + changed = true; + } + // e.g., foo = { version = "...", ... } + Item::Value(Value::InlineTable(inline)) => { + if inline.contains_key("version") { + inline["version"] = Value::from(new_version); + changed = true; + } + } + _ => {} // Leave unusual formats untouched + } + } + } + } + + if changed { + fs::write(&path, doc.to_string())?; + println!("🔧 Updated {} to {} in {}", dep.name, new_version, path.display()); + } + Ok(()) +} + +#[derive(Debug, Clone)] +struct Crate { + id: CrateId, + path: PathBuf, + config: CrateConfig, + dependencies: Vec, +} + +#[derive(Debug, Clone, PartialOrd, Ord)] +struct CrateId { + name: String, + version: String, +} + +impl PartialEq for CrateId { + fn eq(&self, other: &CrateId) -> bool { + self.name == other.name + } +} + +impl Eq for CrateId {} +impl std::hash::Hash for CrateId { + fn hash(&self, state: &mut H) { + self.name.hash(state) + } +} + +fn list_crates(path: &PathBuf) -> Result> { + let d = std::fs::read_dir(path)?; + let release_config = load_release_config(path); + let mut crates = BTreeMap::new(); + for c in d { + let entry = c?; + let name = entry.file_name().to_str().unwrap().to_string(); + if entry.file_type()?.is_dir() && name.starts_with("embassy-") { + let entry = entry.path().join("Cargo.toml"); + if entry.exists() { + let content = fs::read_to_string(&entry).unwrap_or_else(|_| { + panic!("Failed to read {:?}", entry); + }); + let parsed: CargoToml = toml::from_str(&content).unwrap_or_else(|e| { + panic!("Failed to parse {:?}: {}", entry, e); + }); + let p = parsed.package.unwrap(); + let id = CrateId { + name: p.name.clone(), + version: p.version.unwrap(), + }; + + let mut dependencies = Vec::new(); + if let Some(deps) = parsed.dependencies { + for (k, v) in deps { + if k.starts_with("embassy-") { + dependencies.push(CrateId { + name: k, + version: match v { + Dep::Version(v) => v, + Dep::DetailedTable(table) => { + table.get("version").unwrap().as_str().unwrap().to_string() + } + }, + }); + } + } + } + + let path = path.join(entry); + if let Some(config) = release_config.get(&p.name) { + crates.insert( + id.clone(), + Crate { + id, + path, + dependencies, + config: config.clone(), + }, + ); + } + } + } + } + Ok(crates) +} + +fn build_graph(crates: &BTreeMap) -> (Graph, HashMap) { + let mut graph = Graph::::new(); + let mut node_indices: HashMap = HashMap::new(); + + // Helper to insert or get existing node + let get_or_insert_node = |id: CrateId, graph: &mut Graph, map: &mut HashMap| { + if let Some(&idx) = map.get(&id) { + idx + } else { + let idx = graph.add_node(id.clone()); + map.insert(id, idx); + idx + } + }; + + for krate in crates.values() { + get_or_insert_node(krate.id.clone(), &mut graph, &mut node_indices); + } + + for krate in crates.values() { + // Insert crate node if not exists + let crate_idx = get_or_insert_node(krate.id.clone(), &mut graph, &mut node_indices); + + // Insert dependencies and connect edges + for dep in krate.dependencies.iter() { + let dep_idx = get_or_insert_node(dep.clone(), &mut graph, &mut node_indices); + graph.add_edge(crate_idx, dep_idx, ()); + } + } + + (graph, node_indices) +} + +fn main() -> Result<()> { + let args = Args::parse(); + + let root = args.repo.canonicalize()?; //.expect("Invalid root crate path"); + let mut crates = list_crates(&root)?; + //println!("Crates: {:?}", crates); + let (mut graph, indices) = build_graph(&crates); + + // use petgraph::dot::{Config, Dot}; + // println!("{:?}", Dot::with_config(&graph, &[Config::EdgeNoLabel])); + + match args.command { + Command::List => { + let ordered = petgraph::algo::toposort(&graph, None).unwrap(); + for node in ordered.iter() { + if graph.neighbors_directed(*node, Direction::Incoming).count() == 0 { + let start = graph.node_weight(*node).unwrap(); + let mut bfs = Bfs::new(&graph, *node); + while let Some(node) = bfs.next(&graph) { + let weight = graph.node_weight(node).unwrap(); + if weight.name == start.name { + println!("+ {}-{}", weight.name, weight.version); + } else { + println!("|- {}-{}", weight.name, weight.version); + } + } + println!(""); + } + } + } + Command::Dependencies { crate_name } => { + let idx = indices + .get(&CrateId { + name: crate_name.clone(), + version: "".to_string(), + }) + .expect("unable to find crate in tree"); + let mut bfs = Bfs::new(&graph, *idx); + while let Some(node) = bfs.next(&graph) { + let weight = graph.node_weight(node).unwrap(); + if weight.name == crate_name { + println!("+ {}-{}", weight.name, weight.version); + } else { + println!("|- {}-{}", weight.name, weight.version); + } + } + } + Command::Dependents { crate_name } => { + let idx = indices + .get(&CrateId { + name: crate_name.clone(), + version: "".to_string(), + }) + .expect("unable to find crate in tree"); + let node = graph.node_weight(*idx).unwrap(); + println!("+ {}-{}", node.name, node.version); + for parent in graph.neighbors_directed(*idx, Direction::Incoming) { + let weight = graph.node_weight(parent).unwrap(); + println!("|- {}-{}", weight.name, weight.version); + } + } + Command::SemverCheck { crate_name } => { + let c = crates + .get(&CrateId { + name: crate_name.to_string(), + version: "".to_string(), + }) + .unwrap(); + check_semver(&c)?; + } + Command::PrepareRelease { crate_name } => { + let start = indices + .get(&CrateId { + name: crate_name.clone(), + version: "".to_string(), + }) + .expect("unable to find crate in tree"); + + graph.reverse(); + + let mut bfs = Bfs::new(&graph, *start); + + while let Some(node) = bfs.next(&graph) { + let weight = graph.node_weight(node).unwrap(); + println!("Preparing {}", weight.name); + let mut c = crates.get_mut(weight).unwrap(); + let ver = semver::Version::parse(&c.id.version)?; + let newver = if let Err(_) = check_semver(&c) { + println!("Semver check failed, bumping minor!"); + semver::Version::new(ver.major, ver.minor + 1, 0) + } else { + semver::Version::new(ver.major, ver.minor, ver.patch + 1) + }; + + println!( + "Updating {} from {} -> {}", + weight.name, + c.id.version, + newver.to_string() + ); + let newver = newver.to_string(); + + update_version(&mut c, &newver)?; + let c = crates.get(weight).unwrap(); + + // Update all nodes further down the tree + let mut bfs = Bfs::new(&graph, node); + while let Some(dep_node) = bfs.next(&graph) { + let dep_weight = graph.node_weight(dep_node).unwrap(); + let dep = crates.get(dep_weight).unwrap(); + update_versions(dep, &c.id, &newver)?; + } + + // Update changelog + update_changelog(&root, &c)?; + } + + let weight = graph.node_weight(*start).unwrap(); + let c = crates.get(weight).unwrap(); + publish_release(&root, &c, false)?; + + println!("# Please inspect changes and run the following commands when happy:"); + + println!("git commit -a -m 'chore: prepare crate releases'"); + let mut bfs = Bfs::new(&graph, *start); + while let Some(node) = bfs.next(&graph) { + let weight = graph.node_weight(node).unwrap(); + println!("git tag {}-v{}", weight.name, weight.version); + } + + println!(""); + println!("# Run these commands to publish the crate and dependents:"); + + let mut bfs = Bfs::new(&graph, *start); + while let Some(node) = bfs.next(&graph) { + let weight = graph.node_weight(node).unwrap(); + let c = crates.get(weight).unwrap(); + + let mut args: Vec = vec![ + "publish".to_string(), + "--manifest-path".to_string(), + c.path.display().to_string(), + ]; + + if let Some(features) = &c.config.features { + args.push("--features".into()); + args.push(features.join(",")); + } + + if let Some(target) = &c.config.target { + args.push("--target".into()); + args.push(target.clone()); + } + + /* + let mut dry_run = args.clone(); + dry_run.push("--dry-run".to_string()); + + println!("cargo {}", dry_run.join(" ")); + */ + println!("cargo {}", args.join(" ")); + } + + println!(""); + println!("# Run this command to push changes and tags:"); + println!("git push --tags"); + } + } + Ok(()) +} + +fn check_semver(c: &Crate) -> Result<()> { + let mut args: Vec = vec![ + "semver-checks".to_string(), + "--manifest-path".to_string(), + c.path.display().to_string(), + "--default-features".to_string(), + ]; + if let Some(features) = &c.config.features { + args.push("--features".into()); + args.push(features.join(",")); + } + + let status = ProcessCommand::new("cargo").args(&args).output()?; + + println!("{}", core::str::from_utf8(&status.stdout).unwrap()); + eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); + if !status.status.success() { + return Err(anyhow!("semver check failed")); + } else { + Ok(()) + } +} + +fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { + let args: Vec = vec![ + "release".to_string(), + "replace".to_string(), + "--config".to_string(), + repo.join("release").join("release.toml").display().to_string(), + "--manifest-path".to_string(), + c.path.display().to_string(), + "--execute".to_string(), + "--no-confirm".to_string(), + ]; + + let status = ProcessCommand::new("cargo").args(&args).output()?; + + println!("{}", core::str::from_utf8(&status.stdout).unwrap()); + eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); + if !status.status.success() { + return Err(anyhow!("release replace failed")); + } else { + Ok(()) + } +} + +fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { + let mut args: Vec = vec![ + "publish".to_string(), + "--manifest-path".to_string(), + c.path.display().to_string(), + ]; + + if let Some(features) = &c.config.features { + args.push("--features".into()); + args.push(features.join(",")); + } + + if let Some(target) = &c.config.target { + args.push("--target".into()); + args.push(target.clone()); + } + + if !push { + args.push("--dry-run".to_string()); + args.push("--allow-dirty".to_string()); + args.push("--keep-going".to_string()); + } + + let status = ProcessCommand::new("cargo").args(&args).output()?; + + println!("{}", core::str::from_utf8(&status.stdout).unwrap()); + eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); + if !status.status.success() { + return Err(anyhow!("publish failed")); + } else { + Ok(()) + } +} -- cgit From 3d004734a2a1db07d0e990462bb3fd5f04d3c7a0 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 09:39:32 +0200 Subject: chore: cleanup --- release/Cargo.toml | 3 +- release/src/main.rs | 184 ++++++++++++--------------------------------------- release/src/types.rs | 33 +++++++++ 3 files changed, 76 insertions(+), 144 deletions(-) create mode 100644 release/src/types.rs diff --git a/release/Cargo.toml b/release/Cargo.toml index cc1b155e2..52ca01c2e 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -6,10 +6,11 @@ edition = "2021" [dependencies] clap = { version = "4.5.1", features = ["derive"] } walkdir = "2.5.0" -toml = "0.8.8" +toml = "0.9.5" toml_edit = { version = "0.23.1", features = ["serde"] } serde = { version = "1.0.198", features = ["derive"] } regex = "1.10.4" anyhow = "1" petgraph = "0.8.2" semver = "1.0.26" +cargo-semver-checks = "0.43.0" diff --git a/release/src/main.rs b/release/src/main.rs index 38bb728a8..769611c78 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -8,8 +8,10 @@ use clap::{Parser, Subcommand}; use petgraph::graph::{Graph, NodeIndex}; use petgraph::visit::Bfs; use petgraph::{Directed, Direction}; -use serde::Deserialize; use toml_edit::{DocumentMut, Item, Value}; +use types::*; + +mod types; /// Tool to traverse and operate on intra-repo Rust crate dependencies #[derive(Parser, Debug)] @@ -58,41 +60,6 @@ enum Command { }, } -#[derive(Debug, Subcommand, Clone, Copy, PartialEq)] -enum ReleaseKind { - Patch, - Minor, -} - -#[derive(Debug, Deserialize)] -struct CargoToml { - package: Option, - dependencies: Option, -} - -#[derive(Debug, Deserialize)] -struct Package { - name: String, - version: Option, -} - -#[derive(Debug, Deserialize)] -#[serde(untagged)] -enum Dep { - Version(String), - DetailedTable(BTreeMap), -} - -type Deps = std::collections::BTreeMap; - -#[derive(Debug, Clone, Deserialize)] -struct CrateConfig { - features: Option>, - target: Option, -} - -type ReleaseConfig = HashMap; - fn load_release_config(repo: &Path) -> ReleaseConfig { let config_path = repo.join("release/config.toml"); if !config_path.exists() { @@ -104,7 +71,7 @@ fn load_release_config(repo: &Path) -> ReleaseConfig { fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { let path = &c.path; - c.id.version = new_version.to_string(); + c.version = new_version.to_string(); let content = fs::read_to_string(&path)?; let mut doc: DocumentMut = content.parse()?; for section in ["package"] { @@ -123,7 +90,7 @@ fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Resul let mut changed = false; for section in ["dependencies", "dev-dependencies", "build-dependencies"] { if let Some(Item::Table(dep_table)) = doc.get_mut(section) { - if let Some(item) = dep_table.get_mut(&dep.name) { + if let Some(item) = dep_table.get_mut(&dep) { match item { // e.g., foo = "0.1.0" Item::Value(Value::String(_)) => { @@ -145,38 +112,11 @@ fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Resul if changed { fs::write(&path, doc.to_string())?; - println!("🔧 Updated {} to {} in {}", dep.name, new_version, path.display()); + println!("🔧 Updated {} to {} in {}", dep, new_version, path.display()); } Ok(()) } -#[derive(Debug, Clone)] -struct Crate { - id: CrateId, - path: PathBuf, - config: CrateConfig, - dependencies: Vec, -} - -#[derive(Debug, Clone, PartialOrd, Ord)] -struct CrateId { - name: String, - version: String, -} - -impl PartialEq for CrateId { - fn eq(&self, other: &CrateId) -> bool { - self.name == other.name - } -} - -impl Eq for CrateId {} -impl std::hash::Hash for CrateId { - fn hash(&self, state: &mut H) { - self.name.hash(state) - } -} - fn list_crates(path: &PathBuf) -> Result> { let d = std::fs::read_dir(path)?; let release_config = load_release_config(path); @@ -187,41 +127,24 @@ fn list_crates(path: &PathBuf) -> Result> { if entry.file_type()?.is_dir() && name.starts_with("embassy-") { let entry = entry.path().join("Cargo.toml"); if entry.exists() { - let content = fs::read_to_string(&entry).unwrap_or_else(|_| { - panic!("Failed to read {:?}", entry); - }); - let parsed: CargoToml = toml::from_str(&content).unwrap_or_else(|e| { - panic!("Failed to parse {:?}: {}", entry, e); - }); - let p = parsed.package.unwrap(); - let id = CrateId { - name: p.name.clone(), - version: p.version.unwrap(), - }; + let content = fs::read_to_string(&entry)?; + let parsed: ParsedCrate = toml::from_str(&content)?; + let id = parsed.package.name; let mut dependencies = Vec::new(); - if let Some(deps) = parsed.dependencies { - for (k, v) in deps { - if k.starts_with("embassy-") { - dependencies.push(CrateId { - name: k, - version: match v { - Dep::Version(v) => v, - Dep::DetailedTable(table) => { - table.get("version").unwrap().as_str().unwrap().to_string() - } - }, - }); - } + for (k, _) in parsed.dependencies { + if k.starts_with("embassy-") { + dependencies.push(k); } } let path = path.join(entry); - if let Some(config) = release_config.get(&p.name) { + if let Some(config) = release_config.get(&id) { crates.insert( id.clone(), Crate { - id, + name: id, + version: parsed.package.version, path, dependencies, config: config.clone(), @@ -250,12 +173,12 @@ fn build_graph(crates: &BTreeMap) -> (Graph, HashMa }; for krate in crates.values() { - get_or_insert_node(krate.id.clone(), &mut graph, &mut node_indices); + get_or_insert_node(krate.name.clone(), &mut graph, &mut node_indices); } for krate in crates.values() { // Insert crate node if not exists - let crate_idx = get_or_insert_node(krate.id.clone(), &mut graph, &mut node_indices); + let crate_idx = get_or_insert_node(krate.name.clone(), &mut graph, &mut node_indices); // Insert dependencies and connect edges for dep in krate.dependencies.iter() { @@ -270,14 +193,10 @@ fn build_graph(crates: &BTreeMap) -> (Graph, HashMa fn main() -> Result<()> { let args = Args::parse(); - let root = args.repo.canonicalize()?; //.expect("Invalid root crate path"); + let root = args.repo.canonicalize()?; let mut crates = list_crates(&root)?; - //println!("Crates: {:?}", crates); let (mut graph, indices) = build_graph(&crates); - // use petgraph::dot::{Config, Dot}; - // println!("{:?}", Dot::with_config(&graph, &[Config::EdgeNoLabel])); - match args.command { Command::List => { let ordered = petgraph::algo::toposort(&graph, None).unwrap(); @@ -287,10 +206,11 @@ fn main() -> Result<()> { let mut bfs = Bfs::new(&graph, *node); while let Some(node) = bfs.next(&graph) { let weight = graph.node_weight(node).unwrap(); - if weight.name == start.name { - println!("+ {}-{}", weight.name, weight.version); + let c = crates.get(weight).unwrap(); + if weight == start { + println!("+ {}-{}", weight, c.version); } else { - println!("|- {}-{}", weight.name, weight.version); + println!("|- {}-{}", weight, c.version); } } println!(""); @@ -298,62 +218,44 @@ fn main() -> Result<()> { } } Command::Dependencies { crate_name } => { - let idx = indices - .get(&CrateId { - name: crate_name.clone(), - version: "".to_string(), - }) - .expect("unable to find crate in tree"); + let idx = indices.get(&crate_name).expect("unable to find crate in tree"); let mut bfs = Bfs::new(&graph, *idx); while let Some(node) = bfs.next(&graph) { let weight = graph.node_weight(node).unwrap(); - if weight.name == crate_name { - println!("+ {}-{}", weight.name, weight.version); + let crt = crates.get(weight).unwrap(); + if *weight == crate_name { + println!("+ {}-{}", weight, crt.version); } else { - println!("|- {}-{}", weight.name, weight.version); + println!("|- {}-{}", weight, crt.version); } } } Command::Dependents { crate_name } => { - let idx = indices - .get(&CrateId { - name: crate_name.clone(), - version: "".to_string(), - }) - .expect("unable to find crate in tree"); - let node = graph.node_weight(*idx).unwrap(); - println!("+ {}-{}", node.name, node.version); + let idx = indices.get(&crate_name).expect("unable to find crate in tree"); + let weight = graph.node_weight(*idx).unwrap(); + let crt = crates.get(weight).unwrap(); + println!("+ {}-{}", weight, crt.version); for parent in graph.neighbors_directed(*idx, Direction::Incoming) { let weight = graph.node_weight(parent).unwrap(); - println!("|- {}-{}", weight.name, weight.version); + let crt = crates.get(weight).unwrap(); + println!("|- {}-{}", weight, crt.version); } } Command::SemverCheck { crate_name } => { - let c = crates - .get(&CrateId { - name: crate_name.to_string(), - version: "".to_string(), - }) - .unwrap(); + let c = crates.get(&crate_name).unwrap(); check_semver(&c)?; } Command::PrepareRelease { crate_name } => { - let start = indices - .get(&CrateId { - name: crate_name.clone(), - version: "".to_string(), - }) - .expect("unable to find crate in tree"); - + let start = indices.get(&crate_name).expect("unable to find crate in tree"); graph.reverse(); let mut bfs = Bfs::new(&graph, *start); while let Some(node) = bfs.next(&graph) { let weight = graph.node_weight(node).unwrap(); - println!("Preparing {}", weight.name); + println!("Preparing {}", weight); let mut c = crates.get_mut(weight).unwrap(); - let ver = semver::Version::parse(&c.id.version)?; + let ver = semver::Version::parse(&c.version)?; let newver = if let Err(_) = check_semver(&c) { println!("Semver check failed, bumping minor!"); semver::Version::new(ver.major, ver.minor + 1, 0) @@ -361,12 +263,7 @@ fn main() -> Result<()> { semver::Version::new(ver.major, ver.minor, ver.patch + 1) }; - println!( - "Updating {} from {} -> {}", - weight.name, - c.id.version, - newver.to_string() - ); + println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); let newver = newver.to_string(); update_version(&mut c, &newver)?; @@ -377,7 +274,7 @@ fn main() -> Result<()> { while let Some(dep_node) = bfs.next(&graph) { let dep_weight = graph.node_weight(dep_node).unwrap(); let dep = crates.get(dep_weight).unwrap(); - update_versions(dep, &c.id, &newver)?; + update_versions(dep, &c.name, &newver)?; } // Update changelog @@ -394,7 +291,8 @@ fn main() -> Result<()> { let mut bfs = Bfs::new(&graph, *start); while let Some(node) = bfs.next(&graph) { let weight = graph.node_weight(node).unwrap(); - println!("git tag {}-v{}", weight.name, weight.version); + let c = crates.get(weight).unwrap(); + println!("git tag {}-v{}", weight, c.version); } println!(""); diff --git a/release/src/types.rs b/release/src/types.rs new file mode 100644 index 000000000..56a886e6f --- /dev/null +++ b/release/src/types.rs @@ -0,0 +1,33 @@ +use serde::Deserialize; +use std::collections::{BTreeMap, HashMap}; +use std::path::PathBuf; + +#[derive(Debug, Deserialize)] +pub struct ParsedCrate { + pub package: ParsedPackage, + pub dependencies: BTreeMap, +} + +#[derive(Debug, Deserialize)] +pub struct ParsedPackage { + pub name: String, + pub version: String, +} + +#[derive(Debug, Clone, Deserialize)] +pub struct CrateConfig { + pub features: Option>, + pub target: Option, +} + +pub type ReleaseConfig = HashMap; +pub type CrateId = String; + +#[derive(Debug, Clone)] +pub struct Crate { + pub name: String, + pub version: String, + pub path: PathBuf, + pub config: CrateConfig, + pub dependencies: Vec, +} -- cgit From 864d29bfe1475d52e7da6385ee8123b41184c833 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 13:30:21 +0200 Subject: fix: update --- release/Cargo.toml | 7 ++ release/config.toml | 2 +- release/src/cargo.rs | 194 ++++++++++++++++++++++++++++++++++++++++++++ release/src/main.rs | 52 +++++------- release/src/semver_check.rs | 110 +++++++++++++++++++++++++ 5 files changed, 334 insertions(+), 31 deletions(-) create mode 100644 release/src/cargo.rs create mode 100644 release/src/semver_check.rs diff --git a/release/Cargo.toml b/release/Cargo.toml index 52ca01c2e..461021e0a 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -14,3 +14,10 @@ anyhow = "1" petgraph = "0.8.2" semver = "1.0.26" cargo-semver-checks = "0.43.0" +log = "0.4" +simple_logger = "5.0.0" +temp-file = "0.1.9" +flate2 = "1.1.1" + +[patch.crates-io] +cargo-semver-checks = { path = "../../cargo-semver-checks" } diff --git a/release/config.toml b/release/config.toml index 6b23217fa..f572b450c 100644 --- a/release/config.toml +++ b/release/config.toml @@ -27,7 +27,7 @@ embassy-net-ppp = { } embassy-net-esp-hosted = {} embassy-net-driver-channel = {} embassy-net-wiznet = {} -embassy-net-nrf91 = { features = ["defmt", "nrf9160"] } +embassy-net-nrf91 = { features = ["defmt", "nrf-pac/nrf9160"] } embassy-net-driver = {} embassy-net-tuntap = {} embassy-net-adin1110 = {} diff --git a/release/src/cargo.rs b/release/src/cargo.rs new file mode 100644 index 000000000..1a4f79f20 --- /dev/null +++ b/release/src/cargo.rs @@ -0,0 +1,194 @@ +//! Tools for working with Cargo. + +use std::{ + ffi::OsStr, + path::{Path, PathBuf}, + process::{Command, Stdio}, +}; + +use anyhow::{bail, Context as _, Result}; +use clap::ValueEnum as _; +use serde::{Deserialize, Serialize}; +use toml_edit::{DocumentMut, Formatted, Item, Value}; + +use crate::{windows_safe_path, Crate}; + +#[derive(Clone, Debug, PartialEq)] +pub enum CargoAction { + Build(PathBuf), + Run, +} + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Artifact { + pub executable: PathBuf, +} + +/// Execute cargo with the given arguments and from the specified directory. +pub fn run(args: &[String], cwd: &Path) -> Result<()> { + run_with_env::<[(&str, &str); 0], _, _>(args, cwd, [], false)?; + Ok(()) +} + +/// Execute cargo with the given arguments and from the specified directory. +pub fn run_with_env(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result +where + I: IntoIterator + core::fmt::Debug, + K: AsRef, + V: AsRef, +{ + if !cwd.is_dir() { + bail!("The `cwd` argument MUST be a directory"); + } + + // Make sure to not use a UNC as CWD! + // That would make `OUT_DIR` a UNC which will trigger things like the one fixed in https://github.com/dtolnay/rustversion/pull/51 + // While it's fixed in `rustversion` it's not fixed for other crates we are + // using now or in future! + let cwd = windows_safe_path(cwd); + + println!( + "Running `cargo {}` in {:?} - Environment {:?}", + args.join(" "), + cwd, + envs + ); + + let mut command = Command::new(get_cargo()); + + command + .args(args) + .current_dir(cwd) + .envs(envs) + .stdout(if capture { Stdio::piped() } else { Stdio::inherit() }) + .stderr(if capture { Stdio::piped() } else { Stdio::inherit() }); + + if args.iter().any(|a| a.starts_with('+')) { + // Make sure the right cargo runs + command.env_remove("CARGO"); + } + + let output = command.stdin(Stdio::inherit()).output()?; + + // Make sure that we return an appropriate exit code here, as Github Actions + // requires this in order to function correctly: + if output.status.success() { + Ok(String::from_utf8_lossy(&output.stdout).to_string()) + } else { + bail!("Failed to execute cargo subcommand `cargo {}`", args.join(" "),) + } +} + +fn get_cargo() -> String { + // On Windows when executed via `cargo run` (e.g. via the xtask alias) the + // `cargo` on the search path is NOT the cargo-wrapper but the `cargo` from the + // toolchain - that one doesn't understand `+toolchain` + #[cfg(target_os = "windows")] + let cargo = if let Ok(cargo) = std::env::var("CARGO_HOME") { + format!("{cargo}/bin/cargo") + } else { + String::from("cargo") + }; + + #[cfg(not(target_os = "windows"))] + let cargo = String::from("cargo"); + + cargo +} + +#[derive(Debug, Default)] +pub struct CargoArgsBuilder { + toolchain: Option, + subcommand: String, + target: Option, + features: Vec, + args: Vec, +} + +impl CargoArgsBuilder { + #[must_use] + pub fn toolchain(mut self, toolchain: S) -> Self + where + S: Into, + { + self.toolchain = Some(toolchain.into()); + self + } + + #[must_use] + pub fn subcommand(mut self, subcommand: S) -> Self + where + S: Into, + { + self.subcommand = subcommand.into(); + self + } + + #[must_use] + pub fn target(mut self, target: S) -> Self + where + S: Into, + { + self.target = Some(target.into()); + self + } + + #[must_use] + pub fn features(mut self, features: &[String]) -> Self { + self.features = features.to_vec(); + self + } + + #[must_use] + pub fn arg(mut self, arg: S) -> Self + where + S: Into, + { + self.args.push(arg.into()); + self + } + + #[must_use] + pub fn args(mut self, args: &[S]) -> Self + where + S: Clone + Into, + { + for arg in args { + self.args.push(arg.clone().into()); + } + self + } + + pub fn add_arg(&mut self, arg: S) -> &mut Self + where + S: Into, + { + self.args.push(arg.into()); + self + } + + #[must_use] + pub fn build(&self) -> Vec { + let mut args = vec![]; + + if let Some(ref toolchain) = self.toolchain { + args.push(format!("+{toolchain}")); + } + + args.push(self.subcommand.clone()); + + if let Some(ref target) = self.target { + args.push(format!("--target={target}")); + } + + if !self.features.is_empty() { + args.push(format!("--features={}", self.features.join(","))); + } + + for arg in self.args.iter() { + args.push(arg.clone()); + } + + args + } +} diff --git a/release/src/main.rs b/release/src/main.rs index 769611c78..0dbcc5d45 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -1,3 +1,4 @@ +use simple_logger::SimpleLogger; use std::collections::{BTreeMap, HashMap}; use std::fs; use std::path::{Path, PathBuf}; @@ -11,6 +12,8 @@ use petgraph::{Directed, Direction}; use toml_edit::{DocumentMut, Item, Value}; use types::*; +mod cargo; +mod semver_check; mod types; /// Tool to traverse and operate on intra-repo Rust crate dependencies @@ -70,7 +73,7 @@ fn load_release_config(repo: &Path) -> ReleaseConfig { } fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { - let path = &c.path; + let path = c.path.join("Cargo.toml"); c.version = new_version.to_string(); let content = fs::read_to_string(&path)?; let mut doc: DocumentMut = content.parse()?; @@ -84,7 +87,7 @@ fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { } fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Result<()> { - let path = &to_update.path; + let path = to_update.path.join("Cargo.toml"); let content = fs::read_to_string(&path)?; let mut doc: DocumentMut = content.parse()?; let mut changed = false; @@ -117,15 +120,16 @@ fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Resul Ok(()) } -fn list_crates(path: &PathBuf) -> Result> { - let d = std::fs::read_dir(path)?; - let release_config = load_release_config(path); +fn list_crates(root: &PathBuf) -> Result> { + let d = std::fs::read_dir(root)?; + let release_config = load_release_config(root); let mut crates = BTreeMap::new(); for c in d { let entry = c?; let name = entry.file_name().to_str().unwrap().to_string(); if entry.file_type()?.is_dir() && name.starts_with("embassy-") { - let entry = entry.path().join("Cargo.toml"); + let path = root.join(entry.path()); + let entry = path.join("Cargo.toml"); if entry.exists() { let content = fs::read_to_string(&entry)?; let parsed: ParsedCrate = toml::from_str(&content)?; @@ -138,7 +142,6 @@ fn list_crates(path: &PathBuf) -> Result> { } } - let path = path.join(entry); if let Some(config) = release_config.get(&id) { crates.insert( id.clone(), @@ -191,6 +194,7 @@ fn build_graph(crates: &BTreeMap) -> (Graph, HashMa } fn main() -> Result<()> { + SimpleLogger::new().init().unwrap(); let args = Args::parse(); let root = args.repo.canonicalize()?; @@ -306,7 +310,7 @@ fn main() -> Result<()> { let mut args: Vec = vec![ "publish".to_string(), "--manifest-path".to_string(), - c.path.display().to_string(), + c.path.join("Cargo.toml").display().to_string(), ]; if let Some(features) = &c.config.features { @@ -337,26 +341,9 @@ fn main() -> Result<()> { } fn check_semver(c: &Crate) -> Result<()> { - let mut args: Vec = vec![ - "semver-checks".to_string(), - "--manifest-path".to_string(), - c.path.display().to_string(), - "--default-features".to_string(), - ]; - if let Some(features) = &c.config.features { - args.push("--features".into()); - args.push(features.join(",")); - } - - let status = ProcessCommand::new("cargo").args(&args).output()?; - - println!("{}", core::str::from_utf8(&status.stdout).unwrap()); - eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); - if !status.status.success() { - return Err(anyhow!("semver check failed")); - } else { - Ok(()) - } + let min_version = semver_check::minimum_update(c)?; + println!("Version should be bumped to {:?}", min_version); + Ok(()) } fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { @@ -366,7 +353,7 @@ fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { "--config".to_string(), repo.join("release").join("release.toml").display().to_string(), "--manifest-path".to_string(), - c.path.display().to_string(), + c.path.join("Cargo.toml").display().to_string(), "--execute".to_string(), "--no-confirm".to_string(), ]; @@ -386,7 +373,7 @@ fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { let mut args: Vec = vec![ "publish".to_string(), "--manifest-path".to_string(), - c.path.display().to_string(), + c.path.join("Cargo.toml").display().to_string(), ]; if let Some(features) = &c.config.features { @@ -415,3 +402,8 @@ fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { Ok(()) } } + +/// Make the path "Windows"-safe +pub fn windows_safe_path(path: &Path) -> PathBuf { + PathBuf::from(path.to_str().unwrap().to_string().replace("\\\\?\\", "")) +} diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs new file mode 100644 index 000000000..b43164334 --- /dev/null +++ b/release/src/semver_check.rs @@ -0,0 +1,110 @@ +use std::fs; +use std::io::Write; +use std::path::{Path, PathBuf}; + +use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc}; + +use crate::cargo::CargoArgsBuilder; +use crate::types::Crate; +use crate::windows_safe_path; + +/// Return the minimum required bump for the next release. +/// Even if nothing changed this will be [ReleaseType::Patch] +pub fn minimum_update(krate: &Crate) -> Result { + println!("Crate = {:?}", krate); + + let package_name = krate.name.clone(); + let package_path = krate.path.clone(); + let current_path = build_doc_json(krate)?; + + let baseline = Rustdoc::from_registry_latest_crate_version(); + let doc = Rustdoc::from_path(¤t_path); + let mut semver_check = Check::new(doc); + semver_check.with_default_features(); + semver_check.set_baseline(baseline); + semver_check.set_packages(vec![package_name]); + if let Some(features) = &krate.config.features { + let extra_current_features = features.clone(); + let extra_baseline_features = features.clone(); + semver_check.set_extra_features(extra_current_features, extra_baseline_features); + } + if let Some(target) = &krate.config.target { + semver_check.set_build_target(target.clone()); + } + let mut cfg = GlobalConfig::new(); + cfg.set_log_level(Some(log::Level::Trace)); + let result = semver_check.check_release(&mut cfg)?; + log::info!("Result {:?}", result); + + let mut min_required_update = ReleaseType::Patch; + for (_, report) in result.crate_reports() { + if let Some(required_bump) = report.required_bump() { + let required_is_stricter = + (min_required_update == ReleaseType::Patch) || (required_bump == ReleaseType::Major); + if required_is_stricter { + min_required_update = required_bump; + } + } + } + + Ok(min_required_update) +} + +pub(crate) fn build_doc_json(krate: &Crate) -> Result { + let target_dir = std::env::var("CARGO_TARGET_DIR"); + + let target_path = if let Ok(target) = target_dir { + PathBuf::from(target) + } else { + PathBuf::from(&krate.path).join("target") + }; + + let current_path = target_path; + let current_path = if let Some(target) = &krate.config.target { + current_path.join(target.clone()) + } else { + current_path + }; + let current_path = current_path + .join("doc") + .join(format!("{}.json", krate.name.to_string().replace("-", "_"))); + + std::fs::remove_file(¤t_path).ok(); + let features = if let Some(features) = &krate.config.features { + features.clone() + } else { + vec![] + }; + + log::info!("Building doc json for {} with features: {:?}", krate.name, features); + + let envs = vec![( + "RUSTDOCFLAGS", + "--cfg docsrs --cfg not_really_docsrs --cfg semver_checks", + )]; + + // always use `specific nightly` toolchain so we don't have to deal with potentially + // different versions of the doc-json + let cargo_builder = CargoArgsBuilder::default() + .toolchain("nightly-2025-06-29") + .subcommand("rustdoc") + .features(&features); + let cargo_builder = if let Some(target) = &krate.config.target { + cargo_builder.target(target.clone()) + } else { + cargo_builder + }; + + let cargo_builder = cargo_builder + .arg("-Zunstable-options") + .arg("-Zhost-config") + .arg("-Ztarget-applies-to-host") + .arg("--lib") + .arg("--output-format=json") + .arg("-Zbuild-std=alloc,core") + .arg("--config=host.rustflags=[\"--cfg=instability_disable_unstable_docs\"]"); + let cargo_args = cargo_builder.build(); + log::debug!("{cargo_args:#?}"); + crate::cargo::run_with_env(&cargo_args, &krate.path, envs, false)?; + Ok(current_path) +} -- cgit From a434401322e4e7af64ea7077ce2e4af685eac3d5 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 14:28:02 +0200 Subject: fix: reference project dir --- release/src/semver_check.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index b43164334..7b2e50672 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -18,7 +18,7 @@ pub fn minimum_update(krate: &Crate) -> Result { let current_path = build_doc_json(krate)?; let baseline = Rustdoc::from_registry_latest_crate_version(); - let doc = Rustdoc::from_path(¤t_path); + let doc = Rustdoc::from_root(&package_path); let mut semver_check = Check::new(doc); semver_check.with_default_features(); semver_check.set_baseline(baseline); -- cgit From 7579ca4ac7de39a4d48cfa3dca0011ebe56eeb35 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 14:29:13 +0200 Subject: fix: reenable --- release/config.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/config.toml b/release/config.toml index f572b450c..014c73a91 100644 --- a/release/config.toml +++ b/release/config.toml @@ -4,12 +4,12 @@ embassy-nrf = { features = ["nrf52840", "time", "defmt", "unstable-pac", "gpiote embassy-rp = { features = ["defmt", "unstable-pac", "time-driver", "rp2040"], target = "thumbv6m-none-eabi" } cyw43 = { features = ["defmt", "firmware-logs"], target = "thumbv6m-none-eabi" } -#cyw43-pio = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } +cyw43-pio = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } embassy-boot = { features = ["defmt"] } -#embassy-boot-nrf = { features = ["defmt", "embassy-nrf/nrf52840"], target = "thumbv7em-none-eabihf" } -#embassy-boot-rp = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } -#embassy-boot-stm32 = { features = ["defmt", "embassy-stm32/stm32f429zi"], target = "thumbv7em-none-eabi" } +embassy-boot-nrf = { features = ["defmt", "embassy-nrf/nrf52840"], target = "thumbv7em-none-eabihf" } +embassy-boot-rp = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } +embassy-boot-stm32 = { features = ["defmt", "embassy-stm32/stm32f429zi"], target = "thumbv7em-none-eabi" } embassy-time = { features = ["defmt", "std"] } embassy-time-driver = { } -- cgit From 3f21c9022396fb2f77b4521dda67728520b999a9 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 14:34:29 +0200 Subject: add missing changelogs --- embassy-boot-nrf/CHANGELOG.md | 13 +++++++++++++ embassy-boot-rp/CHANGELOG.md | 13 +++++++++++++ embassy-boot-stm32/CHANGELOG.md | 13 +++++++++++++ embassy-hal-internal/CHANGELOG.md | 13 +++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 embassy-boot-nrf/CHANGELOG.md create mode 100644 embassy-boot-rp/CHANGELOG.md create mode 100644 embassy-boot-stm32/CHANGELOG.md create mode 100644 embassy-hal-internal/CHANGELOG.md diff --git a/embassy-boot-nrf/CHANGELOG.md b/embassy-boot-nrf/CHANGELOG.md new file mode 100644 index 000000000..c78923a93 --- /dev/null +++ b/embassy-boot-nrf/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-15 + +- First release with changelog. diff --git a/embassy-boot-rp/CHANGELOG.md b/embassy-boot-rp/CHANGELOG.md new file mode 100644 index 000000000..c78923a93 --- /dev/null +++ b/embassy-boot-rp/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-15 + +- First release with changelog. diff --git a/embassy-boot-stm32/CHANGELOG.md b/embassy-boot-stm32/CHANGELOG.md new file mode 100644 index 000000000..c78923a93 --- /dev/null +++ b/embassy-boot-stm32/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-15 + +- First release with changelog. diff --git a/embassy-hal-internal/CHANGELOG.md b/embassy-hal-internal/CHANGELOG.md new file mode 100644 index 000000000..c78923a93 --- /dev/null +++ b/embassy-hal-internal/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-15 + +- First release with changelog. -- cgit From 9f12852c389d65a8b2e252e027f69dfef2383736 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 15:30:14 +0200 Subject: Read crate configs from metadata. --- cyw43-pio/Cargo.toml | 5 ++ cyw43/Cargo.toml | 11 +++++ embassy-boot-nrf/Cargo.toml | 11 +++++ embassy-boot-rp/Cargo.toml | 6 +++ embassy-boot-stm32/Cargo.toml | 6 +++ embassy-embedded-hal/Cargo.toml | 7 +++ embassy-executor/Cargo.toml | 20 ++++++++ embassy-imxrt/Cargo.toml | 6 +++ embassy-mspm0/Cargo.toml | 16 +++++++ embassy-net/Cargo.toml | 15 ++++++ embassy-nrf/Cargo.toml | 30 ++++++++++++ embassy-nxp/Cargo.toml | 7 +++ embassy-rp/Cargo.toml | 11 +++++ embassy-stm32/Cargo.toml | 93 +++++++++++++++++++++++++++++++++++++ embassy-sync/Cargo.toml | 5 ++ embassy-time-queue-utils/Cargo.toml | 6 +++ embassy-time/Cargo.toml | 6 +++ embassy-usb/Cargo.toml | 11 +++++ release/Cargo.toml | 7 ++- release/config.toml | 46 ------------------ release/src/main.rs | 55 +++++++++------------- release/src/semver_check.rs | 14 ++---- release/src/types.rs | 27 +++++++++-- 23 files changed, 325 insertions(+), 96 deletions(-) delete mode 100644 release/config.toml diff --git a/cyw43-pio/Cargo.toml b/cyw43-pio/Cargo.toml index a45adeccb..91b1df5fa 100644 --- a/cyw43-pio/Cargo.toml +++ b/cyw43-pio/Cargo.toml @@ -15,6 +15,11 @@ embassy-rp = { version = "0.7.0", path = "../embassy-rp" } fixed = "1.23.1" defmt = { version = "1.0.1", optional = true } +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["embassy-rp/rp2040"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/cyw43-pio-v$VERSION/cyw43-pio/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/cyw43-pio/src/" diff --git a/cyw43/Cargo.toml b/cyw43/Cargo.toml index 94d9ef3eb..74660b1d9 100644 --- a/cyw43/Cargo.toml +++ b/cyw43/Cargo.toml @@ -38,6 +38,17 @@ heapless = "0.8.0" embedded-io-async = { version = "0.6.0", optional = true } bt-hci = { version = "0.4.0", optional = true } +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = []}, + {target = "thumbv6m-none-eabi", features = ["log"]}, + {target = "thumbv6m-none-eabi", features = ["defmt"]}, + {target = "thumbv6m-none-eabi", features = ["firmware-logs", "log"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "firmware-logs"]}, + {target = "thumbv6m-none-eabi", features = ["bluetooth", "firmware-logs", "log"]}, + {target = "thumbv6m-none-eabi", features = ["bluetooth", "defmt", "firmware-logs"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/cyw43-v$VERSION/cyw43/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/cyw43/src/" diff --git a/embassy-boot-nrf/Cargo.toml b/embassy-boot-nrf/Cargo.toml index f89561066..017eadab9 100644 --- a/embassy-boot-nrf/Cargo.toml +++ b/embassy-boot-nrf/Cargo.toml @@ -12,6 +12,17 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = ["embassy-nrf/nrf52840"]}, + {target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf5340-app-s"]}, + {target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9160-ns"]}, + {target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9120-ns"]}, + {target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9151-ns"]}, + {target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9161-ns"]}, +] + + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-nrf-v$VERSION/embassy-boot-nrf/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-boot-nrf/src/" diff --git a/embassy-boot-rp/Cargo.toml b/embassy-boot-rp/Cargo.toml index 5fe376645..aee5d670d 100644 --- a/embassy-boot-rp/Cargo.toml +++ b/embassy-boot-rp/Cargo.toml @@ -12,6 +12,12 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["embassy-rp/rp2040"]}, +] + + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-rp-v$VERSION/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-boot-rp/src/" diff --git a/embassy-boot-stm32/Cargo.toml b/embassy-boot-stm32/Cargo.toml index b1087da1c..c2cf0c596 100644 --- a/embassy-boot-stm32/Cargo.toml +++ b/embassy-boot-stm32/Cargo.toml @@ -12,6 +12,12 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = ["embassy-stm32/stm32l496zg"]}, +] + + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-stm32-v$VERSION/embassy-boot-stm32/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-boot-stm32/src/" diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index 73eb19c39..a1f9e168b 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml @@ -12,6 +12,13 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = []}, + {target = "thumbv7em-none-eabi", features = ["time"]}, +] + + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-embedded-hal-v$VERSION/embassy-embedded-hal/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-embedded-hal/src/" diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index bff13de56..7da807906 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml @@ -12,6 +12,26 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = []}, + {target = "thumbv7em-none-eabi", features = ["log"]}, + {target = "thumbv7em-none-eabi", features = ["defmt"]}, + {target = "thumbv6m-none-eabi", features = ["defmt"]}, + {target = "thumbv6m-none-eabi", features = ["arch-cortex-m", "defmt", "executor-interrupt", "executor-thread"]}, + {target = "thumbv7em-none-eabi", features = ["arch-cortex-m"]}, + {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "rtos-trace"]}, + {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-thread"]}, + {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt"]}, + {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread"]}, + {target = "armv7a-none-eabi", features = ["arch-cortex-ar", "executor-thread"]}, + {target = "armv7r-none-eabi", features = ["arch-cortex-ar", "executor-thread"]}, + {target = "armv7r-none-eabihf", features = ["arch-cortex-ar", "executor-thread"]}, + {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32"]}, + {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread"]}, +] + + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-executor-v$VERSION/embassy-executor/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-executor/src/" diff --git a/embassy-imxrt/Cargo.toml b/embassy-imxrt/Cargo.toml index 466d5dc2c..5e94dbbc4 100644 --- a/embassy-imxrt/Cargo.toml +++ b/embassy-imxrt/Cargo.toml @@ -9,6 +9,12 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-imxrt" +[package.metadata.embassy] +build = [ + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "mimxrt633s", "time", "time-driver-rtc", "unstable-pac"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "mimxrt685s", "time", "time-driver-rtc", "unstable-pac"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-imxrt-v$VERSION/embassy-imxrt/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-imxrt/src/" diff --git a/embassy-mspm0/Cargo.toml b/embassy-mspm0/Cargo.toml index 221026b26..d13f16eff 100644 --- a/embassy-mspm0/Cargo.toml +++ b/embassy-mspm0/Cargo.toml @@ -9,6 +9,22 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-mspm0" +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0c1104dgs20", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g3507pm", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g3519pz", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0l1306rhb", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0l2228pn", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0l1345dgs28", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0l1106dgs28", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0l1228pm", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g1107ycj", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g3105rhb", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g1505pt", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0g1519rhb", "time-driver-any"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-mspm0-v$VERSION/embassy-mspm0/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-mspm0/src/" diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index babd63157..446e58489 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml @@ -13,6 +13,21 @@ categories = [ "network-programming", ] +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "packet-trace", "proto-ipv4", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "multicast", "proto-ipv4", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dhcpv4", "dns", "medium-ethernet", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dhcpv4", "dhcpv4-hostname", "dns", "medium-ethernet", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ieee802154", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "medium-ieee802154", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "proto-ipv4", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ip", "proto-ipv4", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "medium-ip", "proto-ipv4", "proto-ipv6", "tcp", "udp"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dns", "medium-ethernet", "medium-ieee802154", "medium-ip", "proto-ipv4", "proto-ipv6", "tcp", "udp"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-v$VERSION/embassy-net/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net/src/" diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 98013aa5b..ed701dac8 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml @@ -9,6 +9,36 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-nrf" +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["gpiote", "nrf51", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52805", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52810", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52811", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52820", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52832", "reset-pin-as-gpio", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nfc-pins-as-gpio", "nrf52833", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf9160-s", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf9160-ns", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf5340-app-s", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf5340-app-ns", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf5340-net", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf54l15-app-s", "time", "time-driver-rtc1"]}, + {target = "thumbv8m.main-none-eabihf", features = ["gpiote", "nrf54l15-app-ns", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52840", "time"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52840", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "nrf52840", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "log", "nrf52840", "time"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "log", "nrf52840", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["gpiote", "log", "nrf52840", "time", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "gpiote", "nrf52840", "time"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "gpiote", "nrf52840", "time-driver-rtc1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "gpiote", "nrf52840", "time", "time-driver-rtc1"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "nrf51", "time", "time-driver-rtc1"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "nrf51", "time"]}, + {target = "thumbv6m-none-eabi", features = ["nrf51", "time"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-nrf-v$VERSION/embassy-nrf/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-nrf/src/" diff --git a/embassy-nxp/Cargo.toml b/embassy-nxp/Cargo.toml index 3303cabdb..68f5c98b2 100644 --- a/embassy-nxp/Cargo.toml +++ b/embassy-nxp/Cargo.toml @@ -3,6 +3,13 @@ name = "embassy-nxp" version = "0.1.0" edition = "2021" +[package.metadata.embassy] +build = [ + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "lpc55"]}, + {target = "thumbv7em-none-eabihf", features = ["defmt", "mimxrt1011", "rt", "time-driver-pit"]}, + {target = "thumbv7em-none-eabihf", features = ["defmt", "mimxrt1062", "rt", "time-driver-pit"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-nxp-v$VERSION/embassy-nxp/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-nxp/src/" diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 7f2167f90..a5f84944e 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml @@ -9,6 +9,17 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-rp" +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["defmt", "rp2040", "time-driver"]}, + {target = "thumbv6m-none-eabi", features = ["log", "rp2040", "time-driver"]}, + {target = "thumbv6m-none-eabi", features = ["intrinsics", "rp2040", "time-driver"]}, + {target = "thumbv6m-none-eabi", features = ["qspi-as-gpio", "rp2040", "time-driver"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "rp235xa", "time-driver"]}, + {target = "thumbv8m.main-none-eabihf", features = ["log", "rp235xa", "time-driver"]}, + {target = "thumbv8m.main-none-eabihf", features = ["binary-info", "rp235xa", "time-driver"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-rp-v$VERSION/embassy-rp/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-rp/src/" diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 45b351acf..92d2e7fda 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -9,6 +9,99 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-stm32" +[package.metadata.embassy] +build = [ + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "exti", "stm32l552ze", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "stm32l552ze", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "exti", "stm32l552ze", "time"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "stm32l552ze", "time"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "exti", "stm32l552ze"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "stm32l552ze"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "single-bank", "stm32l552ze"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32c071rb", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32c051f6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32c091gb", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32c092rc", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f038f6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f030c6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f058t8", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f030r8", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f031k6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f030rc", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f070f6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f078vb", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f042g4", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32f072c8", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f401ve", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f405zg", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f407zg", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f401ve", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f405zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f407zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f410tb", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f411ce", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f412zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f413vh", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f415zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f417zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f423zh", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f427zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["exti", "log", "stm32f429zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["exti", "log", "stm32f437zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f439zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f446ze", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f469zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f479zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f730i8", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h753zi", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h735zg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "split-pc2", "split-pc3", "stm32h755zi-cm7", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h725re", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7b3ai", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7b3ai", "time", "time-driver-tim1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7r3z8", "time", "time-driver-tim1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7r7a8", "time", "time-driver-tim1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7s3a8", "time", "time-driver-tim1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32h7s7z8", "time", "time-driver-tim1"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32l431cb", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32l476vg", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32l422cb", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32wb15cc", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32l072cz", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32l041f6", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32l051k8", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "low-power", "stm32l073cz", "time", "time-driver-any"]}, + {target = "thumbv7m-none-eabi", features = ["defmt", "exti", "stm32l151cb-a", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f303c8", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f398ve", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32f378cc", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32g0b0ce", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32g0c1ve", "time", "time-driver-any"]}, + {target = "thumbv7m-none-eabi", features = ["defmt", "exti", "stm32f217zg", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "dual-bank", "exti", "low-power", "stm32l552ze", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32wl54jc-cm0p", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32wle5jb", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32g431kb", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "dual-bank", "exti", "stm32g474pe", "time", "time-driver-any"]}, + {target = "thumbv7m-none-eabi", features = ["defmt", "exti", "stm32f107vc", "time", "time-driver-any"]}, + {target = "thumbv7m-none-eabi", features = ["defmt", "exti", "stm32f103re", "time", "time-driver-any"]}, + {target = "thumbv7m-none-eabi", features = ["defmt", "exti", "stm32f100c4", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32h503rb", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32h523cc", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32h562ag", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32wba50ke", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32wba55ug", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32wba62cg", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "low-power", "stm32wba65ri", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32u5f9zj", "time", "time-driver-any"]}, + {target = "thumbv8m.main-none-eabihf", features = ["defmt", "exti", "stm32u5g9nj", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "stm32wb35ce", "time", "time-driver-any"]}, + {target = "thumbv7em-none-eabi", features = ["defmt", "exti", "low-power", "stm32wb55rg", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32u031r8", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32u073mb", "time", "time-driver-any"]}, + {target = "thumbv6m-none-eabi", features = ["defmt", "exti", "stm32u083rc", "time", "time-driver-any"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-v$VERSION/embassy-stm32/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32/src/" diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml index e60f5e34c..e31c9a674 100644 --- a/embassy-sync/Cargo.toml +++ b/embassy-sync/Cargo.toml @@ -14,6 +14,11 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["defmt"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-sync-v$VERSION/embassy-sync/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/src/" diff --git a/embassy-time-queue-utils/Cargo.toml b/embassy-time-queue-utils/Cargo.toml index 8991da66c..2a659548e 100644 --- a/embassy-time-queue-utils/Cargo.toml +++ b/embassy-time-queue-utils/Cargo.toml @@ -52,6 +52,12 @@ generic-queue-128 = ["_generic-queue"] _generic-queue = [] +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = []}, + {target = "thumbv6m-none-eabi", features = ["generic-queue-8"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-queue-utils-v$VERSION/embassy-time-queue-utils/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-time-queue-utils/src/" diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 163dbe95f..eff8e2975 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml @@ -14,6 +14,12 @@ categories = [ "asynchronous", ] +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = ["defmt", "defmt-timestamp-uptime", "mock-driver"]}, + {features = ["defmt", "std"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-v$VERSION/embassy-time/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-time/src/" diff --git a/embassy-usb/Cargo.toml b/embassy-usb/Cargo.toml index 93e3e1e31..89b3c318d 100644 --- a/embassy-usb/Cargo.toml +++ b/embassy-usb/Cargo.toml @@ -9,6 +9,17 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-usb" +[package.metadata.embassy] +build = [ + {target = "thumbv6m-none-eabi", features = []}, + {target = "thumbv6m-none-eabi", features = ["log"]}, + {target = "thumbv6m-none-eabi", features = ["defmt"]}, + {target = "thumbv6m-none-eabi", features = ["usbd-hid"]}, + {target = "thumbv6m-none-eabi", features = ["max-interface-count-1"]}, + {target = "thumbv6m-none-eabi", features = ["max-interface-count-8"]}, + {target = "thumbv6m-none-eabi", features = ["max-handler-count-8"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-usb-v$VERSION/embassy-usb/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-usb/src/" diff --git a/release/Cargo.toml b/release/Cargo.toml index 461021e0a..3e4094eed 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -19,5 +19,8 @@ simple_logger = "5.0.0" temp-file = "0.1.9" flate2 = "1.1.1" -[patch.crates-io] -cargo-semver-checks = { path = "../../cargo-semver-checks" } +#[patch.crates-io] +#cargo-semver-checks = { path = "../../cargo-semver-checks" } + +[package.metadata.embassy] +skip = true diff --git a/release/config.toml b/release/config.toml deleted file mode 100644 index 014c73a91..000000000 --- a/release/config.toml +++ /dev/null @@ -1,46 +0,0 @@ - -embassy-stm32 = { features = ["defmt", "unstable-pac", "exti", "time-driver-any", "time", "stm32h755zi-cm7", "dual-bank"], target = "thumbv7em-none-eabi" } -embassy-nrf = { features = ["nrf52840", "time", "defmt", "unstable-pac", "gpiote", "time-driver-rtc1"], target = "thumbv7em-none-eabihf" } - -embassy-rp = { features = ["defmt", "unstable-pac", "time-driver", "rp2040"], target = "thumbv6m-none-eabi" } -cyw43 = { features = ["defmt", "firmware-logs"], target = "thumbv6m-none-eabi" } -cyw43-pio = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } - -embassy-boot = { features = ["defmt"] } -embassy-boot-nrf = { features = ["defmt", "embassy-nrf/nrf52840"], target = "thumbv7em-none-eabihf" } -embassy-boot-rp = { features = ["defmt", "embassy-rp/rp2040"], target = "thumbv6m-none-eabi" } -embassy-boot-stm32 = { features = ["defmt", "embassy-stm32/stm32f429zi"], target = "thumbv7em-none-eabi" } - -embassy-time = { features = ["defmt", "std"] } -embassy-time-driver = { } -embassy-time-queue-utils = { features = ["defmt"] } - -embassy-futures = { } -embassy-embedded-hal = { features = ["time"] } -embassy-hal-internal = { } -embassy-executor = { features = ["defmt", "arch-cortex-m", "executor-thread", "executor-interrupt"], target = "thumbv7em-none-eabi" } -embassy-executor-macros = { } -embassy-sync = { } - -embassy-net = { features = ["defmt", "tcp", "udp", "raw", "dns", "icmp", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "medium-ieee802154", "multicast", "dhcpv4-hostname"] } -embassy-net-ppp = { } -embassy-net-esp-hosted = {} -embassy-net-driver-channel = {} -embassy-net-wiznet = {} -embassy-net-nrf91 = { features = ["defmt", "nrf-pac/nrf9160"] } -embassy-net-driver = {} -embassy-net-tuntap = {} -embassy-net-adin1110 = {} -embassy-net-enc28j60 = {} - -embassy-usb-driver = { } -embassy-usb-dfu = { features = ["dfu"] } -embassy-usb-synopsys-otg = { } -embassy-usb = { features = ["defmt", "usbd-hid"] } -embassy-usb-logger = { } - -# Unreleased -# embassy-stm32-wpan = {} -# embassy-imxrt = {} -# embassy-nxp = {} -# embassy-mspm0 = {} diff --git a/release/src/main.rs b/release/src/main.rs index 0dbcc5d45..a49d8f36c 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -1,4 +1,3 @@ -use simple_logger::SimpleLogger; use std::collections::{BTreeMap, HashMap}; use std::fs; use std::path::{Path, PathBuf}; @@ -6,9 +5,11 @@ use std::process::Command as ProcessCommand; use anyhow::{anyhow, Result}; use clap::{Parser, Subcommand}; +use log::info; use petgraph::graph::{Graph, NodeIndex}; use petgraph::visit::Bfs; use petgraph::{Directed, Direction}; +use simple_logger::SimpleLogger; use toml_edit::{DocumentMut, Item, Value}; use types::*; @@ -63,15 +64,6 @@ enum Command { }, } -fn load_release_config(repo: &Path) -> ReleaseConfig { - let config_path = repo.join("release/config.toml"); - if !config_path.exists() { - return HashMap::new(); - } - let content = fs::read_to_string(&config_path).expect("Failed to read release/config.toml"); - toml::from_str(&content).expect("Invalid TOML format in release/config.toml") -} - fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { let path = c.path.join("Cargo.toml"); c.version = new_version.to_string(); @@ -122,12 +114,10 @@ fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Resul fn list_crates(root: &PathBuf) -> Result> { let d = std::fs::read_dir(root)?; - let release_config = load_release_config(root); let mut crates = BTreeMap::new(); for c in d { let entry = c?; - let name = entry.file_name().to_str().unwrap().to_string(); - if entry.file_type()?.is_dir() && name.starts_with("embassy-") { + if entry.file_type()?.is_dir() { let path = root.join(entry.path()); let entry = path.join("Cargo.toml"); if entry.exists() { @@ -135,6 +125,8 @@ fn list_crates(root: &PathBuf) -> Result> { let parsed: ParsedCrate = toml::from_str(&content)?; let id = parsed.package.name; + let metadata = &parsed.package.metadata.embassy; + let mut dependencies = Vec::new(); for (k, _) in parsed.dependencies { if k.starts_with("embassy-") { @@ -142,18 +134,19 @@ fn list_crates(root: &PathBuf) -> Result> { } } - if let Some(config) = release_config.get(&id) { - crates.insert( - id.clone(), - Crate { - name: id, - version: parsed.package.version, - path, - dependencies, - config: config.clone(), - }, - ); - } + crates.insert( + id.clone(), + Crate { + name: id, + version: parsed.package.version, + path, + dependencies, + config: metadata.build.first().cloned().unwrap_or_else(|| BuildConfig { + features: vec![], + target: None, + }), + }, + ); } } } @@ -313,10 +306,8 @@ fn main() -> Result<()> { c.path.join("Cargo.toml").display().to_string(), ]; - if let Some(features) = &c.config.features { - args.push("--features".into()); - args.push(features.join(",")); - } + args.push("--features".into()); + args.push(c.config.features.join(",")); if let Some(target) = &c.config.target { args.push("--target".into()); @@ -376,10 +367,8 @@ fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { c.path.join("Cargo.toml").display().to_string(), ]; - if let Some(features) = &c.config.features { - args.push("--features".into()); - args.push(features.join(",")); - } + args.push("--features".into()); + args.push(c.config.features.join(",")); if let Some(target) = &c.config.target { args.push("--target".into()); diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index 7b2e50672..96f8ebe2e 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -23,11 +23,9 @@ pub fn minimum_update(krate: &Crate) -> Result { semver_check.with_default_features(); semver_check.set_baseline(baseline); semver_check.set_packages(vec![package_name]); - if let Some(features) = &krate.config.features { - let extra_current_features = features.clone(); - let extra_baseline_features = features.clone(); - semver_check.set_extra_features(extra_current_features, extra_baseline_features); - } + let extra_current_features = krate.config.features.clone(); + let extra_baseline_features = krate.config.features.clone(); + semver_check.set_extra_features(extra_current_features, extra_baseline_features); if let Some(target) = &krate.config.target { semver_check.set_build_target(target.clone()); } @@ -70,11 +68,7 @@ pub(crate) fn build_doc_json(krate: &Crate) -> Result { .join(format!("{}.json", krate.name.to_string().replace("-", "_"))); std::fs::remove_file(¤t_path).ok(); - let features = if let Some(features) = &krate.config.features { - features.clone() - } else { - vec![] - }; + let features = krate.config.features.clone(); log::info!("Building doc json for {} with features: {:?}", krate.name, features); diff --git a/release/src/types.rs b/release/src/types.rs index 56a886e6f..39e8e9f48 100644 --- a/release/src/types.rs +++ b/release/src/types.rs @@ -1,7 +1,8 @@ -use serde::Deserialize; use std::collections::{BTreeMap, HashMap}; use std::path::PathBuf; +use serde::Deserialize; + #[derive(Debug, Deserialize)] pub struct ParsedCrate { pub package: ParsedPackage, @@ -12,15 +13,31 @@ pub struct ParsedCrate { pub struct ParsedPackage { pub name: String, pub version: String, + #[serde(default)] + pub metadata: Metadata, +} + +#[derive(Debug, Deserialize, Default)] +pub struct Metadata { + #[serde(default)] + pub embassy: MetadataEmbassy, +} + +#[derive(Debug, Deserialize, Default)] +pub struct MetadataEmbassy { + #[serde(default)] + pub skip: bool, + #[serde(default)] + pub build: Vec, } #[derive(Debug, Clone, Deserialize)] -pub struct CrateConfig { - pub features: Option>, +pub struct BuildConfig { + #[serde(default)] + pub features: Vec, pub target: Option, } -pub type ReleaseConfig = HashMap; pub type CrateId = String; #[derive(Debug, Clone)] @@ -28,6 +45,6 @@ pub struct Crate { pub name: String, pub version: String, pub path: PathBuf, - pub config: CrateConfig, pub dependencies: Vec, + pub config: BuildConfig, // TODO make this a vec. } -- cgit From 6df077be0663cf4e45d9573ea8fc685a9f9dcd99 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 15 Aug 2025 15:32:26 +0200 Subject: Revert "fix: reference project dir" This reverts commit 1605a71c11aa9cd995206867abb6ba7409223b18. --- release/src/semver_check.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index 96f8ebe2e..e20bc8574 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -18,7 +18,7 @@ pub fn minimum_update(krate: &Crate) -> Result { let current_path = build_doc_json(krate)?; let baseline = Rustdoc::from_registry_latest_crate_version(); - let doc = Rustdoc::from_root(&package_path); + let doc = Rustdoc::from_path(¤t_path); let mut semver_check = Check::new(doc); semver_check.with_default_features(); semver_check.set_baseline(baseline); -- cgit From 2f540a4d2449234367e8d18c9e3fc8dc740d3ee5 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 16:11:35 +0200 Subject: Add Context struct. --- release/src/build.rs | 5 ++ release/src/main.rs | 130 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 release/src/build.rs diff --git a/release/src/build.rs b/release/src/build.rs new file mode 100644 index 000000000..adf251b4d --- /dev/null +++ b/release/src/build.rs @@ -0,0 +1,5 @@ +use anyhow::Result; + +pub(crate) fn build(ctx: &crate::Context) -> Result<()> { + todo!() +} diff --git a/release/src/main.rs b/release/src/main.rs index a49d8f36c..25f31486a 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -13,6 +13,7 @@ use simple_logger::SimpleLogger; use toml_edit::{DocumentMut, Item, Value}; use types::*; +mod build; mod cargo; mod semver_check; mod types; @@ -47,6 +48,12 @@ enum Command { crate_name: String, }, + /// Build + Build { + /// Crate to check. If not specified checks all crates. + #[arg(value_name = "CRATE")] + crate_name: Option, + }, /// SemverCheck SemverCheck { /// Crate to check. Will traverse that crate an it's dependents. If not specified checks all crates. @@ -186,40 +193,55 @@ fn build_graph(crates: &BTreeMap) -> (Graph, HashMa (graph, node_indices) } +struct Context { + root: PathBuf, + crates: BTreeMap, + graph: Graph, + indices: HashMap, +} + +fn load_context(args: &Args) -> Result { + let root = args.repo.canonicalize()?; + let crates = list_crates(&root)?; + let (graph, indices) = build_graph(&crates); + + Ok(Context { + root, + crates, + graph, + indices, + }) +} + fn main() -> Result<()> { SimpleLogger::new().init().unwrap(); let args = Args::parse(); - - let root = args.repo.canonicalize()?; - let mut crates = list_crates(&root)?; - let (mut graph, indices) = build_graph(&crates); + let mut ctx = load_context(&args)?; match args.command { Command::List => { - let ordered = petgraph::algo::toposort(&graph, None).unwrap(); + let ordered = petgraph::algo::toposort(&ctx.graph, None).unwrap(); for node in ordered.iter() { - if graph.neighbors_directed(*node, Direction::Incoming).count() == 0 { - let start = graph.node_weight(*node).unwrap(); - let mut bfs = Bfs::new(&graph, *node); - while let Some(node) = bfs.next(&graph) { - let weight = graph.node_weight(node).unwrap(); - let c = crates.get(weight).unwrap(); - if weight == start { - println!("+ {}-{}", weight, c.version); - } else { - println!("|- {}-{}", weight, c.version); - } + let start = ctx.graph.node_weight(*node).unwrap(); + let mut bfs = Bfs::new(&ctx.graph, *node); + while let Some(node) = bfs.next(&ctx.graph) { + let weight = ctx.graph.node_weight(node).unwrap(); + let c = ctx.crates.get(weight).unwrap(); + if weight == start { + println!("+ {}-{}", weight, c.version); + } else { + println!("|- {}-{}", weight, c.version); } - println!(""); } + println!(""); } } Command::Dependencies { crate_name } => { - let idx = indices.get(&crate_name).expect("unable to find crate in tree"); - let mut bfs = Bfs::new(&graph, *idx); - while let Some(node) = bfs.next(&graph) { - let weight = graph.node_weight(node).unwrap(); - let crt = crates.get(weight).unwrap(); + let idx = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); + let mut bfs = Bfs::new(&ctx.graph, *idx); + while let Some(node) = bfs.next(&ctx.graph) { + let weight = ctx.graph.node_weight(node).unwrap(); + let crt = ctx.crates.get(weight).unwrap(); if *weight == crate_name { println!("+ {}-{}", weight, crt.version); } else { @@ -228,30 +250,34 @@ fn main() -> Result<()> { } } Command::Dependents { crate_name } => { - let idx = indices.get(&crate_name).expect("unable to find crate in tree"); - let weight = graph.node_weight(*idx).unwrap(); - let crt = crates.get(weight).unwrap(); + let idx = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); + let weight = ctx.graph.node_weight(*idx).unwrap(); + let crt = ctx.crates.get(weight).unwrap(); println!("+ {}-{}", weight, crt.version); - for parent in graph.neighbors_directed(*idx, Direction::Incoming) { - let weight = graph.node_weight(parent).unwrap(); - let crt = crates.get(weight).unwrap(); + for parent in ctx.graph.neighbors_directed(*idx, Direction::Incoming) { + let weight = ctx.graph.node_weight(parent).unwrap(); + let crt = ctx.crates.get(weight).unwrap(); println!("|- {}-{}", weight, crt.version); } } + Command::Build { crate_name } => { + build::build(&ctx)?; + } Command::SemverCheck { crate_name } => { - let c = crates.get(&crate_name).unwrap(); + let c = ctx.crates.get(&crate_name).unwrap(); check_semver(&c)?; } Command::PrepareRelease { crate_name } => { - let start = indices.get(&crate_name).expect("unable to find crate in tree"); - graph.reverse(); + let start = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); + let mut rgraph = ctx.graph.clone(); + rgraph.reverse(); - let mut bfs = Bfs::new(&graph, *start); + let mut bfs = Bfs::new(&rgraph, *start); - while let Some(node) = bfs.next(&graph) { - let weight = graph.node_weight(node).unwrap(); + while let Some(node) = bfs.next(&rgraph) { + let weight = rgraph.node_weight(node).unwrap(); println!("Preparing {}", weight); - let mut c = crates.get_mut(weight).unwrap(); + let mut c = ctx.crates.get_mut(weight).unwrap(); let ver = semver::Version::parse(&c.version)?; let newver = if let Err(_) = check_semver(&c) { println!("Semver check failed, bumping minor!"); @@ -264,41 +290,41 @@ fn main() -> Result<()> { let newver = newver.to_string(); update_version(&mut c, &newver)?; - let c = crates.get(weight).unwrap(); + let c = ctx.crates.get(weight).unwrap(); // Update all nodes further down the tree - let mut bfs = Bfs::new(&graph, node); - while let Some(dep_node) = bfs.next(&graph) { - let dep_weight = graph.node_weight(dep_node).unwrap(); - let dep = crates.get(dep_weight).unwrap(); + let mut bfs = Bfs::new(&rgraph, node); + while let Some(dep_node) = bfs.next(&rgraph) { + let dep_weight = rgraph.node_weight(dep_node).unwrap(); + let dep = ctx.crates.get(dep_weight).unwrap(); update_versions(dep, &c.name, &newver)?; } // Update changelog - update_changelog(&root, &c)?; + update_changelog(&ctx.root, &c)?; } - let weight = graph.node_weight(*start).unwrap(); - let c = crates.get(weight).unwrap(); - publish_release(&root, &c, false)?; + let weight = rgraph.node_weight(*start).unwrap(); + let c = ctx.crates.get(weight).unwrap(); + publish_release(&ctx.root, &c, false)?; println!("# Please inspect changes and run the following commands when happy:"); println!("git commit -a -m 'chore: prepare crate releases'"); - let mut bfs = Bfs::new(&graph, *start); - while let Some(node) = bfs.next(&graph) { - let weight = graph.node_weight(node).unwrap(); - let c = crates.get(weight).unwrap(); + let mut bfs = Bfs::new(&rgraph, *start); + while let Some(node) = bfs.next(&rgraph) { + let weight = rgraph.node_weight(node).unwrap(); + let c = ctx.crates.get(weight).unwrap(); println!("git tag {}-v{}", weight, c.version); } println!(""); println!("# Run these commands to publish the crate and dependents:"); - let mut bfs = Bfs::new(&graph, *start); - while let Some(node) = bfs.next(&graph) { - let weight = graph.node_weight(node).unwrap(); - let c = crates.get(weight).unwrap(); + let mut bfs = Bfs::new(&rgraph, *start); + while let Some(node) = bfs.next(&rgraph) { + let weight = rgraph.node_weight(node).unwrap(); + let c = ctx.crates.get(weight).unwrap(); let mut args: Vec = vec![ "publish".to_string(), -- cgit From 648938b6623954a71ecee2990d57ce9df2e197b7 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 16:14:34 +0200 Subject: Make crate configs a vec. --- release/src/main.rs | 24 ++++++++++++++++-------- release/src/semver_check.rs | 25 ++++++++++++------------- release/src/types.rs | 2 +- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index 25f31486a..7850bbb8d 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -141,6 +141,14 @@ fn list_crates(root: &PathBuf) -> Result> { } } + let mut configs = metadata.build.clone(); + if configs.is_empty() { + configs.push(BuildConfig { + features: vec![], + target: None, + }) + } + crates.insert( id.clone(), Crate { @@ -148,10 +156,7 @@ fn list_crates(root: &PathBuf) -> Result> { version: parsed.package.version, path, dependencies, - config: metadata.build.first().cloned().unwrap_or_else(|| BuildConfig { - features: vec![], - target: None, - }), + configs, }, ); } @@ -332,10 +337,11 @@ fn main() -> Result<()> { c.path.join("Cargo.toml").display().to_string(), ]; + let config = c.configs.first().unwrap(); // TODO args.push("--features".into()); - args.push(c.config.features.join(",")); + args.push(config.features.join(",")); - if let Some(target) = &c.config.target { + if let Some(target) = &config.target { args.push("--target".into()); args.push(target.clone()); } @@ -387,6 +393,8 @@ fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { } fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { + let config = c.configs.first().unwrap(); // TODO + let mut args: Vec = vec![ "publish".to_string(), "--manifest-path".to_string(), @@ -394,9 +402,9 @@ fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { ]; args.push("--features".into()); - args.push(c.config.features.join(",")); + args.push(config.features.join(",")); - if let Some(target) = &c.config.target { + if let Some(target) = &config.target { args.push("--target".into()); args.push(target.clone()); } diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index e20bc8574..a70c56376 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -1,21 +1,20 @@ -use std::fs; -use std::io::Write; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc}; use crate::cargo::CargoArgsBuilder; -use crate::types::Crate; -use crate::windows_safe_path; +use crate::types::{BuildConfig, Crate}; /// Return the minimum required bump for the next release. /// Even if nothing changed this will be [ReleaseType::Patch] pub fn minimum_update(krate: &Crate) -> Result { println!("Crate = {:?}", krate); + let config = krate.configs.first().unwrap(); // TODO + let package_name = krate.name.clone(); let package_path = krate.path.clone(); - let current_path = build_doc_json(krate)?; + let current_path = build_doc_json(krate, config)?; let baseline = Rustdoc::from_registry_latest_crate_version(); let doc = Rustdoc::from_path(¤t_path); @@ -23,10 +22,10 @@ pub fn minimum_update(krate: &Crate) -> Result { semver_check.with_default_features(); semver_check.set_baseline(baseline); semver_check.set_packages(vec![package_name]); - let extra_current_features = krate.config.features.clone(); - let extra_baseline_features = krate.config.features.clone(); + let extra_current_features = config.features.clone(); + let extra_baseline_features = config.features.clone(); semver_check.set_extra_features(extra_current_features, extra_baseline_features); - if let Some(target) = &krate.config.target { + if let Some(target) = &config.target { semver_check.set_build_target(target.clone()); } let mut cfg = GlobalConfig::new(); @@ -48,7 +47,7 @@ pub fn minimum_update(krate: &Crate) -> Result { Ok(min_required_update) } -pub(crate) fn build_doc_json(krate: &Crate) -> Result { +pub(crate) fn build_doc_json(krate: &Crate, config: &BuildConfig) -> Result { let target_dir = std::env::var("CARGO_TARGET_DIR"); let target_path = if let Ok(target) = target_dir { @@ -58,7 +57,7 @@ pub(crate) fn build_doc_json(krate: &Crate) -> Result { }; let current_path = target_path; - let current_path = if let Some(target) = &krate.config.target { + let current_path = if let Some(target) = &config.target { current_path.join(target.clone()) } else { current_path @@ -68,7 +67,7 @@ pub(crate) fn build_doc_json(krate: &Crate) -> Result { .join(format!("{}.json", krate.name.to_string().replace("-", "_"))); std::fs::remove_file(¤t_path).ok(); - let features = krate.config.features.clone(); + let features = config.features.clone(); log::info!("Building doc json for {} with features: {:?}", krate.name, features); @@ -83,7 +82,7 @@ pub(crate) fn build_doc_json(krate: &Crate) -> Result { .toolchain("nightly-2025-06-29") .subcommand("rustdoc") .features(&features); - let cargo_builder = if let Some(target) = &krate.config.target { + let cargo_builder = if let Some(target) = &config.target { cargo_builder.target(target.clone()) } else { cargo_builder diff --git a/release/src/types.rs b/release/src/types.rs index 39e8e9f48..c5b774977 100644 --- a/release/src/types.rs +++ b/release/src/types.rs @@ -46,5 +46,5 @@ pub struct Crate { pub version: String, pub path: PathBuf, pub dependencies: Vec, - pub config: BuildConfig, // TODO make this a vec. + pub configs: Vec, } -- cgit From a34e0b1ec57350cfa1d61aa6fc2eced077be5623 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 17:05:45 +0200 Subject: Add build command. --- embassy-net-nrf91/Cargo.toml | 5 ++++ embassy-stm32-wpan/Cargo.toml | 5 ++++ embassy-usb-dfu/Cargo.toml | 6 +++++ release/src/build.rs | 45 ++++++++++++++++++++++++++++++++++-- release/src/cargo.rs | 54 +++++++++++++++++++++++++++++++++++++++---- release/src/main.rs | 6 ++++- 6 files changed, 113 insertions(+), 8 deletions(-) diff --git a/embassy-net-nrf91/Cargo.toml b/embassy-net-nrf91/Cargo.toml index 387627491..76b812efc 100644 --- a/embassy-net-nrf91/Cargo.toml +++ b/embassy-net-nrf91/Cargo.toml @@ -29,6 +29,11 @@ heapless = "0.8" embedded-io = "0.6.1" at-commands = "0.5.4" +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = ["defmt", "nrf-pac/nrf9160"]} +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-nrf91-v$VERSION/embassy-net-nrf91/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-nrf91/src/" diff --git a/embassy-stm32-wpan/Cargo.toml b/embassy-stm32-wpan/Cargo.toml index 0932e4739..f7b20cedc 100644 --- a/embassy-stm32-wpan/Cargo.toml +++ b/embassy-stm32-wpan/Cargo.toml @@ -9,6 +9,11 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-stm32-wpan" +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = ["stm32wb55rg"]}, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-wpan-v$VERSION/embassy-stm32-wpan/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32-wpan/src/" diff --git a/embassy-usb-dfu/Cargo.toml b/embassy-usb-dfu/Cargo.toml index 8d1f231ed..ce2f80b31 100644 --- a/embassy-usb-dfu/Cargo.toml +++ b/embassy-usb-dfu/Cargo.toml @@ -12,6 +12,12 @@ categories = [ "asynchronous" ] +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = [ "defmt", "cortex-m", "dfu" ] }, + { target = "thumbv7em-none-eabi", features = [ "defmt", "cortex-m", "application" ] }, +] + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-usb-v$VERSION/embassy-usb-dfu/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-usb-dfu/src/" diff --git a/release/src/build.rs b/release/src/build.rs index adf251b4d..d1abb2aa1 100644 --- a/release/src/build.rs +++ b/release/src/build.rs @@ -1,5 +1,46 @@ use anyhow::Result; -pub(crate) fn build(ctx: &crate::Context) -> Result<()> { - todo!() +use crate::cargo::{CargoArgsBuilder, CargoBatchBuilder}; + +pub(crate) fn build(ctx: &crate::Context, crate_name: Option<&str>) -> Result<()> { + let mut batch_builder = CargoBatchBuilder::new(); + + // Process either specific crate or all crates + let crates_to_build: Vec<_> = if let Some(name) = crate_name { + // Build only the specified crate + if let Some(krate) = ctx.crates.get(name) { + vec![krate] + } else { + return Err(anyhow::anyhow!("Crate '{}' not found", name)); + } + } else { + // Build all crates + ctx.crates.values().collect() + }; + + // Process selected crates and add their build configurations to the batch + for krate in crates_to_build { + for config in &krate.configs { + let mut args_builder = CargoArgsBuilder::new() + .subcommand("build") + .arg("--release") + .arg(format!("--manifest-path={}/Cargo.toml", krate.path.to_string_lossy())); + + if let Some(ref target) = config.target { + args_builder = args_builder.target(target); + } + + if !config.features.is_empty() { + args_builder = args_builder.features(&config.features); + } + + batch_builder.add_command(args_builder.build()); + } + } + + // Execute the cargo batch command + let batch_args = batch_builder.build(); + crate::cargo::run(&batch_args, &ctx.root)?; + + Ok(()) } diff --git a/release/src/cargo.rs b/release/src/cargo.rs index 1a4f79f20..0b28458e9 100644 --- a/release/src/cargo.rs +++ b/release/src/cargo.rs @@ -1,10 +1,8 @@ //! Tools for working with Cargo. -use std::{ - ffi::OsStr, - path::{Path, PathBuf}, - process::{Command, Stdio}, -}; +use std::ffi::OsStr; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; use anyhow::{bail, Context as _, Result}; use clap::ValueEnum as _; @@ -106,6 +104,17 @@ pub struct CargoArgsBuilder { } impl CargoArgsBuilder { + #[must_use] + pub fn new() -> Self { + Self { + toolchain: None, + subcommand: String::new(), + target: None, + features: vec![], + args: vec![], + } + } + #[must_use] pub fn toolchain(mut self, toolchain: S) -> Self where @@ -192,3 +201,38 @@ impl CargoArgsBuilder { args } } + +#[derive(Debug, Default)] +pub struct CargoBatchBuilder { + commands: Vec>, +} + +impl CargoBatchBuilder { + #[must_use] + pub fn new() -> Self { + Self { commands: vec![] } + } + + #[must_use] + pub fn command(mut self, args: Vec) -> Self { + self.commands.push(args); + self + } + + pub fn add_command(&mut self, args: Vec) -> &mut Self { + self.commands.push(args); + self + } + + #[must_use] + pub fn build(&self) -> Vec { + let mut args = vec!["batch".to_string()]; + + for command in &self.commands { + args.push("---".to_string()); + args.extend(command.clone()); + } + + args + } +} diff --git a/release/src/main.rs b/release/src/main.rs index 7850bbb8d..b1bc17255 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -134,6 +134,10 @@ fn list_crates(root: &PathBuf) -> Result> { let metadata = &parsed.package.metadata.embassy; + if metadata.skip { + continue; + } + let mut dependencies = Vec::new(); for (k, _) in parsed.dependencies { if k.starts_with("embassy-") { @@ -266,7 +270,7 @@ fn main() -> Result<()> { } } Command::Build { crate_name } => { - build::build(&ctx)?; + build::build(&ctx, crate_name.as_deref())?; } Command::SemverCheck { crate_name } => { let c = ctx.crates.get(&crate_name).unwrap(); -- cgit From 3a6ea3a31c90179fb3cbd30c18e3a310e2ee647c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 19:01:56 +0200 Subject: Load all crates in the graph, honor the "publish" flag to prevent publishing examples/tests. --- docs/examples/basic/Cargo.toml | 6 + .../layer-by-layer/blinky-async/Cargo.toml | 6 + docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 6 + docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 6 + docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 6 + examples/boot/application/nrf/Cargo.toml | 10 ++ examples/boot/application/rp/Cargo.toml | 6 + examples/boot/application/stm32f3/Cargo.toml | 6 + examples/boot/application/stm32f7/Cargo.toml | 6 + examples/boot/application/stm32h7/Cargo.toml | 6 + examples/boot/application/stm32l0/Cargo.toml | 6 + examples/boot/application/stm32l1/Cargo.toml | 6 + examples/boot/application/stm32l4/Cargo.toml | 6 + examples/boot/application/stm32wb-dfu/Cargo.toml | 6 + examples/boot/application/stm32wba-dfu/Cargo.toml | 6 + examples/boot/application/stm32wl/Cargo.toml | 6 + examples/boot/bootloader/nrf/Cargo.toml | 10 ++ examples/boot/bootloader/rp/Cargo.toml | 6 + .../boot/bootloader/stm32-dual-bank/Cargo.toml | 6 + examples/boot/bootloader/stm32/Cargo.toml | 6 + examples/boot/bootloader/stm32wb-dfu/Cargo.toml | 7 ++ examples/boot/bootloader/stm32wba-dfu/Cargo.toml | 6 + examples/lpc55s69/Cargo.toml | 6 + examples/mimxrt1011/Cargo.toml | 6 + examples/mimxrt1062-evk/Cargo.toml | 6 + examples/mimxrt6/Cargo.toml | 6 + examples/mspm0c1104/Cargo.toml | 7 ++ examples/mspm0g3507/Cargo.toml | 6 + examples/mspm0g3519/Cargo.toml | 6 + examples/mspm0l1306/Cargo.toml | 6 + examples/mspm0l2228/Cargo.toml | 6 + examples/nrf-rtos-trace/Cargo.toml | 6 + examples/nrf-rtos-trace/build.rs | 2 - examples/nrf51/Cargo.toml | 6 + examples/nrf52810/Cargo.toml | 6 + examples/nrf52840-rtic/Cargo.toml | 6 + examples/nrf52840/Cargo.toml | 6 + examples/nrf5340/Cargo.toml | 6 + examples/nrf54l15/Cargo.toml | 6 + examples/nrf9151/ns/Cargo.toml | 6 + examples/nrf9151/s/Cargo.toml | 6 + examples/nrf9160/Cargo.toml | 6 + examples/rp/Cargo.toml | 6 + examples/rp235x/Cargo.toml | 6 + examples/std/Cargo.toml | 6 + examples/stm32c0/Cargo.toml | 6 + examples/stm32f0/Cargo.toml | 6 + examples/stm32f1/Cargo.toml | 6 + examples/stm32f2/Cargo.toml | 6 + examples/stm32f3/Cargo.toml | 6 + examples/stm32f334/Cargo.toml | 6 + examples/stm32f4/Cargo.toml | 6 + examples/stm32f469/Cargo.toml | 6 + examples/stm32f7/Cargo.toml | 6 + examples/stm32g0/Cargo.toml | 6 + examples/stm32g4/Cargo.toml | 6 + examples/stm32h5/Cargo.toml | 6 + examples/stm32h7/Cargo.toml | 6 + examples/stm32h723/Cargo.toml | 6 + examples/stm32h735/Cargo.toml | 6 + examples/stm32h742/Cargo.toml | 6 + examples/stm32h755cm4/Cargo.toml | 6 + examples/stm32h755cm7/Cargo.toml | 6 + examples/stm32h7b0/Cargo.toml | 6 + examples/stm32h7rs/Cargo.toml | 6 + examples/stm32l0/Cargo.toml | 6 + examples/stm32l1/Cargo.toml | 6 + examples/stm32l4/Cargo.toml | 6 + examples/stm32l432/Cargo.toml | 6 + examples/stm32l5/Cargo.toml | 6 + examples/stm32u0/Cargo.toml | 6 + examples/stm32u5/Cargo.toml | 6 + examples/stm32wb/Cargo.toml | 6 + examples/stm32wba/Cargo.toml | 6 + examples/stm32wba6/Cargo.toml | 6 + examples/stm32wl/Cargo.toml | 6 + examples/wasm/Cargo.toml | 6 + release/src/build.rs | 4 + release/src/cargo.rs | 9 ++ release/src/main.rs | 130 +++++++++++++++------ release/src/types.rs | 9 ++ tests/mspm0/Cargo.toml | 6 + tests/nrf/Cargo.toml | 11 ++ tests/perf-client/Cargo.toml | 1 + tests/perf-server/Cargo.toml | 1 + tests/riscv32/Cargo.toml | 6 + tests/rp/Cargo.toml | 7 ++ tests/stm32/Cargo.toml | 34 ++++++ tests/utils/Cargo.toml | 1 + tests/utils/src/bin/saturate_serial.rs | 7 +- 90 files changed, 651 insertions(+), 43 deletions(-) diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 15fd42703..5fb137898 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -5,6 +5,7 @@ name = "embassy-basic-example" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } @@ -16,3 +17,8 @@ defmt-rtt = "1.0.0" cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } cortex-m-rt = "0.7.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index dd0adf938..f1f678df3 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" @@ -13,3 +14,8 @@ embassy-executor = { version = "0.8.0", path = "../../../../embassy-executor", f defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index 55795e4e2..cdfc4b850 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m-rt = "0.7" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } @@ -12,3 +13,8 @@ embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", feature defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 4a4bda4c4..b15b228fc 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -6,6 +6,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } @@ -14,3 +15,8 @@ embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", feature defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index 4e7e2f2ff..0d4711da2 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" @@ -12,3 +13,8 @@ stm32-metapac = { version = "16", features = ["stm32l475vg"] } defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index c8e1def4a..f55b14f38 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-nrf-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -32,3 +33,12 @@ defmt = [ "embassy-boot-nrf/defmt", "embassy-sync/defmt", ] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["embassy-nrf/nrf52840", "skip-include"], artifact-dir = "out/examples/boot/nrf52840" }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9160-ns", "skip-include"], artifact-dir = "out/examples/boot/nrf9160" }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9120-ns", "skip-include"], artifact-dir = "out/examples/boot/nrf9120" }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9151-ns", "skip-include"], artifact-dir = "out/examples/boot/nrf9151" }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9161-ns", "skip-include"], artifact-dir = "out/examples/boot/nrf9161" } +] diff --git a/examples/boot/application/rp/Cargo.toml b/examples/boot/application/rp/Cargo.toml index 7fd6f8f97..c60f2b9a8 100644 --- a/examples/boot/application/rp/Cargo.toml +++ b/examples/boot/application/rp/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-rp-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -34,3 +35,8 @@ skip-include = [] [profile.release] debug = true + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/rp" } +] diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index f9d5922b1..004050d40 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32f3-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -29,3 +30,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32f3" } +] diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index f831e7f68..74a1d498e 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32f7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -30,3 +31,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32f7" } +] diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 29d54c47f..acf1da96d 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32h7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -30,3 +31,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32h7" } +] diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index 7c6c1dc78..0f5e8ac08 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32l0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -29,3 +30,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32l0" } +] diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index ecb498325..eb7279fb0 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32l1-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -29,3 +30,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32l1" } +] diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 075f7b986..1d1830ba0 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32l4-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -29,3 +30,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32l4" } +] diff --git a/examples/boot/application/stm32wb-dfu/Cargo.toml b/examples/boot/application/stm32wb-dfu/Cargo.toml index 65fac6062..5aa48c31b 100644 --- a/examples/boot/application/stm32wb-dfu/Cargo.toml +++ b/examples/boot/application/stm32wb-dfu/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32wb-dfu-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -30,3 +31,8 @@ defmt = [ "embassy-boot-stm32/defmt", "embassy-sync/defmt", ] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/boot/stm32wb-dfu" } +] diff --git a/examples/boot/application/stm32wba-dfu/Cargo.toml b/examples/boot/application/stm32wba-dfu/Cargo.toml index 469924422..880551ad7 100644 --- a/examples/boot/application/stm32wba-dfu/Cargo.toml +++ b/examples/boot/application/stm32wba-dfu/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32wba-dfu-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -30,3 +31,8 @@ defmt = [ "embassy-boot-stm32/defmt", "embassy-sync/defmt", ] + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/boot/stm32wba-dfu" } +] diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index fb8112edf..ee9ab0729 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-boot-stm32wl-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../../../embassy-sync" } @@ -29,3 +30,8 @@ defmt = [ "embassy-sync/defmt", ] skip-include = [] + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["skip-include"], artifact-dir = "out/examples/boot/stm32wl" } +] diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml index 157448054..2b54bbec8 100644 --- a/examples/boot/bootloader/nrf/Cargo.toml +++ b/examples/boot/bootloader/nrf/Cargo.toml @@ -4,6 +4,7 @@ name = "nrf-bootloader-example" version = "0.1.0" description = "Bootloader for nRF chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -57,3 +58,12 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["embassy-nrf/nrf52840"] }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9160-ns"] }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9120-ns"] }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9151-ns"] }, + { target = "thumbv8m.main-none-eabihf", features = ["embassy-nrf/nrf9161-ns"] } +] diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index 034043274..b89332f0b 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml @@ -4,6 +4,7 @@ name = "rp-bootloader-example" version = "0.1.0" description = "Example bootloader for RP2040 chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -31,3 +32,8 @@ defmt = [ [profile.release] debug = true opt-level = 's' + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi" } +] diff --git a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml index 75c7783b8..82fbee9f1 100644 --- a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml +++ b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml @@ -4,6 +4,7 @@ name = "stm32-bootloader-dual-bank-flash-example" version = "0.1.0" description = "Example bootloader for dual-bank flash STM32 chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -54,3 +55,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["embassy-stm32/stm32h743zi"] } +] diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index 3f54b823b..a9a4aa95a 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml @@ -4,6 +4,7 @@ name = "stm32-bootloader-example" version = "0.1.0" description = "Example bootloader for STM32 chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -56,3 +57,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["embassy-stm32/stm32l496zg"] } +] diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml index 1aad71ebc..75783d66e 100644 --- a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml +++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml @@ -4,6 +4,7 @@ name = "stm32wb-dfu-bootloader-example" version = "0.1.0" description = "Example USB DFUbootloader for the STM32WB series of chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -62,3 +63,9 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", features = ["embassy-stm32/stm32wb55rg"] }, + { target = "thumbv7em-none-eabi", features = ["embassy-stm32/stm32wb55rg", "verify"] } +] diff --git a/examples/boot/bootloader/stm32wba-dfu/Cargo.toml b/examples/boot/bootloader/stm32wba-dfu/Cargo.toml index e31edb699..773060ab3 100644 --- a/examples/boot/bootloader/stm32wba-dfu/Cargo.toml +++ b/examples/boot/bootloader/stm32wba-dfu/Cargo.toml @@ -4,6 +4,7 @@ name = "stm32wba6-dfu-bootloader-example" version = "0.1.0" description = "Example USB DFUbootloader for the STM32WBA series of chips" license = "MIT OR Apache-2.0" +publish = false [dependencies] defmt = { version = "1.0.1", optional = true } @@ -62,3 +63,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", features = ["embassy-stm32/stm32wba65ri", "verify"] } +] diff --git a/examples/lpc55s69/Cargo.toml b/examples/lpc55s69/Cargo.toml index d66e3e2ec..bf28ee20f 100644 --- a/examples/lpc55s69/Cargo.toml +++ b/examples/lpc55s69/Cargo.toml @@ -4,6 +4,7 @@ name = "embassy-nxp-lpc55s69-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-nxp = { version = "0.1.0", path = "../../embassy-nxp", features = ["lpc55", "rt", "defmt", "time-driver-rtc"] } @@ -20,3 +21,8 @@ panic-semihosting = "0.6.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/lpc55s69" } +] diff --git a/examples/mimxrt1011/Cargo.toml b/examples/mimxrt1011/Cargo.toml index 59b1eaa10..49d628811 100644 --- a/examples/mimxrt1011/Cargo.toml +++ b/examples/mimxrt1011/Cargo.toml @@ -3,6 +3,7 @@ name = "embassy-imxrt1011-examples" version = "0.1.0" edition = "2021" license = "MIT or Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] } @@ -27,3 +28,8 @@ imxrt-rt = { version = "0.1.7", features = ["device"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabihf", artifact-dir = "out/examples/mimxrt1011" } +] diff --git a/examples/mimxrt1062-evk/Cargo.toml b/examples/mimxrt1062-evk/Cargo.toml index bfa06f608..816695a32 100644 --- a/examples/mimxrt1062-evk/Cargo.toml +++ b/examples/mimxrt1062-evk/Cargo.toml @@ -3,6 +3,7 @@ name = "embassy-imxrt1062-evk-examples" version = "0.1.0" edition = "2021" license = "MIT or Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] } @@ -27,3 +28,8 @@ imxrt-rt = { version = "0.1.7", features = ["device"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabihf", artifact-dir = "out/examples/mimxrt1062-evk" } +] diff --git a/examples/mimxrt6/Cargo.toml b/examples/mimxrt6/Cargo.toml index 2667ec089..8ae636921 100644 --- a/examples/mimxrt6/Cargo.toml +++ b/examples/mimxrt6/Cargo.toml @@ -3,6 +3,7 @@ name = "embassy-imxrt-examples" version = "0.1.0" edition = "2021" license = "MIT or Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] } @@ -58,3 +59,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/mimxrt6" } +] diff --git a/examples/mspm0c1104/Cargo.toml b/examples/mspm0c1104/Cargo.toml index 93ae4913a..decb1a6e2 100644 --- a/examples/mspm0c1104/Cargo.toml +++ b/examples/mspm0c1104/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-c1104-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-mspm0 = { version = "0.1.0", path = "../../embassy-mspm0", features = ["mspm0c1104dgs20", "defmt", "rt", "time-driver-any"] } @@ -30,3 +31,9 @@ debug = 0 opt-level = "z" lto = true codegen-units = 1 + +[package.metadata.embassy] +skip = true # TODO: remove when we find a way to decrease the defmt buffer size in ci. +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/mspm0c1104" } +] diff --git a/examples/mspm0g3507/Cargo.toml b/examples/mspm0g3507/Cargo.toml index 7544db230..04efb681c 100644 --- a/examples/mspm0g3507/Cargo.toml +++ b/examples/mspm0g3507/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-g3507-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-mspm0 = { version = "0.1.0", path = "../../embassy-mspm0", features = ["mspm0g3507pm", "defmt", "rt", "time-driver-any"] } @@ -21,3 +22,8 @@ embedded-io-async = "0.6.1" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/mspm0g3507" } +] diff --git a/examples/mspm0g3519/Cargo.toml b/examples/mspm0g3519/Cargo.toml index 145a67b96..bb31b52ff 100644 --- a/examples/mspm0g3519/Cargo.toml +++ b/examples/mspm0g3519/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-g3519-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-mspm0 = { version = "0.1.0", path = "../../embassy-mspm0", features = ["mspm0g3519pz", "defmt", "rt", "time-driver-any"] } @@ -19,3 +20,8 @@ panic-semihosting = "0.6.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/mspm0g3519" } +] diff --git a/examples/mspm0l1306/Cargo.toml b/examples/mspm0l1306/Cargo.toml index 724ca58a0..c41017e17 100644 --- a/examples/mspm0l1306/Cargo.toml +++ b/examples/mspm0l1306/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-l1306-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-mspm0 = { version = "0.1.0", path = "../../embassy-mspm0", features = ["mspm0l1306rhb", "defmt", "rt", "time-driver-any"] } @@ -23,3 +24,8 @@ debug = 2 [profile.dev] debug = 2 opt-level = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/mspm0l1306" } +] diff --git a/examples/mspm0l2228/Cargo.toml b/examples/mspm0l2228/Cargo.toml index 0bec500db..7295eb599 100644 --- a/examples/mspm0l2228/Cargo.toml +++ b/examples/mspm0l2228/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-l2228-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-mspm0 = { version = "0.1.0", path = "../../embassy-mspm0", features = ["mspm0l2228pn", "defmt", "rt", "time-driver-any"] } @@ -19,3 +20,8 @@ panic-semihosting = "0.6.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/mspm0l2228" } +] diff --git a/examples/nrf-rtos-trace/Cargo.toml b/examples/nrf-rtos-trace/Cargo.toml index 4ef986d96..60875f434 100644 --- a/examples/nrf-rtos-trace/Cargo.toml +++ b/examples/nrf-rtos-trace/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf-rtos-trace-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [features] default = ["log"] @@ -34,3 +35,8 @@ name = "rtos_trace" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/nrf-rtos-trace" } +] diff --git a/examples/nrf-rtos-trace/build.rs b/examples/nrf-rtos-trace/build.rs index 36cdb65a8..cd1a264c4 100644 --- a/examples/nrf-rtos-trace/build.rs +++ b/examples/nrf-rtos-trace/build.rs @@ -31,6 +31,4 @@ fn main() { println!("cargo:rustc-link-arg-bins=--nmagic"); println!("cargo:rustc-link-arg-bins=-Tlink.x"); - #[cfg(feature = "defmt")] - println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); } diff --git a/examples/nrf51/Cargo.toml b/examples/nrf51/Cargo.toml index 524feca38..93acdab8a 100644 --- a/examples/nrf51/Cargo.toml +++ b/examples/nrf51/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf51-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } @@ -18,3 +19,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/nrf51" } +] diff --git a/examples/nrf52810/Cargo.toml b/examples/nrf52810/Cargo.toml index 2b4612a51..000521265 100644 --- a/examples/nrf52810/Cargo.toml +++ b/examples/nrf52810/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf52810-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } @@ -22,3 +23,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/nrf52810" } +] diff --git a/examples/nrf52840-rtic/Cargo.toml b/examples/nrf52840-rtic/Cargo.toml index d5fddd46e..5e37913a9 100644 --- a/examples/nrf52840-rtic/Cargo.toml +++ b/examples/nrf52840-rtic/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf52840-rtic-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] rtic = { version = "2", features = ["thumbv7-backend"] } @@ -22,3 +23,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/nrf52840-rtic" } +] diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index b28ee0f4f..026681822 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf52840-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } @@ -37,3 +38,8 @@ microfft = "0.5.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/nrf52840" } +] diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml index 19c5e707f..36f74e4b1 100644 --- a/examples/nrf5340/Cargo.toml +++ b/examples/nrf5340/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf5340-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } @@ -27,3 +28,8 @@ serde = { version = "1.0.136", default-features = false } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/nrf5340" } +] diff --git a/examples/nrf54l15/Cargo.toml b/examples/nrf54l15/Cargo.toml index 5f1ee50a0..b794b217c 100644 --- a/examples/nrf54l15/Cargo.toml +++ b/examples/nrf54l15/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf54l15-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } @@ -20,3 +21,8 @@ embedded-storage = "0.3.1" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/nrf54l15" } +] diff --git a/examples/nrf9151/ns/Cargo.toml b/examples/nrf9151/ns/Cargo.toml index e7551723d..35550b8c5 100644 --- a/examples/nrf9151/ns/Cargo.toml +++ b/examples/nrf9151/ns/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf9151-non-secure-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } @@ -18,3 +19,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/nrf9151/ns" } +] diff --git a/examples/nrf9151/s/Cargo.toml b/examples/nrf9151/s/Cargo.toml index 7f675c5e1..3ef8b33fd 100644 --- a/examples/nrf9151/s/Cargo.toml +++ b/examples/nrf9151/s/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf9151-secure-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } @@ -18,3 +19,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/nrf9151/s" } +] diff --git a/examples/nrf9160/Cargo.toml b/examples/nrf9160/Cargo.toml index 263986c4e..245232c1f 100644 --- a/examples/nrf9160/Cargo.toml +++ b/examples/nrf9160/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf9160-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } @@ -24,3 +25,8 @@ embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/nrf9160" } +] diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index afe8a90d8..d97ebf43e 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml @@ -4,6 +4,7 @@ name = "embassy-rp-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-embedded-hal = { version = "0.4.0", path = "../../embassy-embedded-hal", features = ["defmt"] } @@ -60,3 +61,8 @@ embedded-sdmmc = "0.7.0" [profile.release] # Enable generation of debug symbols even on release builds debug = true + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/rp" } +] diff --git a/examples/rp235x/Cargo.toml b/examples/rp235x/Cargo.toml index 9087c4c83..2c279d7e1 100644 --- a/examples/rp235x/Cargo.toml +++ b/examples/rp235x/Cargo.toml @@ -4,6 +4,7 @@ name = "embassy-rp2350-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-embedded-hal = { version = "0.4.0", path = "../../embassy-embedded-hal", features = ["defmt"] } @@ -60,3 +61,8 @@ embedded-sdmmc = "0.7.0" [profile.release] # Enable generation of debug symbols even on release builds debug = true + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/rp235x" } +] diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 9b0ff8be2..6d56d97af 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-std-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../embassy-sync", features = ["log"] } @@ -27,3 +28,8 @@ static_cell = "2" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { artifact-dir = "out/examples/std" } +] diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml index 0a8d4ff2d..56b966d49 100644 --- a/examples/stm32c0/Cargo.toml +++ b/examples/stm32c0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32c0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32c031c6 to your chip name, if necessary. @@ -23,3 +24,8 @@ chrono = { version = "^0.4", default-features = false} [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/stm32c0" } +] diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index c3d1b99e5..6cc6eac46 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml @@ -3,6 +3,7 @@ name = "embassy-stm32f0-examples" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f091rc to your chip name, if necessary. @@ -20,3 +21,8 @@ portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/stm32f0" } +] diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index b91c781db..3cb7bd5e3 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f1-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f103c8 to your chip name, if necessary. @@ -29,3 +30,8 @@ opt-level = "s" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", artifact-dir = "out/examples/stm32f1" } +] diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index 74ecb141d..9c5a7cd7f 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f2-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f207zg to your chip name, if necessary. @@ -23,3 +24,8 @@ nb = "1.0.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", artifact-dir = "out/examples/stm32f2" } +] diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 2cea5028a..690bcb00d 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f3-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f303ze to your chip name, if necessary. @@ -27,3 +28,8 @@ static_cell = "2" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f3" } +] diff --git a/examples/stm32f334/Cargo.toml b/examples/stm32f334/Cargo.toml index 8d015eae7..709da6ed6 100644 --- a/examples/stm32f334/Cargo.toml +++ b/examples/stm32f334/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f334-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../embassy-sync", features = ["defmt"] } @@ -23,3 +24,8 @@ heapless = { version = "0.8", default-features = false } nb = "1.0.0" embedded-storage = "0.3.1" static_cell = "2" + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f334" } +] diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index 3139bdf71..52b48e744 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f4-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f429zi to your chip name, if necessary. @@ -37,3 +38,8 @@ chrono = { version = "^0.4", default-features = false} [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f4" } +] diff --git a/examples/stm32f469/Cargo.toml b/examples/stm32f469/Cargo.toml index a35a811e2..612081242 100644 --- a/examples/stm32f469/Cargo.toml +++ b/examples/stm32f469/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f469-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Specific examples only for stm32f469 @@ -20,3 +21,8 @@ panic-probe = { version = "1.0.0", features = ["print-defmt"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f469" } +] diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index 261524bc1..1e5ea8d33 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f777zi to your chip name, if necessary. @@ -33,3 +34,8 @@ aes-gcm = { version = "0.10.3", default-features = false, features = ["aes", "he [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f7" } +] diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index 61e20168c..7b0da5077 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32g0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32g0b1re to your chip name, if necessary. @@ -27,3 +28,8 @@ embedded-io-async = { version = "0.6.1" } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/stm32g0" } +] diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index c25df6ea8..15292725f 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32g4-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32g491re to your chip name, if necessary. @@ -27,3 +28,8 @@ static_cell = "2.0.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32g4" } +] diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml index 68563dba0..7f9a77e85 100644 --- a/examples/stm32h5/Cargo.toml +++ b/examples/stm32h5/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h5-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h563zi to your chip name, if necessary. @@ -69,3 +70,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/stm32h5" } +] diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index 04c9b5bda..be0e46938 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h743bi to your chip name, if necessary. @@ -72,3 +73,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h7" } +] diff --git a/examples/stm32h723/Cargo.toml b/examples/stm32h723/Cargo.toml index f7d819867..5a762259b 100644 --- a/examples/stm32h723/Cargo.toml +++ b/examples/stm32h723/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h723-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h723zg to your chip name, if necessary. @@ -66,3 +67,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h723" } +] diff --git a/examples/stm32h735/Cargo.toml b/examples/stm32h735/Cargo.toml index 946daf550..0b55424e8 100644 --- a/examples/stm32h735/Cargo.toml +++ b/examples/stm32h735/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h735-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-stm32 = { version = "0.3.0", path = "../../embassy-stm32", features = ["defmt", "stm32h735ig", "time-driver-tim2", "exti", "memory-x", "unstable-pac", "chrono"] } @@ -59,3 +60,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h735" } +] diff --git a/examples/stm32h742/Cargo.toml b/examples/stm32h742/Cargo.toml index 8448c2c7a..067663538 100644 --- a/examples/stm32h742/Cargo.toml +++ b/examples/stm32h742/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32f7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32f777zi to your chip name, if necessary. @@ -63,3 +64,8 @@ aes-gcm = { version = "0.10.3", default-features = false, features = [ [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h742" } +] diff --git a/examples/stm32h755cm4/Cargo.toml b/examples/stm32h755cm4/Cargo.toml index e1ddf59be..6cd1893d2 100644 --- a/examples/stm32h755cm4/Cargo.toml +++ b/examples/stm32h755cm4/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h755cm4-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h755zi-cm4 to your chip name, if necessary. @@ -64,3 +65,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h755cm4" } +] diff --git a/examples/stm32h755cm7/Cargo.toml b/examples/stm32h755cm7/Cargo.toml index b09095ea1..48783fc7a 100644 --- a/examples/stm32h755cm7/Cargo.toml +++ b/examples/stm32h755cm7/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h755cm7-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h743bi to your chip name, if necessary. @@ -62,3 +63,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h755cm7" } +] diff --git a/examples/stm32h7b0/Cargo.toml b/examples/stm32h7b0/Cargo.toml index dc876159a..c0d047bd4 100644 --- a/examples/stm32h7b0/Cargo.toml +++ b/examples/stm32h7b0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h7b0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-stm32 = { version = "0.3.0", path = "../../embassy-stm32", features = ["defmt", "stm32h7b0vb", "time-driver-tim2", "exti", "memory-x", "unstable-pac", "chrono"] } @@ -71,3 +72,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h7b0" } +] diff --git a/examples/stm32h7rs/Cargo.toml b/examples/stm32h7rs/Cargo.toml index 4068fa5df..dcd5b078d 100644 --- a/examples/stm32h7rs/Cargo.toml +++ b/examples/stm32h7rs/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32h7rs-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32h743bi to your chip name, if necessary. @@ -70,3 +71,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32h7rs" } +] diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index b76f6765f..47ccedeb0 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32l0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32l072cz to your chip name, if necessary. @@ -28,3 +29,8 @@ portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/stm32l0" } +] diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 442a5c795..659524cb3 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32l1-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-sync = { version = "0.7.1", path = "../../embassy-sync", features = ["defmt"] } @@ -24,3 +25,8 @@ embedded-storage = "0.3.1" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", artifact-dir = "out/examples/stm32l1" } +] diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index bbe592212..02fd4ce93 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32l4-examples" version = "0.1.1" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32l4s5vi to your chip name, if necessary. @@ -36,3 +37,8 @@ micromath = "2.0.0" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32l4" } +] diff --git a/examples/stm32l432/Cargo.toml b/examples/stm32l432/Cargo.toml index 483403b1d..14db1fb2f 100644 --- a/examples/stm32l432/Cargo.toml +++ b/examples/stm32l432/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32l4-examples" version = "0.1.1" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32l4s5vi to your chip name, if necessary. @@ -28,3 +29,8 @@ debug = 2 name = "qspi_mmap" path = "src/bin/qspi_mmap.rs" test = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32l432" } +] diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index 1739f0889..42b46ee0f 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32l5-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32l552ze to your chip name, if necessary. @@ -32,3 +33,8 @@ debug = 2 [[bin]] name = "stop" default-features = ["embassy-stm32/low-power"] + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/stm32l5" } +] diff --git a/examples/stm32u0/Cargo.toml b/examples/stm32u0/Cargo.toml index 1362aa422..09e5eb20c 100644 --- a/examples/stm32u0/Cargo.toml +++ b/examples/stm32u0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32u0-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32u083rc to your chip name, if necessary. @@ -27,3 +28,8 @@ chrono = { version = "0.4.38", default-features = false } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", artifact-dir = "out/examples/stm32u0" } +] diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index 53f4ee618..8b5d52aa4 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32u5-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32u5g9zj to your chip name, if necessary. @@ -32,3 +33,8 @@ trustzone-secure = ["embassy-stm32/trustzone-secure"] [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/stm32u5" } +] diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 1b2fb9cbd..14e6dfa15 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32wb-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32wb55rg to your chip name in both dependencies, if necessary. @@ -54,3 +55,8 @@ required-features = ["ble"] [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32wb" } +] diff --git a/examples/stm32wba/Cargo.toml b/examples/stm32wba/Cargo.toml index a6ea433cf..9c11528cd 100644 --- a/examples/stm32wba/Cargo.toml +++ b/examples/stm32wba/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32wba-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-stm32 = { version = "0.3.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba55cg", "time-driver-any", "memory-x", "exti"] } @@ -23,3 +24,8 @@ static_cell = "2" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/stm32wba" } +] diff --git a/examples/stm32wba6/Cargo.toml b/examples/stm32wba6/Cargo.toml index 980091eaf..f1f9cf88b 100644 --- a/examples/stm32wba6/Cargo.toml +++ b/examples/stm32wba6/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32wba-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-stm32 = { version = "0.3.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba65ri", "time-driver-any", "memory-x", "exti"] } @@ -24,3 +25,8 @@ static_cell = "2" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv8m.main-none-eabihf", artifact-dir = "out/examples/stm32wba6" } +] diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 31729565d..a75e4ed30 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-stm32wl-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] # Change stm32wl55jc-cm4 to your chip name, if necessary. @@ -25,3 +26,8 @@ chrono = { version = "^0.4", default-features = false } [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32wl" } +] diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index af139fdbd..28b4f1c30 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-wasm-example" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [lib] crate-type = ["cdylib"] @@ -19,3 +20,8 @@ log = "0.4.11" [profile.release] debug = 2 + +[package.metadata.embassy] +build = [ + { target = "wasm32-unknown-unknown", artifact-dir = "out/examples/wasm" } +] diff --git a/release/src/build.rs b/release/src/build.rs index d1abb2aa1..7c777d36c 100644 --- a/release/src/build.rs +++ b/release/src/build.rs @@ -34,6 +34,10 @@ pub(crate) fn build(ctx: &crate::Context, crate_name: Option<&str>) -> Result<() args_builder = args_builder.features(&config.features); } + if let Some(ref artifact_dir) = config.artifact_dir { + args_builder = args_builder.artifact_dir(artifact_dir); + } + batch_builder.add_command(args_builder.build()); } } diff --git a/release/src/cargo.rs b/release/src/cargo.rs index 0b28458e9..826a3a8b2 100644 --- a/release/src/cargo.rs +++ b/release/src/cargo.rs @@ -148,6 +148,15 @@ impl CargoArgsBuilder { self } + #[must_use] + pub fn artifact_dir(mut self, artifact_dir: S) -> Self + where + S: Into, + { + self.args.push(format!("--artifact-dir={}", artifact_dir.into())); + self + } + #[must_use] pub fn arg(mut self, arg: S) -> Self where diff --git a/release/src/main.rs b/release/src/main.rs index b1bc17255..5605ca332 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -3,7 +3,7 @@ use std::fs; use std::path::{Path, PathBuf}; use std::process::Command as ProcessCommand; -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, bail, Result}; use clap::{Parser, Subcommand}; use log::info; use petgraph::graph::{Graph, NodeIndex}; @@ -13,6 +13,25 @@ use simple_logger::SimpleLogger; use toml_edit::{DocumentMut, Item, Value}; use types::*; +fn check_publish_dependencies(ctx: &Context) -> Result<()> { + for krate in ctx.crates.values() { + if krate.publish { + for dep_name in &krate.dependencies { + if let Some(dep_crate) = ctx.crates.get(dep_name) { + if !dep_crate.publish { + return Err(anyhow!( + "Publishable crate '{}' depends on non-publishable crate '{}'. This is not allowed.", + krate.name, + dep_name + )); + } + } + } + } + } + Ok(()) +} + mod build; mod cargo; mod semver_check; @@ -56,7 +75,7 @@ enum Command { }, /// SemverCheck SemverCheck { - /// Crate to check. Will traverse that crate an it's dependents. If not specified checks all crates. + /// Specific crate name to check #[arg(value_name = "CRATE")] crate_name: String, }, @@ -120,53 +139,72 @@ fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Resul } fn list_crates(root: &PathBuf) -> Result> { - let d = std::fs::read_dir(root)?; let mut crates = BTreeMap::new(); + discover_crates(root, &mut crates)?; + Ok(crates) +} + +fn discover_crates(dir: &PathBuf, crates: &mut BTreeMap) -> Result<()> { + let d = std::fs::read_dir(dir)?; for c in d { let entry = c?; if entry.file_type()?.is_dir() { - let path = root.join(entry.path()); - let entry = path.join("Cargo.toml"); - if entry.exists() { - let content = fs::read_to_string(&entry)?; - let parsed: ParsedCrate = toml::from_str(&content)?; - let id = parsed.package.name; + let path = dir.join(entry.path()); + let cargo_toml = path.join("Cargo.toml"); - let metadata = &parsed.package.metadata.embassy; + if cargo_toml.exists() { + let content = fs::read_to_string(&cargo_toml)?; - if metadata.skip { - continue; - } + // Try to parse as a crate, skip if it's a workspace + let parsed: Result = toml::from_str(&content); + if let Ok(parsed) = parsed { + let id = parsed.package.name; - let mut dependencies = Vec::new(); - for (k, _) in parsed.dependencies { - if k.starts_with("embassy-") { - dependencies.push(k); + let metadata = &parsed.package.metadata.embassy; + + if metadata.skip { + continue; } - } - let mut configs = metadata.build.clone(); - if configs.is_empty() { - configs.push(BuildConfig { - features: vec![], - target: None, - }) - } + let mut dependencies = Vec::new(); + for (k, _) in parsed.dependencies { + if k.starts_with("embassy-") { + dependencies.push(k); + } + } + + let mut configs = metadata.build.clone(); + if configs.is_empty() { + configs.push(BuildConfig { + features: vec![], + target: None, + artifact_dir: None, + }) + } - crates.insert( - id.clone(), - Crate { - name: id, - version: parsed.package.version, - path, - dependencies, - configs, - }, - ); + crates.insert( + id.clone(), + Crate { + name: id, + version: parsed.package.version, + path, + dependencies, + configs, + publish: parsed.package.publish, + }, + ); + } + } else { + // Recursively search subdirectories, but only for examples, tests, and docs + let file_name = entry.file_name(); + let dir_name = file_name.to_string_lossy(); + if dir_name == "examples" || dir_name == "tests" || dir_name == "docs" { + discover_crates(&path, crates)?; + } } } } - Ok(crates) + Ok(()) } fn build_graph(crates: &BTreeMap) -> (Graph, HashMap) { @@ -214,12 +252,17 @@ fn load_context(args: &Args) -> Result { let crates = list_crates(&root)?; let (graph, indices) = build_graph(&crates); - Ok(Context { + let ctx = Context { root, crates, graph, indices, - }) + }; + + // Check for publish dependency conflicts + check_publish_dependencies(&ctx)?; + + Ok(ctx) } fn main() -> Result<()> { @@ -274,10 +317,21 @@ fn main() -> Result<()> { } Command::SemverCheck { crate_name } => { let c = ctx.crates.get(&crate_name).unwrap(); + if !c.publish { + bail!("Cannot run semver-check on non-publishable crate '{}'", crate_name); + } check_semver(&c)?; } Command::PrepareRelease { crate_name } => { let start = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); + + // Check if the target crate is publishable + let start_weight = ctx.graph.node_weight(*start).unwrap(); + let start_crate = ctx.crates.get(start_weight).unwrap(); + if !start_crate.publish { + bail!("Cannot prepare release for non-publishable crate '{}'", crate_name); + } + let mut rgraph = ctx.graph.clone(); rgraph.reverse(); diff --git a/release/src/types.rs b/release/src/types.rs index c5b774977..4d9d440d8 100644 --- a/release/src/types.rs +++ b/release/src/types.rs @@ -13,10 +13,16 @@ pub struct ParsedCrate { pub struct ParsedPackage { pub name: String, pub version: String, + #[serde(default = "default_publish")] + pub publish: bool, #[serde(default)] pub metadata: Metadata, } +fn default_publish() -> bool { + true +} + #[derive(Debug, Deserialize, Default)] pub struct Metadata { #[serde(default)] @@ -36,6 +42,8 @@ pub struct BuildConfig { #[serde(default)] pub features: Vec, pub target: Option, + #[serde(rename = "artifact-dir")] + pub artifact_dir: Option, } pub type CrateId = String; @@ -47,4 +55,5 @@ pub struct Crate { pub path: PathBuf, pub dependencies: Vec, pub configs: Vec, + pub publish: bool, } diff --git a/tests/mspm0/Cargo.toml b/tests/mspm0/Cargo.toml index e4033b8b7..5cf1b0ed1 100644 --- a/tests/mspm0/Cargo.toml +++ b/tests/mspm0/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-mspm0-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [features] mspm0g3507 = [ "embassy-mspm0/mspm0g3507pm" ] @@ -60,3 +61,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["mspm0g3507"], artifact-dir = "out/tests/mspm0g3507" } +] diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml index ef7dc96ec..b94b54f4e 100644 --- a/tests/nrf/Cargo.toml +++ b/tests/nrf/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-nrf-examples" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] teleprobe-meta = "1" @@ -112,3 +113,13 @@ path = "src/bin/wifi_esp_hosted_perf.rs" required-features = [ "nrf52840",] # END TESTS + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["nrf51422"], artifact-dir = "out/tests/nrf51422-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52832"], artifact-dir = "out/tests/nrf52832-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52833"], artifact-dir = "out/tests/nrf52833-dk" }, + { target = "thumbv7em-none-eabi", features = ["nrf52840"], artifact-dir = "out/tests/nrf52840-dk" }, + { target = "thumbv8m.main-none-eabihf", features = ["nrf5340"], artifact-dir = "out/tests/nrf5340-dk" }, + { target = "thumbv8m.main-none-eabihf", features = ["nrf9160"], artifact-dir = "out/tests/nrf9160-dk" } +] diff --git a/tests/perf-client/Cargo.toml b/tests/perf-client/Cargo.toml index e31d6361b..ea0663b6f 100644 --- a/tests/perf-client/Cargo.toml +++ b/tests/perf-client/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-client" version = "0.1.0" edition = "2021" +publish = false [dependencies] embassy-net = { version = "0.7.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4"] } diff --git a/tests/perf-server/Cargo.toml b/tests/perf-server/Cargo.toml index 532039050..22614a33a 100644 --- a/tests/perf-server/Cargo.toml +++ b/tests/perf-server/Cargo.toml @@ -2,6 +2,7 @@ name = "perf-server" version = "0.1.0" edition = "2021" +publish = false [dependencies] log = "0.4.17" diff --git a/tests/riscv32/Cargo.toml b/tests/riscv32/Cargo.toml index 283ea5033..781fec62f 100644 --- a/tests/riscv32/Cargo.toml +++ b/tests/riscv32/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-riscv-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] critical-section = { version = "1.1.1", features = ["restore-state-bool"] } @@ -44,3 +45,8 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "riscv32imac-unknown-none-elf" } +] diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index eef6c47ae..088195a75 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml @@ -3,6 +3,7 @@ edition = "2021" name = "embassy-rp-tests" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [features] rp2040 = ["embassy-rp/rp2040"] @@ -92,3 +93,9 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv6m-none-eabi", features = ["rp2040"], artifact-dir = "out/tests/rpi-pico" }, + { target = "thumbv8m.main-none-eabihf", features = ["rp235xb"], artifact-dir = "out/tests/pimoroni-pico-plus-2" } +] diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index c011a6d7d..37d5161f8 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml @@ -4,6 +4,7 @@ name = "embassy-stm32-tests" version = "0.1.0" license = "MIT OR Apache-2.0" autobins = false +publish = false [features] stm32c031c6 = ["embassy-stm32/stm32c031c6", "cm0", "not-gpdma"] @@ -243,3 +244,36 @@ debug = false debug-assertions = false opt-level = 0 overflow-checks = false + +[package.metadata.embassy] +build = [ + { target = "thumbv7m-none-eabi", features = ["stm32f103c8"], artifact-dir = "out/tests/stm32f103c8" }, + { target = "thumbv7em-none-eabi", features = ["stm32f429zi"], artifact-dir = "out/tests/stm32f429zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32f446re"], artifact-dir = "out/tests/stm32f446re" }, + { target = "thumbv7em-none-eabi", features = ["stm32g491re"], artifact-dir = "out/tests/stm32g491re" }, + { target = "thumbv6m-none-eabi", features = ["stm32g071rb"], artifact-dir = "out/tests/stm32g071rb" }, + { target = "thumbv6m-none-eabi", features = ["stm32c031c6"], artifact-dir = "out/tests/stm32c031c6" }, + { target = "thumbv6m-none-eabi", features = ["stm32c071rb"], artifact-dir = "out/tests/stm32c071rb" }, + { target = "thumbv7em-none-eabi", features = ["stm32h755zi"], artifact-dir = "out/tests/stm32h755zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32h753zi"], artifact-dir = "out/tests/stm32h753zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32h7a3zi"], artifact-dir = "out/tests/stm32h7a3zi" }, + { target = "thumbv7em-none-eabi", features = ["stm32wb55rg"], artifact-dir = "out/tests/stm32wb55rg" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32h563zi"], artifact-dir = "out/tests/stm32h563zi" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32u585ai"], artifact-dir = "out/tests/stm32u585ai" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32u5a5zj"], artifact-dir = "out/tests/stm32u5a5zj" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32wba52cg"], artifact-dir = "out/tests/stm32wba52cg" }, + { target = "thumbv6m-none-eabi", features = ["stm32l073rz"], artifact-dir = "out/tests/stm32l073rz" }, + { target = "thumbv7m-none-eabi", features = ["stm32l152re"], artifact-dir = "out/tests/stm32l152re" }, + { target = "thumbv7em-none-eabi", features = ["stm32l4a6zg"], artifact-dir = "out/tests/stm32l4a6zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32l4r5zi"], artifact-dir = "out/tests/stm32l4r5zi" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32l552ze"], artifact-dir = "out/tests/stm32l552ze" }, + { target = "thumbv7em-none-eabi", features = ["stm32f767zi"], artifact-dir = "out/tests/stm32f767zi" }, + { target = "thumbv7m-none-eabi", features = ["stm32f207zg"], artifact-dir = "out/tests/stm32f207zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32f303ze"], artifact-dir = "out/tests/stm32f303ze" }, + { target = "thumbv7em-none-eabi", features = ["stm32l496zg"], artifact-dir = "out/tests/stm32l496zg" }, + { target = "thumbv7em-none-eabi", features = ["stm32wl55jc"], artifact-dir = "out/tests/stm32wl55jc" }, + { target = "thumbv7em-none-eabi", features = ["stm32h7s3l8"], artifact-dir = "out/tests/stm32h7s3l8" }, + { target = "thumbv6m-none-eabi", features = ["stm32f091rc"], artifact-dir = "out/tests/stm32f091rc" }, + { target = "thumbv8m.main-none-eabihf", features = ["stm32h503rb"], artifact-dir = "out/tests/stm32h503rb" }, + { target = "thumbv6m-none-eabi", features = ["stm32u083rc"], artifact-dir = "out/tests/stm32u083rc" } +] diff --git a/tests/utils/Cargo.toml b/tests/utils/Cargo.toml index bda55ad32..f76feaa20 100644 --- a/tests/utils/Cargo.toml +++ b/tests/utils/Cargo.toml @@ -2,6 +2,7 @@ name = "test-utils" version = "0.1.0" edition = "2021" +publish = false [dependencies] rand = "0.9" diff --git a/tests/utils/src/bin/saturate_serial.rs b/tests/utils/src/bin/saturate_serial.rs index 18ca12fb7..85676b106 100644 --- a/tests/utils/src/bin/saturate_serial.rs +++ b/tests/utils/src/bin/saturate_serial.rs @@ -2,7 +2,7 @@ use std::path::Path; use std::time::Duration; use std::{env, io, process, thread}; -use rand::random; +use rand::{rng, Rng}; use serial::SerialPort; pub fn main() { @@ -34,14 +34,15 @@ fn saturate(port: &mut T, idles: bool) -> io::Result<()> { })?; let mut written = 0; + let mut rng = rng(); loop { - let len = random::() % 0x1000; + let len = rng.random_range(1..=0x1000); let buf: Vec = (written..written + len).map(|x| x as u8).collect(); port.write_all(&buf)?; if idles { - let micros = (random::() % 1000) as u64; + let micros = rng.random_range(1..=1000) as u64; println!("Sleeping {}us", micros); port.flush().unwrap(); thread::sleep(Duration::from_micros(micros)); -- cgit From 0d8f9614a1af5a45b695e6f63b0337fc3bccba76 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 19:06:51 +0200 Subject: Autodetect repo root. --- release/src/main.rs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index 5605ca332..f1949dd37 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -41,10 +41,6 @@ mod types; #[derive(Parser, Debug)] #[command(author, version, about)] struct Args { - /// Path to embassy repository - #[arg(short, long)] - repo: PathBuf, - /// Command to perform on each crate #[command(subcommand)] command: Command, @@ -247,8 +243,29 @@ struct Context { indices: HashMap, } -fn load_context(args: &Args) -> Result { - let root = args.repo.canonicalize()?; +fn find_repo_root() -> Result { + let mut path = std::env::current_dir()?.canonicalize()?; + + loop { + // Check if this directory contains a .git directory + if path.join(".git").exists() { + return Ok(path); + } + + // Move to parent directory + match path.parent() { + Some(parent) => path = parent.to_path_buf(), + None => break, + } + } + + Err(anyhow!( + "Could not find repository root. Make sure you're running this tool from within the embassy repository." + )) +} + +fn load_context() -> Result { + let root = find_repo_root()?; let crates = list_crates(&root)?; let (graph, indices) = build_graph(&crates); @@ -268,7 +285,7 @@ fn load_context(args: &Args) -> Result { fn main() -> Result<()> { SimpleLogger::new().init().unwrap(); let args = Args::parse(); - let mut ctx = load_context(&args)?; + let mut ctx = load_context()?; match args.command { Command::List => { -- cgit From 1f229f745c0ccee926ae5c4cf6732d41c4beb531 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 11:14:15 +0200 Subject: fix: use patched versions --- release/Cargo.toml | 4 ++-- release/src/cargo.rs | 37 ++----------------------------------- release/src/main.rs | 1 - release/src/semver_check.rs | 11 ++++++----- release/src/types.rs | 3 ++- 5 files changed, 12 insertions(+), 44 deletions(-) diff --git a/release/Cargo.toml b/release/Cargo.toml index 3e4094eed..452e39ca6 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -19,8 +19,8 @@ simple_logger = "5.0.0" temp-file = "0.1.9" flate2 = "1.1.1" -#[patch.crates-io] -#cargo-semver-checks = { path = "../../cargo-semver-checks" } +[patch.crates-io] +cargo-semver-checks = { git = "https://github.com/lulf/cargo-semver-checks.git", rev="385f274edcbb6bf5156e30a94315852b27a527e6" } [package.metadata.embassy] skip = true diff --git a/release/src/cargo.rs b/release/src/cargo.rs index 826a3a8b2..498dfeb97 100644 --- a/release/src/cargo.rs +++ b/release/src/cargo.rs @@ -4,30 +4,16 @@ use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; -use anyhow::{bail, Context as _, Result}; -use clap::ValueEnum as _; +use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; -use toml_edit::{DocumentMut, Formatted, Item, Value}; -use crate::{windows_safe_path, Crate}; - -#[derive(Clone, Debug, PartialEq)] -pub enum CargoAction { - Build(PathBuf), - Run, -} +use crate::windows_safe_path; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Artifact { pub executable: PathBuf, } -/// Execute cargo with the given arguments and from the specified directory. -pub fn run(args: &[String], cwd: &Path) -> Result<()> { - run_with_env::<[(&str, &str); 0], _, _>(args, cwd, [], false)?; - Ok(()) -} - /// Execute cargo with the given arguments and from the specified directory. pub fn run_with_env(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result where @@ -166,25 +152,6 @@ impl CargoArgsBuilder { self } - #[must_use] - pub fn args(mut self, args: &[S]) -> Self - where - S: Clone + Into, - { - for arg in args { - self.args.push(arg.clone().into()); - } - self - } - - pub fn add_arg(&mut self, arg: S) -> &mut Self - where - S: Into, - { - self.args.push(arg.into()); - self - } - #[must_use] pub fn build(&self) -> Vec { let mut args = vec![]; diff --git a/release/src/main.rs b/release/src/main.rs index f1949dd37..cd3e094f1 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -5,7 +5,6 @@ use std::process::Command as ProcessCommand; use anyhow::{anyhow, bail, Result}; use clap::{Parser, Subcommand}; -use log::info; use petgraph::graph::{Graph, NodeIndex}; use petgraph::visit::Bfs; use petgraph::{Directed, Direction}; diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index a70c56376..9a4edd09a 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc}; +use cargo_semver_checks::{Check, GlobalConfig, LintConfig, LintLevel, ReleaseType, RequiredSemverUpdate, Rustdoc}; use crate::cargo::CargoArgsBuilder; use crate::types::{BuildConfig, Crate}; @@ -8,12 +8,9 @@ use crate::types::{BuildConfig, Crate}; /// Return the minimum required bump for the next release. /// Even if nothing changed this will be [ReleaseType::Patch] pub fn minimum_update(krate: &Crate) -> Result { - println!("Crate = {:?}", krate); - let config = krate.configs.first().unwrap(); // TODO let package_name = krate.name.clone(); - let package_path = krate.path.clone(); let current_path = build_doc_json(krate, config)?; let baseline = Rustdoc::from_registry_latest_crate_version(); @@ -30,8 +27,12 @@ pub fn minimum_update(krate: &Crate) -> Result { } let mut cfg = GlobalConfig::new(); cfg.set_log_level(Some(log::Level::Trace)); + + let mut lint_cfg = LintConfig::new(); + // Disable this lint because we provide the rustdoc json only, so it can't do feature comparison. + lint_cfg.set("feature_missing", LintLevel::Allow, RequiredSemverUpdate::Minor, 0); + cfg.set_lint_config(lint_cfg); let result = semver_check.check_release(&mut cfg)?; - log::info!("Result {:?}", result); let mut min_required_update = ReleaseType::Patch; for (_, report) in result.crate_reports() { diff --git a/release/src/types.rs b/release/src/types.rs index 4d9d440d8..be0a883f1 100644 --- a/release/src/types.rs +++ b/release/src/types.rs @@ -1,4 +1,4 @@ -use std::collections::{BTreeMap, HashMap}; +use std::collections::BTreeMap; use std::path::PathBuf; use serde::Deserialize; @@ -29,6 +29,7 @@ pub struct Metadata { pub embassy: MetadataEmbassy, } +#[allow(dead_code)] #[derive(Debug, Deserialize, Default)] pub struct MetadataEmbassy { #[serde(default)] -- cgit From cd7a7f97c0a5e928bac7299019d4320f4efc9ba6 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 11:16:38 +0200 Subject: fix: add back missing --- release/src/cargo.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release/src/cargo.rs b/release/src/cargo.rs index 498dfeb97..c1ed4118f 100644 --- a/release/src/cargo.rs +++ b/release/src/cargo.rs @@ -14,6 +14,12 @@ pub struct Artifact { pub executable: PathBuf, } +/// Execute cargo with the given arguments and from the specified directory. +pub fn run(args: &[String], cwd: &Path) -> Result<()> { + run_with_env::<[(&str, &str); 0], _, _>(args, cwd, [], false)?; + Ok(()) +} + /// Execute cargo with the given arguments and from the specified directory. pub fn run_with_env(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result where -- cgit From 1f9452e0763613ab9fa3c42425f0835e9f7c8201 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 12:24:14 +0200 Subject: fix: add workaround for current compiler version --- release/Cargo.toml | 1 + release/src/semver_check.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/release/Cargo.toml b/release/Cargo.toml index 452e39ca6..7875d088a 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -21,6 +21,7 @@ flate2 = "1.1.1" [patch.crates-io] cargo-semver-checks = { git = "https://github.com/lulf/cargo-semver-checks.git", rev="385f274edcbb6bf5156e30a94315852b27a527e6" } +#cargo-semver-checks = { path = "../../cargo-semver-checks" } [package.metadata.embassy] skip = true diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index 9a4edd09a..a4a9e77b5 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -13,6 +13,9 @@ pub fn minimum_update(krate: &Crate) -> Result { let package_name = krate.name.clone(); let current_path = build_doc_json(krate, config)?; + // TODO: Prevent compiler panic on current compiler version + std::env::set_var("RUSTFLAGS", "--cap-lints=warn"); + let baseline = Rustdoc::from_registry_latest_crate_version(); let doc = Rustdoc::from_path(¤t_path); let mut semver_check = Check::new(doc); -- cgit From ce42dd5da5b4495195778e57eeac324c3ca8c54f Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 13:13:07 +0200 Subject: update version only for un-publishable crates --- release/src/main.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index cd3e094f1..4d4cd37ed 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -368,19 +368,23 @@ fn main() -> Result<()> { println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); let newver = newver.to_string(); - update_version(&mut c, &newver)?; - let c = ctx.crates.get(weight).unwrap(); + if c.publish { + update_version(&mut c, &newver)?; + let c = ctx.crates.get(weight).unwrap(); - // Update all nodes further down the tree - let mut bfs = Bfs::new(&rgraph, node); - while let Some(dep_node) = bfs.next(&rgraph) { - let dep_weight = rgraph.node_weight(dep_node).unwrap(); - let dep = ctx.crates.get(dep_weight).unwrap(); - update_versions(dep, &c.name, &newver)?; - } + // Update all nodes further down the tree + let mut bfs = Bfs::new(&rgraph, node); + while let Some(dep_node) = bfs.next(&rgraph) { + let dep_weight = rgraph.node_weight(dep_node).unwrap(); + let dep = ctx.crates.get(dep_weight).unwrap(); + update_versions(dep, &c.name, &newver)?; + } - // Update changelog - update_changelog(&ctx.root, &c)?; + // Update changelog + update_changelog(&ctx.root, &c)?; + } else { + update_version(&mut c, &newver)?; + } } let weight = rgraph.node_weight(*start).unwrap(); -- cgit From 7357810814225e961eced5d0f2b0fe54f46e3970 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 13:17:54 +0200 Subject: only semvercheck for publishable --- release/src/main.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index 4d4cd37ed..9c650b697 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -357,18 +357,18 @@ fn main() -> Result<()> { let weight = rgraph.node_weight(node).unwrap(); println!("Preparing {}", weight); let mut c = ctx.crates.get_mut(weight).unwrap(); - let ver = semver::Version::parse(&c.version)?; - let newver = if let Err(_) = check_semver(&c) { - println!("Semver check failed, bumping minor!"); - semver::Version::new(ver.major, ver.minor + 1, 0) - } else { - semver::Version::new(ver.major, ver.minor, ver.patch + 1) - }; + if c.publish { + let ver = semver::Version::parse(&c.version)?; + let newver = if let Err(_) = check_semver(&c) { + println!("Semver check failed, bumping minor!"); + semver::Version::new(ver.major, ver.minor + 1, 0) + } else { + semver::Version::new(ver.major, ver.minor, ver.patch + 1) + }; - println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); - let newver = newver.to_string(); + println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); + let newver = newver.to_string(); - if c.publish { update_version(&mut c, &newver)?; let c = ctx.crates.get(weight).unwrap(); @@ -382,8 +382,6 @@ fn main() -> Result<()> { // Update changelog update_changelog(&ctx.root, &c)?; - } else { - update_version(&mut c, &newver)?; } } -- cgit From 85c66be61826b03b509f9223d9f4d0b99798fa88 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 13:20:03 +0200 Subject: fix: add more missing changelogs --- embassy-imxrt/CHANGELOG.md | 11 +++++++++++ embassy-mspm0/CHANGELOG.md | 1 + embassy-nxp/CHANGELOG.md | 11 +++++++++++ 3 files changed, 23 insertions(+) create mode 100644 embassy-imxrt/CHANGELOG.md create mode 100644 embassy-nxp/CHANGELOG.md diff --git a/embassy-imxrt/CHANGELOG.md b/embassy-imxrt/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-imxrt/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. diff --git a/embassy-mspm0/CHANGELOG.md b/embassy-mspm0/CHANGELOG.md index cf8aeb046..145f678cd 100644 --- a/embassy-mspm0/CHANGELOG.md +++ b/embassy-mspm0/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + ## Unreleased - ReleaseDate - feat: Add I2C Controller (blocking & async) + examples for mspm0l1306, mspm0g3507 (tested MCUs) (#4435) diff --git a/embassy-nxp/CHANGELOG.md b/embassy-nxp/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-nxp/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. -- cgit From a716489ef28e25c351c2eab08b6ab76439531082 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 13:23:08 +0200 Subject: add missing --- embassy-stm32-wpan/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 embassy-stm32-wpan/CHANGELOG.md diff --git a/embassy-stm32-wpan/CHANGELOG.md b/embassy-stm32-wpan/CHANGELOG.md new file mode 100644 index 000000000..7042ad14c --- /dev/null +++ b/embassy-stm32-wpan/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +- First release with changelog. -- cgit From fb2741fb8493b27af3becaaaca1589bdde92ff76 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 13:26:49 +0200 Subject: add missing --- embassy-net-enc28j60/CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 embassy-net-enc28j60/CHANGELOG.md diff --git a/embassy-net-enc28j60/CHANGELOG.md b/embassy-net-enc28j60/CHANGELOG.md new file mode 100644 index 000000000..84f144f99 --- /dev/null +++ b/embassy-net-enc28j60/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## Unreleased - ReleaseDate + +## 0.1.1 - 2025-08-16 + +- First release with changelog. -- cgit From 90baa19b591b5d09f7fefe6273f1d1337e7c41df Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 17:50:50 +0200 Subject: fix: version bump --- release/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index 9c650b697..488dc9b6a 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -4,6 +4,7 @@ use std::path::{Path, PathBuf}; use std::process::Command as ProcessCommand; use anyhow::{anyhow, bail, Result}; +use cargo_semver_checks::ReleaseType; use clap::{Parser, Subcommand}; use petgraph::graph::{Graph, NodeIndex}; use petgraph::visit::Bfs; @@ -359,11 +360,10 @@ fn main() -> Result<()> { let mut c = ctx.crates.get_mut(weight).unwrap(); if c.publish { let ver = semver::Version::parse(&c.version)?; - let newver = if let Err(_) = check_semver(&c) { - println!("Semver check failed, bumping minor!"); - semver::Version::new(ver.major, ver.minor + 1, 0) - } else { - semver::Version::new(ver.major, ver.minor, ver.patch + 1) + let newver = match check_semver(&c)? { + ReleaseType::Major | ReleaseType::Minor => semver::Version::new(ver.major, ver.minor + 1, 0), + ReleaseType::Patch => semver::Version::new(ver.major, ver.minor, ver.patch + 1), + _ => unreachable!(), }; println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); @@ -439,10 +439,10 @@ fn main() -> Result<()> { Ok(()) } -fn check_semver(c: &Crate) -> Result<()> { +fn check_semver(c: &Crate) -> Result { let min_version = semver_check::minimum_update(c)?; println!("Version should be bumped to {:?}", min_version); - Ok(()) + Ok(min_version) } fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { -- cgit From bda6368b9be2f24631315c27b71213dbef333341 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 17:56:17 +0200 Subject: fix: skip publish for now --- embassy-mspm0/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/embassy-mspm0/Cargo.toml b/embassy-mspm0/Cargo.toml index d13f16eff..08e0fa9b3 100644 --- a/embassy-mspm0/Cargo.toml +++ b/embassy-mspm0/Cargo.toml @@ -9,6 +9,9 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-mspm0" +# TODO: Remove to publish initial version +publish = false + [package.metadata.embassy] build = [ {target = "thumbv6m-none-eabi", features = ["defmt", "mspm0c1104dgs20", "time-driver-any"]}, -- cgit From a672861f6953119d41ae26597851371514d6cc0b Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 17:57:19 +0200 Subject: fix: skip publish on a few more --- embassy-nxp/Cargo.toml | 2 ++ embassy-stm32-wpan/Cargo.toml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/embassy-nxp/Cargo.toml b/embassy-nxp/Cargo.toml index 68f5c98b2..70e6da076 100644 --- a/embassy-nxp/Cargo.toml +++ b/embassy-nxp/Cargo.toml @@ -3,6 +3,8 @@ name = "embassy-nxp" version = "0.1.0" edition = "2021" +publish = false + [package.metadata.embassy] build = [ {target = "thumbv8m.main-none-eabihf", features = ["defmt", "lpc55"]}, diff --git a/embassy-stm32-wpan/Cargo.toml b/embassy-stm32-wpan/Cargo.toml index f7b20cedc..2bdb0d6c4 100644 --- a/embassy-stm32-wpan/Cargo.toml +++ b/embassy-stm32-wpan/Cargo.toml @@ -9,6 +9,8 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-stm32-wpan" +publish = false + [package.metadata.embassy] build = [ {target = "thumbv7em-none-eabi", features = ["stm32wb55rg"]}, -- cgit From 650319f0af0e0edf31155fcc27ada662e5898f46 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 16 Aug 2025 18:04:56 +0200 Subject: fix: skip another publish --- embassy-imxrt/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-imxrt/Cargo.toml b/embassy-imxrt/Cargo.toml index 5e94dbbc4..006096e99 100644 --- a/embassy-imxrt/Cargo.toml +++ b/embassy-imxrt/Cargo.toml @@ -9,6 +9,7 @@ categories = ["embedded", "hardware-support", "no-std", "asynchronous"] repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-imxrt" +publish = false [package.metadata.embassy] build = [ {target = "thumbv8m.main-none-eabihf", features = ["defmt", "mimxrt633s", "time", "time-driver-rtc", "unstable-pac"]}, -- cgit From 1c2f87b4fef0377afb47a09b0c51a08cb73d349e Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 18 Aug 2025 14:21:02 +0200 Subject: fix: build rustdoc for baseline as well --- release/Cargo.toml | 8 ++-- release/src/semver_check.rs | 93 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 15 deletions(-) diff --git a/release/Cargo.toml b/release/Cargo.toml index 7875d088a..9701a76e5 100644 --- a/release/Cargo.toml +++ b/release/Cargo.toml @@ -18,10 +18,10 @@ log = "0.4" simple_logger = "5.0.0" temp-file = "0.1.9" flate2 = "1.1.1" - -[patch.crates-io] -cargo-semver-checks = { git = "https://github.com/lulf/cargo-semver-checks.git", rev="385f274edcbb6bf5156e30a94315852b27a527e6" } -#cargo-semver-checks = { path = "../../cargo-semver-checks" } +crates-index = "3.11.0" +tar = "0.4" +reqwest = { version = "0.12", features = ["blocking"] } +cargo-manifest = "0.19.1" [package.metadata.embassy] skip = true diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index a4a9e77b5..4cfa26ec0 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -1,6 +1,11 @@ +use std::collections::HashSet; use std::path::PathBuf; +use std::{env, fs}; -use cargo_semver_checks::{Check, GlobalConfig, LintConfig, LintLevel, ReleaseType, RequiredSemverUpdate, Rustdoc}; +use anyhow::anyhow; +use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, RequiredSemverUpdate, Rustdoc}; +use flate2::read::GzDecoder; +use tar::Archive; use crate::cargo::CargoArgsBuilder; use crate::types::{BuildConfig, Crate}; @@ -11,12 +16,18 @@ pub fn minimum_update(krate: &Crate) -> Result { let config = krate.configs.first().unwrap(); // TODO let package_name = krate.name.clone(); - let current_path = build_doc_json(krate, config)?; + let baseline_path = download_baseline(&package_name, &krate.version)?; + let mut baseline_krate = krate.clone(); + baseline_krate.path = baseline_path; - // TODO: Prevent compiler panic on current compiler version - std::env::set_var("RUSTFLAGS", "--cap-lints=warn"); + // Compare features as it's not covered by semver-checks + if compare_features(&baseline_krate, &krate)? { + return Ok(ReleaseType::Minor); + } + let baseline_path = build_doc_json(&baseline_krate, config)?; + let current_path = build_doc_json(krate, config)?; - let baseline = Rustdoc::from_registry_latest_crate_version(); + let baseline = Rustdoc::from_path(&baseline_path); let doc = Rustdoc::from_path(¤t_path); let mut semver_check = Check::new(doc); semver_check.with_default_features(); @@ -29,12 +40,8 @@ pub fn minimum_update(krate: &Crate) -> Result { semver_check.set_build_target(target.clone()); } let mut cfg = GlobalConfig::new(); - cfg.set_log_level(Some(log::Level::Trace)); + cfg.set_log_level(Some(log::Level::Info)); - let mut lint_cfg = LintConfig::new(); - // Disable this lint because we provide the rustdoc json only, so it can't do feature comparison. - lint_cfg.set("feature_missing", LintLevel::Allow, RequiredSemverUpdate::Minor, 0); - cfg.set_lint_config(lint_cfg); let result = semver_check.check_release(&mut cfg)?; let mut min_required_update = ReleaseType::Patch; @@ -51,7 +58,71 @@ pub fn minimum_update(krate: &Crate) -> Result { Ok(min_required_update) } -pub(crate) fn build_doc_json(krate: &Crate, config: &BuildConfig) -> Result { +fn compare_features(old: &Crate, new: &Crate) -> Result { + let mut old = read_features(&old.path)?; + let new = read_features(&new.path)?; + + old.retain(|r| !new.contains(r)); + log::info!("Features removed in new: {:?}", old); + Ok(!old.is_empty()) +} + +fn download_baseline(name: &str, version: &str) -> Result { + let config = crates_index::IndexConfig { + dl: "https://crates.io/api/v1/crates".to_string(), + api: Some("https://crates.io".to_string()), + }; + + let url = + config + .download_url(name, version) + .ok_or(anyhow!("unable to download baseline for {}-{}", name, version))?; + + let parent_dir = env::var("RELEASER_CACHE").map_err(|_| anyhow!("RELEASER_CACHE not set"))?; + + let extract_path = PathBuf::from(&parent_dir).join(format!("{}-{}", name, version)); + + if extract_path.exists() { + return Ok(extract_path); + } + + let response = reqwest::blocking::get(url)?; + let bytes = response.bytes()?; + + let decoder = GzDecoder::new(&bytes[..]); + let mut archive = Archive::new(decoder); + archive.unpack(&parent_dir)?; + + Ok(extract_path) +} + +fn read_features(crate_path: &PathBuf) -> Result, anyhow::Error> { + let cargo_toml_path = crate_path.join("Cargo.toml"); + + if !cargo_toml_path.exists() { + return Err(anyhow!("Cargo.toml not found at {:?}", cargo_toml_path)); + } + + let manifest = cargo_manifest::Manifest::from_path(&cargo_toml_path)?; + + let mut set = HashSet::new(); + if let Some(features) = manifest.features { + for f in features.keys() { + set.insert(f.clone()); + } + } + if let Some(deps) = manifest.dependencies { + for (k, v) in deps.iter() { + if v.optional() { + set.insert(k.clone()); + } + } + } + + Ok(set) +} + +fn build_doc_json(krate: &Crate, config: &BuildConfig) -> Result { let target_dir = std::env::var("CARGO_TARGET_DIR"); let target_path = if let Ok(target) = target_dir { -- cgit From 5cab79d817759e50a051d05e245067dd07c81362 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 18 Aug 2025 14:42:27 +0200 Subject: fix: remove unpublished --- embassy-net-nrf91/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-net-nrf91/Cargo.toml b/embassy-net-nrf91/Cargo.toml index 76b812efc..feb6eb7a2 100644 --- a/embassy-net-nrf91/Cargo.toml +++ b/embassy-net-nrf91/Cargo.toml @@ -8,6 +8,7 @@ categories = ["embedded", "hardware-support", "no-std", "network-programming", " license = "MIT OR Apache-2.0" repository = "https://github.com/embassy-rs/embassy" documentation = "https://docs.embassy.dev/embassy-net-nrf91" +publish = false [features] defmt = ["dep:defmt", "heapless/defmt-03"] -- cgit From b00496fd299ca1dbc122476f0477b4032d5727c7 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 18 Aug 2025 15:00:22 +0200 Subject: fix: write instructions only for publishing crates --- release/src/main.rs | 14 ++++++++++---- release/src/semver_check.rs | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/release/src/main.rs b/release/src/main.rs index 488dc9b6a..22c926b86 100644 --- a/release/src/main.rs +++ b/release/src/main.rs @@ -396,7 +396,9 @@ fn main() -> Result<()> { while let Some(node) = bfs.next(&rgraph) { let weight = rgraph.node_weight(node).unwrap(); let c = ctx.crates.get(weight).unwrap(); - println!("git tag {}-v{}", weight, c.version); + if c.publish { + println!("git tag {}-v{}", weight, c.version); + } } println!(""); @@ -414,8 +416,10 @@ fn main() -> Result<()> { ]; let config = c.configs.first().unwrap(); // TODO - args.push("--features".into()); - args.push(config.features.join(",")); + if !config.features.is_empty() { + args.push("--features".into()); + args.push(config.features.join(",")); + } if let Some(target) = &config.target { args.push("--target".into()); @@ -428,7 +432,9 @@ fn main() -> Result<()> { println!("cargo {}", dry_run.join(" ")); */ - println!("cargo {}", args.join(" ")); + if c.publish { + println!("cargo {}", args.join(" ")); + } } println!(""); diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs index 4cfa26ec0..6255260f3 100644 --- a/release/src/semver_check.rs +++ b/release/src/semver_check.rs @@ -1,9 +1,9 @@ use std::collections::HashSet; +use std::env; use std::path::PathBuf; -use std::{env, fs}; use anyhow::anyhow; -use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, RequiredSemverUpdate, Rustdoc}; +use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc}; use flate2::read::GzDecoder; use tar::Archive; -- cgit From d835b5385734d6211e247b13b7f4b3c53c6b6fff Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 19 Aug 2025 13:58:25 +0200 Subject: chore: move tool to separate repo --- release/Cargo.toml | 27 --- release/src/build.rs | 50 ----- release/src/cargo.rs | 220 ------------------- release/src/main.rs | 514 -------------------------------------------- release/src/semver_check.rs | 178 --------------- release/src/types.rs | 60 ------ 6 files changed, 1049 deletions(-) delete mode 100644 release/Cargo.toml delete mode 100644 release/src/build.rs delete mode 100644 release/src/cargo.rs delete mode 100644 release/src/main.rs delete mode 100644 release/src/semver_check.rs delete mode 100644 release/src/types.rs diff --git a/release/Cargo.toml b/release/Cargo.toml deleted file mode 100644 index 9701a76e5..000000000 --- a/release/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "embassy-release" -version = "0.1.0" -edition = "2021" - -[dependencies] -clap = { version = "4.5.1", features = ["derive"] } -walkdir = "2.5.0" -toml = "0.9.5" -toml_edit = { version = "0.23.1", features = ["serde"] } -serde = { version = "1.0.198", features = ["derive"] } -regex = "1.10.4" -anyhow = "1" -petgraph = "0.8.2" -semver = "1.0.26" -cargo-semver-checks = "0.43.0" -log = "0.4" -simple_logger = "5.0.0" -temp-file = "0.1.9" -flate2 = "1.1.1" -crates-index = "3.11.0" -tar = "0.4" -reqwest = { version = "0.12", features = ["blocking"] } -cargo-manifest = "0.19.1" - -[package.metadata.embassy] -skip = true diff --git a/release/src/build.rs b/release/src/build.rs deleted file mode 100644 index 7c777d36c..000000000 --- a/release/src/build.rs +++ /dev/null @@ -1,50 +0,0 @@ -use anyhow::Result; - -use crate::cargo::{CargoArgsBuilder, CargoBatchBuilder}; - -pub(crate) fn build(ctx: &crate::Context, crate_name: Option<&str>) -> Result<()> { - let mut batch_builder = CargoBatchBuilder::new(); - - // Process either specific crate or all crates - let crates_to_build: Vec<_> = if let Some(name) = crate_name { - // Build only the specified crate - if let Some(krate) = ctx.crates.get(name) { - vec![krate] - } else { - return Err(anyhow::anyhow!("Crate '{}' not found", name)); - } - } else { - // Build all crates - ctx.crates.values().collect() - }; - - // Process selected crates and add their build configurations to the batch - for krate in crates_to_build { - for config in &krate.configs { - let mut args_builder = CargoArgsBuilder::new() - .subcommand("build") - .arg("--release") - .arg(format!("--manifest-path={}/Cargo.toml", krate.path.to_string_lossy())); - - if let Some(ref target) = config.target { - args_builder = args_builder.target(target); - } - - if !config.features.is_empty() { - args_builder = args_builder.features(&config.features); - } - - if let Some(ref artifact_dir) = config.artifact_dir { - args_builder = args_builder.artifact_dir(artifact_dir); - } - - batch_builder.add_command(args_builder.build()); - } - } - - // Execute the cargo batch command - let batch_args = batch_builder.build(); - crate::cargo::run(&batch_args, &ctx.root)?; - - Ok(()) -} diff --git a/release/src/cargo.rs b/release/src/cargo.rs deleted file mode 100644 index c1ed4118f..000000000 --- a/release/src/cargo.rs +++ /dev/null @@ -1,220 +0,0 @@ -//! Tools for working with Cargo. - -use std::ffi::OsStr; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -use anyhow::{bail, Result}; -use serde::{Deserialize, Serialize}; - -use crate::windows_safe_path; - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Artifact { - pub executable: PathBuf, -} - -/// Execute cargo with the given arguments and from the specified directory. -pub fn run(args: &[String], cwd: &Path) -> Result<()> { - run_with_env::<[(&str, &str); 0], _, _>(args, cwd, [], false)?; - Ok(()) -} - -/// Execute cargo with the given arguments and from the specified directory. -pub fn run_with_env(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result -where - I: IntoIterator + core::fmt::Debug, - K: AsRef, - V: AsRef, -{ - if !cwd.is_dir() { - bail!("The `cwd` argument MUST be a directory"); - } - - // Make sure to not use a UNC as CWD! - // That would make `OUT_DIR` a UNC which will trigger things like the one fixed in https://github.com/dtolnay/rustversion/pull/51 - // While it's fixed in `rustversion` it's not fixed for other crates we are - // using now or in future! - let cwd = windows_safe_path(cwd); - - println!( - "Running `cargo {}` in {:?} - Environment {:?}", - args.join(" "), - cwd, - envs - ); - - let mut command = Command::new(get_cargo()); - - command - .args(args) - .current_dir(cwd) - .envs(envs) - .stdout(if capture { Stdio::piped() } else { Stdio::inherit() }) - .stderr(if capture { Stdio::piped() } else { Stdio::inherit() }); - - if args.iter().any(|a| a.starts_with('+')) { - // Make sure the right cargo runs - command.env_remove("CARGO"); - } - - let output = command.stdin(Stdio::inherit()).output()?; - - // Make sure that we return an appropriate exit code here, as Github Actions - // requires this in order to function correctly: - if output.status.success() { - Ok(String::from_utf8_lossy(&output.stdout).to_string()) - } else { - bail!("Failed to execute cargo subcommand `cargo {}`", args.join(" "),) - } -} - -fn get_cargo() -> String { - // On Windows when executed via `cargo run` (e.g. via the xtask alias) the - // `cargo` on the search path is NOT the cargo-wrapper but the `cargo` from the - // toolchain - that one doesn't understand `+toolchain` - #[cfg(target_os = "windows")] - let cargo = if let Ok(cargo) = std::env::var("CARGO_HOME") { - format!("{cargo}/bin/cargo") - } else { - String::from("cargo") - }; - - #[cfg(not(target_os = "windows"))] - let cargo = String::from("cargo"); - - cargo -} - -#[derive(Debug, Default)] -pub struct CargoArgsBuilder { - toolchain: Option, - subcommand: String, - target: Option, - features: Vec, - args: Vec, -} - -impl CargoArgsBuilder { - #[must_use] - pub fn new() -> Self { - Self { - toolchain: None, - subcommand: String::new(), - target: None, - features: vec![], - args: vec![], - } - } - - #[must_use] - pub fn toolchain(mut self, toolchain: S) -> Self - where - S: Into, - { - self.toolchain = Some(toolchain.into()); - self - } - - #[must_use] - pub fn subcommand(mut self, subcommand: S) -> Self - where - S: Into, - { - self.subcommand = subcommand.into(); - self - } - - #[must_use] - pub fn target(mut self, target: S) -> Self - where - S: Into, - { - self.target = Some(target.into()); - self - } - - #[must_use] - pub fn features(mut self, features: &[String]) -> Self { - self.features = features.to_vec(); - self - } - - #[must_use] - pub fn artifact_dir(mut self, artifact_dir: S) -> Self - where - S: Into, - { - self.args.push(format!("--artifact-dir={}", artifact_dir.into())); - self - } - - #[must_use] - pub fn arg(mut self, arg: S) -> Self - where - S: Into, - { - self.args.push(arg.into()); - self - } - - #[must_use] - pub fn build(&self) -> Vec { - let mut args = vec![]; - - if let Some(ref toolchain) = self.toolchain { - args.push(format!("+{toolchain}")); - } - - args.push(self.subcommand.clone()); - - if let Some(ref target) = self.target { - args.push(format!("--target={target}")); - } - - if !self.features.is_empty() { - args.push(format!("--features={}", self.features.join(","))); - } - - for arg in self.args.iter() { - args.push(arg.clone()); - } - - args - } -} - -#[derive(Debug, Default)] -pub struct CargoBatchBuilder { - commands: Vec>, -} - -impl CargoBatchBuilder { - #[must_use] - pub fn new() -> Self { - Self { commands: vec![] } - } - - #[must_use] - pub fn command(mut self, args: Vec) -> Self { - self.commands.push(args); - self - } - - pub fn add_command(&mut self, args: Vec) -> &mut Self { - self.commands.push(args); - self - } - - #[must_use] - pub fn build(&self) -> Vec { - let mut args = vec!["batch".to_string()]; - - for command in &self.commands { - args.push("---".to_string()); - args.extend(command.clone()); - } - - args - } -} diff --git a/release/src/main.rs b/release/src/main.rs deleted file mode 100644 index 22c926b86..000000000 --- a/release/src/main.rs +++ /dev/null @@ -1,514 +0,0 @@ -use std::collections::{BTreeMap, HashMap}; -use std::fs; -use std::path::{Path, PathBuf}; -use std::process::Command as ProcessCommand; - -use anyhow::{anyhow, bail, Result}; -use cargo_semver_checks::ReleaseType; -use clap::{Parser, Subcommand}; -use petgraph::graph::{Graph, NodeIndex}; -use petgraph::visit::Bfs; -use petgraph::{Directed, Direction}; -use simple_logger::SimpleLogger; -use toml_edit::{DocumentMut, Item, Value}; -use types::*; - -fn check_publish_dependencies(ctx: &Context) -> Result<()> { - for krate in ctx.crates.values() { - if krate.publish { - for dep_name in &krate.dependencies { - if let Some(dep_crate) = ctx.crates.get(dep_name) { - if !dep_crate.publish { - return Err(anyhow!( - "Publishable crate '{}' depends on non-publishable crate '{}'. This is not allowed.", - krate.name, - dep_name - )); - } - } - } - } - } - Ok(()) -} - -mod build; -mod cargo; -mod semver_check; -mod types; - -/// Tool to traverse and operate on intra-repo Rust crate dependencies -#[derive(Parser, Debug)] -#[command(author, version, about)] -struct Args { - /// Command to perform on each crate - #[command(subcommand)] - command: Command, -} - -#[derive(Debug, Subcommand)] -enum Command { - /// All crates and their direct dependencies - List, - /// List all dependencies for a crate - Dependencies { - /// Crate name to print dependencies for. - #[arg(value_name = "CRATE")] - crate_name: String, - }, - /// List all dependencies for a crate - Dependents { - /// Crate name to print dependencies for. - #[arg(value_name = "CRATE")] - crate_name: String, - }, - - /// Build - Build { - /// Crate to check. If not specified checks all crates. - #[arg(value_name = "CRATE")] - crate_name: Option, - }, - /// SemverCheck - SemverCheck { - /// Specific crate name to check - #[arg(value_name = "CRATE")] - crate_name: String, - }, - /// Prepare to release a crate and all dependents that needs updating - /// - Semver checks - /// - Bump versions and commit - /// - Create tag. - PrepareRelease { - /// Crate to release. Will traverse that crate an it's dependents. If not specified checks all crates. - #[arg(value_name = "CRATE")] - crate_name: String, - }, -} - -fn update_version(c: &mut Crate, new_version: &str) -> Result<()> { - let path = c.path.join("Cargo.toml"); - c.version = new_version.to_string(); - let content = fs::read_to_string(&path)?; - let mut doc: DocumentMut = content.parse()?; - for section in ["package"] { - if let Some(Item::Table(dep_table)) = doc.get_mut(section) { - dep_table.insert("version", Item::Value(Value::from(new_version))); - } - } - fs::write(&path, doc.to_string())?; - Ok(()) -} - -fn update_versions(to_update: &Crate, dep: &CrateId, new_version: &str) -> Result<()> { - let path = to_update.path.join("Cargo.toml"); - let content = fs::read_to_string(&path)?; - let mut doc: DocumentMut = content.parse()?; - let mut changed = false; - for section in ["dependencies", "dev-dependencies", "build-dependencies"] { - if let Some(Item::Table(dep_table)) = doc.get_mut(section) { - if let Some(item) = dep_table.get_mut(&dep) { - match item { - // e.g., foo = "0.1.0" - Item::Value(Value::String(_)) => { - *item = Item::Value(Value::from(new_version)); - changed = true; - } - // e.g., foo = { version = "...", ... } - Item::Value(Value::InlineTable(inline)) => { - if inline.contains_key("version") { - inline["version"] = Value::from(new_version); - changed = true; - } - } - _ => {} // Leave unusual formats untouched - } - } - } - } - - if changed { - fs::write(&path, doc.to_string())?; - println!("🔧 Updated {} to {} in {}", dep, new_version, path.display()); - } - Ok(()) -} - -fn list_crates(root: &PathBuf) -> Result> { - let mut crates = BTreeMap::new(); - discover_crates(root, &mut crates)?; - Ok(crates) -} - -fn discover_crates(dir: &PathBuf, crates: &mut BTreeMap) -> Result<()> { - let d = std::fs::read_dir(dir)?; - for c in d { - let entry = c?; - if entry.file_type()?.is_dir() { - let path = dir.join(entry.path()); - let cargo_toml = path.join("Cargo.toml"); - - if cargo_toml.exists() { - let content = fs::read_to_string(&cargo_toml)?; - - // Try to parse as a crate, skip if it's a workspace - let parsed: Result = toml::from_str(&content); - if let Ok(parsed) = parsed { - let id = parsed.package.name; - - let metadata = &parsed.package.metadata.embassy; - - if metadata.skip { - continue; - } - - let mut dependencies = Vec::new(); - for (k, _) in parsed.dependencies { - if k.starts_with("embassy-") { - dependencies.push(k); - } - } - - let mut configs = metadata.build.clone(); - if configs.is_empty() { - configs.push(BuildConfig { - features: vec![], - target: None, - artifact_dir: None, - }) - } - - crates.insert( - id.clone(), - Crate { - name: id, - version: parsed.package.version, - path, - dependencies, - configs, - publish: parsed.package.publish, - }, - ); - } - } else { - // Recursively search subdirectories, but only for examples, tests, and docs - let file_name = entry.file_name(); - let dir_name = file_name.to_string_lossy(); - if dir_name == "examples" || dir_name == "tests" || dir_name == "docs" { - discover_crates(&path, crates)?; - } - } - } - } - Ok(()) -} - -fn build_graph(crates: &BTreeMap) -> (Graph, HashMap) { - let mut graph = Graph::::new(); - let mut node_indices: HashMap = HashMap::new(); - - // Helper to insert or get existing node - let get_or_insert_node = |id: CrateId, graph: &mut Graph, map: &mut HashMap| { - if let Some(&idx) = map.get(&id) { - idx - } else { - let idx = graph.add_node(id.clone()); - map.insert(id, idx); - idx - } - }; - - for krate in crates.values() { - get_or_insert_node(krate.name.clone(), &mut graph, &mut node_indices); - } - - for krate in crates.values() { - // Insert crate node if not exists - let crate_idx = get_or_insert_node(krate.name.clone(), &mut graph, &mut node_indices); - - // Insert dependencies and connect edges - for dep in krate.dependencies.iter() { - let dep_idx = get_or_insert_node(dep.clone(), &mut graph, &mut node_indices); - graph.add_edge(crate_idx, dep_idx, ()); - } - } - - (graph, node_indices) -} - -struct Context { - root: PathBuf, - crates: BTreeMap, - graph: Graph, - indices: HashMap, -} - -fn find_repo_root() -> Result { - let mut path = std::env::current_dir()?.canonicalize()?; - - loop { - // Check if this directory contains a .git directory - if path.join(".git").exists() { - return Ok(path); - } - - // Move to parent directory - match path.parent() { - Some(parent) => path = parent.to_path_buf(), - None => break, - } - } - - Err(anyhow!( - "Could not find repository root. Make sure you're running this tool from within the embassy repository." - )) -} - -fn load_context() -> Result { - let root = find_repo_root()?; - let crates = list_crates(&root)?; - let (graph, indices) = build_graph(&crates); - - let ctx = Context { - root, - crates, - graph, - indices, - }; - - // Check for publish dependency conflicts - check_publish_dependencies(&ctx)?; - - Ok(ctx) -} - -fn main() -> Result<()> { - SimpleLogger::new().init().unwrap(); - let args = Args::parse(); - let mut ctx = load_context()?; - - match args.command { - Command::List => { - let ordered = petgraph::algo::toposort(&ctx.graph, None).unwrap(); - for node in ordered.iter() { - let start = ctx.graph.node_weight(*node).unwrap(); - let mut bfs = Bfs::new(&ctx.graph, *node); - while let Some(node) = bfs.next(&ctx.graph) { - let weight = ctx.graph.node_weight(node).unwrap(); - let c = ctx.crates.get(weight).unwrap(); - if weight == start { - println!("+ {}-{}", weight, c.version); - } else { - println!("|- {}-{}", weight, c.version); - } - } - println!(""); - } - } - Command::Dependencies { crate_name } => { - let idx = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); - let mut bfs = Bfs::new(&ctx.graph, *idx); - while let Some(node) = bfs.next(&ctx.graph) { - let weight = ctx.graph.node_weight(node).unwrap(); - let crt = ctx.crates.get(weight).unwrap(); - if *weight == crate_name { - println!("+ {}-{}", weight, crt.version); - } else { - println!("|- {}-{}", weight, crt.version); - } - } - } - Command::Dependents { crate_name } => { - let idx = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); - let weight = ctx.graph.node_weight(*idx).unwrap(); - let crt = ctx.crates.get(weight).unwrap(); - println!("+ {}-{}", weight, crt.version); - for parent in ctx.graph.neighbors_directed(*idx, Direction::Incoming) { - let weight = ctx.graph.node_weight(parent).unwrap(); - let crt = ctx.crates.get(weight).unwrap(); - println!("|- {}-{}", weight, crt.version); - } - } - Command::Build { crate_name } => { - build::build(&ctx, crate_name.as_deref())?; - } - Command::SemverCheck { crate_name } => { - let c = ctx.crates.get(&crate_name).unwrap(); - if !c.publish { - bail!("Cannot run semver-check on non-publishable crate '{}'", crate_name); - } - check_semver(&c)?; - } - Command::PrepareRelease { crate_name } => { - let start = ctx.indices.get(&crate_name).expect("unable to find crate in tree"); - - // Check if the target crate is publishable - let start_weight = ctx.graph.node_weight(*start).unwrap(); - let start_crate = ctx.crates.get(start_weight).unwrap(); - if !start_crate.publish { - bail!("Cannot prepare release for non-publishable crate '{}'", crate_name); - } - - let mut rgraph = ctx.graph.clone(); - rgraph.reverse(); - - let mut bfs = Bfs::new(&rgraph, *start); - - while let Some(node) = bfs.next(&rgraph) { - let weight = rgraph.node_weight(node).unwrap(); - println!("Preparing {}", weight); - let mut c = ctx.crates.get_mut(weight).unwrap(); - if c.publish { - let ver = semver::Version::parse(&c.version)?; - let newver = match check_semver(&c)? { - ReleaseType::Major | ReleaseType::Minor => semver::Version::new(ver.major, ver.minor + 1, 0), - ReleaseType::Patch => semver::Version::new(ver.major, ver.minor, ver.patch + 1), - _ => unreachable!(), - }; - - println!("Updating {} from {} -> {}", weight, c.version, newver.to_string()); - let newver = newver.to_string(); - - update_version(&mut c, &newver)?; - let c = ctx.crates.get(weight).unwrap(); - - // Update all nodes further down the tree - let mut bfs = Bfs::new(&rgraph, node); - while let Some(dep_node) = bfs.next(&rgraph) { - let dep_weight = rgraph.node_weight(dep_node).unwrap(); - let dep = ctx.crates.get(dep_weight).unwrap(); - update_versions(dep, &c.name, &newver)?; - } - - // Update changelog - update_changelog(&ctx.root, &c)?; - } - } - - let weight = rgraph.node_weight(*start).unwrap(); - let c = ctx.crates.get(weight).unwrap(); - publish_release(&ctx.root, &c, false)?; - - println!("# Please inspect changes and run the following commands when happy:"); - - println!("git commit -a -m 'chore: prepare crate releases'"); - let mut bfs = Bfs::new(&rgraph, *start); - while let Some(node) = bfs.next(&rgraph) { - let weight = rgraph.node_weight(node).unwrap(); - let c = ctx.crates.get(weight).unwrap(); - if c.publish { - println!("git tag {}-v{}", weight, c.version); - } - } - - println!(""); - println!("# Run these commands to publish the crate and dependents:"); - - let mut bfs = Bfs::new(&rgraph, *start); - while let Some(node) = bfs.next(&rgraph) { - let weight = rgraph.node_weight(node).unwrap(); - let c = ctx.crates.get(weight).unwrap(); - - let mut args: Vec = vec![ - "publish".to_string(), - "--manifest-path".to_string(), - c.path.join("Cargo.toml").display().to_string(), - ]; - - let config = c.configs.first().unwrap(); // TODO - if !config.features.is_empty() { - args.push("--features".into()); - args.push(config.features.join(",")); - } - - if let Some(target) = &config.target { - args.push("--target".into()); - args.push(target.clone()); - } - - /* - let mut dry_run = args.clone(); - dry_run.push("--dry-run".to_string()); - - println!("cargo {}", dry_run.join(" ")); - */ - if c.publish { - println!("cargo {}", args.join(" ")); - } - } - - println!(""); - println!("# Run this command to push changes and tags:"); - println!("git push --tags"); - } - } - Ok(()) -} - -fn check_semver(c: &Crate) -> Result { - let min_version = semver_check::minimum_update(c)?; - println!("Version should be bumped to {:?}", min_version); - Ok(min_version) -} - -fn update_changelog(repo: &Path, c: &Crate) -> Result<()> { - let args: Vec = vec![ - "release".to_string(), - "replace".to_string(), - "--config".to_string(), - repo.join("release").join("release.toml").display().to_string(), - "--manifest-path".to_string(), - c.path.join("Cargo.toml").display().to_string(), - "--execute".to_string(), - "--no-confirm".to_string(), - ]; - - let status = ProcessCommand::new("cargo").args(&args).output()?; - - println!("{}", core::str::from_utf8(&status.stdout).unwrap()); - eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); - if !status.status.success() { - return Err(anyhow!("release replace failed")); - } else { - Ok(()) - } -} - -fn publish_release(_repo: &Path, c: &Crate, push: bool) -> Result<()> { - let config = c.configs.first().unwrap(); // TODO - - let mut args: Vec = vec![ - "publish".to_string(), - "--manifest-path".to_string(), - c.path.join("Cargo.toml").display().to_string(), - ]; - - args.push("--features".into()); - args.push(config.features.join(",")); - - if let Some(target) = &config.target { - args.push("--target".into()); - args.push(target.clone()); - } - - if !push { - args.push("--dry-run".to_string()); - args.push("--allow-dirty".to_string()); - args.push("--keep-going".to_string()); - } - - let status = ProcessCommand::new("cargo").args(&args).output()?; - - println!("{}", core::str::from_utf8(&status.stdout).unwrap()); - eprintln!("{}", core::str::from_utf8(&status.stderr).unwrap()); - if !status.status.success() { - return Err(anyhow!("publish failed")); - } else { - Ok(()) - } -} - -/// Make the path "Windows"-safe -pub fn windows_safe_path(path: &Path) -> PathBuf { - PathBuf::from(path.to_str().unwrap().to_string().replace("\\\\?\\", "")) -} diff --git a/release/src/semver_check.rs b/release/src/semver_check.rs deleted file mode 100644 index 6255260f3..000000000 --- a/release/src/semver_check.rs +++ /dev/null @@ -1,178 +0,0 @@ -use std::collections::HashSet; -use std::env; -use std::path::PathBuf; - -use anyhow::anyhow; -use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc}; -use flate2::read::GzDecoder; -use tar::Archive; - -use crate::cargo::CargoArgsBuilder; -use crate::types::{BuildConfig, Crate}; - -/// Return the minimum required bump for the next release. -/// Even if nothing changed this will be [ReleaseType::Patch] -pub fn minimum_update(krate: &Crate) -> Result { - let config = krate.configs.first().unwrap(); // TODO - - let package_name = krate.name.clone(); - let baseline_path = download_baseline(&package_name, &krate.version)?; - let mut baseline_krate = krate.clone(); - baseline_krate.path = baseline_path; - - // Compare features as it's not covered by semver-checks - if compare_features(&baseline_krate, &krate)? { - return Ok(ReleaseType::Minor); - } - let baseline_path = build_doc_json(&baseline_krate, config)?; - let current_path = build_doc_json(krate, config)?; - - let baseline = Rustdoc::from_path(&baseline_path); - let doc = Rustdoc::from_path(¤t_path); - let mut semver_check = Check::new(doc); - semver_check.with_default_features(); - semver_check.set_baseline(baseline); - semver_check.set_packages(vec![package_name]); - let extra_current_features = config.features.clone(); - let extra_baseline_features = config.features.clone(); - semver_check.set_extra_features(extra_current_features, extra_baseline_features); - if let Some(target) = &config.target { - semver_check.set_build_target(target.clone()); - } - let mut cfg = GlobalConfig::new(); - cfg.set_log_level(Some(log::Level::Info)); - - let result = semver_check.check_release(&mut cfg)?; - - let mut min_required_update = ReleaseType::Patch; - for (_, report) in result.crate_reports() { - if let Some(required_bump) = report.required_bump() { - let required_is_stricter = - (min_required_update == ReleaseType::Patch) || (required_bump == ReleaseType::Major); - if required_is_stricter { - min_required_update = required_bump; - } - } - } - - Ok(min_required_update) -} - -fn compare_features(old: &Crate, new: &Crate) -> Result { - let mut old = read_features(&old.path)?; - let new = read_features(&new.path)?; - - old.retain(|r| !new.contains(r)); - log::info!("Features removed in new: {:?}", old); - Ok(!old.is_empty()) -} - -fn download_baseline(name: &str, version: &str) -> Result { - let config = crates_index::IndexConfig { - dl: "https://crates.io/api/v1/crates".to_string(), - api: Some("https://crates.io".to_string()), - }; - - let url = - config - .download_url(name, version) - .ok_or(anyhow!("unable to download baseline for {}-{}", name, version))?; - - let parent_dir = env::var("RELEASER_CACHE").map_err(|_| anyhow!("RELEASER_CACHE not set"))?; - - let extract_path = PathBuf::from(&parent_dir).join(format!("{}-{}", name, version)); - - if extract_path.exists() { - return Ok(extract_path); - } - - let response = reqwest::blocking::get(url)?; - let bytes = response.bytes()?; - - let decoder = GzDecoder::new(&bytes[..]); - let mut archive = Archive::new(decoder); - archive.unpack(&parent_dir)?; - - Ok(extract_path) -} - -fn read_features(crate_path: &PathBuf) -> Result, anyhow::Error> { - let cargo_toml_path = crate_path.join("Cargo.toml"); - - if !cargo_toml_path.exists() { - return Err(anyhow!("Cargo.toml not found at {:?}", cargo_toml_path)); - } - - let manifest = cargo_manifest::Manifest::from_path(&cargo_toml_path)?; - - let mut set = HashSet::new(); - if let Some(features) = manifest.features { - for f in features.keys() { - set.insert(f.clone()); - } - } - if let Some(deps) = manifest.dependencies { - for (k, v) in deps.iter() { - if v.optional() { - set.insert(k.clone()); - } - } - } - - Ok(set) -} - -fn build_doc_json(krate: &Crate, config: &BuildConfig) -> Result { - let target_dir = std::env::var("CARGO_TARGET_DIR"); - - let target_path = if let Ok(target) = target_dir { - PathBuf::from(target) - } else { - PathBuf::from(&krate.path).join("target") - }; - - let current_path = target_path; - let current_path = if let Some(target) = &config.target { - current_path.join(target.clone()) - } else { - current_path - }; - let current_path = current_path - .join("doc") - .join(format!("{}.json", krate.name.to_string().replace("-", "_"))); - - std::fs::remove_file(¤t_path).ok(); - let features = config.features.clone(); - - log::info!("Building doc json for {} with features: {:?}", krate.name, features); - - let envs = vec![( - "RUSTDOCFLAGS", - "--cfg docsrs --cfg not_really_docsrs --cfg semver_checks", - )]; - - // always use `specific nightly` toolchain so we don't have to deal with potentially - // different versions of the doc-json - let cargo_builder = CargoArgsBuilder::default() - .toolchain("nightly-2025-06-29") - .subcommand("rustdoc") - .features(&features); - let cargo_builder = if let Some(target) = &config.target { - cargo_builder.target(target.clone()) - } else { - cargo_builder - }; - - let cargo_builder = cargo_builder - .arg("-Zunstable-options") - .arg("-Zhost-config") - .arg("-Ztarget-applies-to-host") - .arg("--lib") - .arg("--output-format=json") - .arg("-Zbuild-std=alloc,core") - .arg("--config=host.rustflags=[\"--cfg=instability_disable_unstable_docs\"]"); - let cargo_args = cargo_builder.build(); - log::debug!("{cargo_args:#?}"); - crate::cargo::run_with_env(&cargo_args, &krate.path, envs, false)?; - Ok(current_path) -} diff --git a/release/src/types.rs b/release/src/types.rs deleted file mode 100644 index be0a883f1..000000000 --- a/release/src/types.rs +++ /dev/null @@ -1,60 +0,0 @@ -use std::collections::BTreeMap; -use std::path::PathBuf; - -use serde::Deserialize; - -#[derive(Debug, Deserialize)] -pub struct ParsedCrate { - pub package: ParsedPackage, - pub dependencies: BTreeMap, -} - -#[derive(Debug, Deserialize)] -pub struct ParsedPackage { - pub name: String, - pub version: String, - #[serde(default = "default_publish")] - pub publish: bool, - #[serde(default)] - pub metadata: Metadata, -} - -fn default_publish() -> bool { - true -} - -#[derive(Debug, Deserialize, Default)] -pub struct Metadata { - #[serde(default)] - pub embassy: MetadataEmbassy, -} - -#[allow(dead_code)] -#[derive(Debug, Deserialize, Default)] -pub struct MetadataEmbassy { - #[serde(default)] - pub skip: bool, - #[serde(default)] - pub build: Vec, -} - -#[derive(Debug, Clone, Deserialize)] -pub struct BuildConfig { - #[serde(default)] - pub features: Vec, - pub target: Option, - #[serde(rename = "artifact-dir")] - pub artifact_dir: Option, -} - -pub type CrateId = String; - -#[derive(Debug, Clone)] -pub struct Crate { - pub name: String, - pub version: String, - pub path: PathBuf, - pub dependencies: Vec, - pub configs: Vec, - pub publish: bool, -} -- cgit From 462245b0fecf148e376efeedee943fd70590550e Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 19 Aug 2025 14:12:56 +0200 Subject: fix: use the cargo-embassy-devtool --- ci.sh | 335 ++---------------------------------------------------------------- 1 file changed, 10 insertions(+), 325 deletions(-) diff --git a/ci.sh b/ci.sh index 4fdce65d2..f8a06c6fa 100755 --- a/ci.sh +++ b/ci.sh @@ -10,6 +10,14 @@ if ! command -v cargo-batch &> /dev/null; then exit 1 fi +if ! command -v cargo-embassy-devtool &> /dev/null; then + echo "cargo-embassy-devtool could not be found. Install it with the following command:" + echo "" + echo " cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --bin cargo-embassy-devtool --locked" + echo "" + exit 1 +fi + export RUSTFLAGS=-Dwarnings export DEFMT_LOG=trace,embassy_hal_internal=debug,embassy_net_esp_hosted=debug,cyw43=info,cyw43_pio=info,smoltcp=info if [[ -z "${CARGO_TARGET_DIR}" ]]; then @@ -23,331 +31,8 @@ if [ $TARGET = "x86_64-unknown-linux-gnu" ] || [ $TARGET = "aarch64-unknown-linu BUILD_EXTRA="--- build --release --manifest-path examples/std/Cargo.toml --target $TARGET --artifact-dir out/examples/std" fi -# CI intentionally does not use -eabihf on thumbv7em to minimize dep compile time. -cargo batch \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features log \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features defmt \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features defmt \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features defmt,arch-cortex-m,executor-thread,executor-interrupt \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,rtos-trace \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-thread \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-interrupt \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-thread,executor-interrupt \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7a-none-eabi --features arch-cortex-ar,executor-thread \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7r-none-eabi --features arch-cortex-ar,executor-thread \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7r-none-eabihf --features arch-cortex-ar,executor-thread \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features arch-riscv32 \ - --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features arch-riscv32,executor-thread \ - --- build --release --manifest-path embassy-embedded-hal/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path embassy-embedded-hal/Cargo.toml --target thumbv7em-none-eabi --features time \ - --- build --release --manifest-path embassy-sync/Cargo.toml --target thumbv6m-none-eabi --features defmt \ - --- build --release --manifest-path embassy-time/Cargo.toml --target thumbv6m-none-eabi --features defmt,defmt-timestamp-uptime,mock-driver \ - --- build --release --manifest-path embassy-time/Cargo.toml --features defmt,std \ - --- build --release --manifest-path embassy-time-queue-utils/Cargo.toml --target thumbv6m-none-eabi \ - --- build --release --manifest-path embassy-time-queue-utils/Cargo.toml --target thumbv6m-none-eabi --features generic-queue-8 \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,medium-ethernet,packet-trace \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,multicast,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet,dhcpv4-hostname \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ieee802154 \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet,medium-ieee802154 \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet \ - --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet,medium-ieee802154 \ - --- build --release --manifest-path embassy-imxrt/Cargo.toml --target thumbv8m.main-none-eabihf --features mimxrt633s,defmt,unstable-pac,time,time-driver-rtc \ - --- build --release --manifest-path embassy-imxrt/Cargo.toml --target thumbv8m.main-none-eabihf --features mimxrt685s,defmt,unstable-pac,time,time-driver-rtc \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time,time-driver-rtc1,reset-pin-as-gpio \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time,time-driver-rtc1,nfc-pins-as-gpio \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf54l15-app-s,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf54l15-app-ns,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,defmt,time,time-driver-rtc1 \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,defmt,time \ - --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,time \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,defmt,rp2040 \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,log,rp2040 \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,intrinsics,rp2040 \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,qspi-as-gpio,rp2040 \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,defmt,rp235xa \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,log,rp235xa \ - --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,rp235xa,binary-info \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,single-bank,defmt \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c051f6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c091gb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c092rc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f038f6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030c6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f058t8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030r8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f031k6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030rc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f070f6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f078vb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f042g4,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f072c8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f412zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f413vh,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f415zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time,split-pc2,split-pc3 \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h725re,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7b3ai,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7b3ai,defmt,exti,time-driver-tim1,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7r3z8,defmt,exti,time-driver-tim1,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7r7a8,defmt,exti,time-driver-tim1,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s3a8,log,exti,time-driver-tim1,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s7z8,defmt,exti,time-driver-tim1,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l431cb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l422cb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb15cc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l041f6,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l051k8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l073cz,defmt,exti,time-driver-any,low-power,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303c8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f398ve,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f378cc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g0b0ce,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g0c1ve,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,low-power,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32wl54jc-cm0p,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wle5jb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g431kb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g474pe,dual-bank,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f107vc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103re,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f100c4,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h503rb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h523cc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h562ag,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba62cg,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba65ri,defmt,exti,time-driver-any,low-power,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5f9zj,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg,defmt,exti,time-driver-any,low-power,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u031r8,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u073mb,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u083rc,defmt,exti,time-driver-any,time \ - --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf --features lpc55,defmt \ - --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1011,rt,defmt,time-driver-pit \ - --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1062,rt,defmt,time-driver-pit \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1104dgs20,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507pm,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3519pz,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1306rhb,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l2228pn,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1345dgs28,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1106dgs28,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1228pm,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1107ycj,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3105rhb,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1505pt,defmt,time-driver-any \ - --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1519rhb,defmt,time-driver-any \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs' \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs' \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs,bluetooth' \ - --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs,bluetooth' \ - --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \ - --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf5340-app-s \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns \ - --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns \ - --- build --release --manifest-path embassy-boot-rp/Cargo.toml --target thumbv6m-none-eabi --features embassy-rp/rp2040 \ - --- build --release --manifest-path embassy-boot-stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32l496zg \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --no-default-features \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features log \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features defmt \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features usbd-hid \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-1 \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-8 \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \ - --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \ - --- build --release --manifest-path docs/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path docs/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path docs/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path docs/examples/layer-by-layer/blinky-irq/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path docs/examples/layer-by-layer/blinky-async/Cargo.toml --target thumbv7em-none-eabi \ - --- build --release --manifest-path examples/nrf52810/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/nrf52810 \ - --- build --release --manifest-path examples/nrf52840/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/nrf52840 \ - --- build --release --manifest-path examples/nrf5340/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf5340 \ - --- build --release --manifest-path examples/nrf54l15/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf54l15 \ - --- build --release --manifest-path examples/nrf9160/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9160 \ - --- build --release --manifest-path examples/nrf9151/s/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9151/s \ - --- build --release --manifest-path examples/nrf9151/ns/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9151/ns \ - --- build --release --manifest-path examples/nrf51/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/nrf51 \ - --- build --release --manifest-path examples/rp/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/rp \ - --- build --release --manifest-path examples/rp235x/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/rp235x \ - --- build --release --manifest-path examples/stm32f0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32f0 \ - --- build --release --manifest-path examples/stm32f1/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32f1 \ - --- build --release --manifest-path examples/stm32f2/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32f2 \ - --- build --release --manifest-path examples/stm32f3/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f3 \ - --- build --release --manifest-path examples/stm32f334/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f334 \ - --- build --release --manifest-path examples/stm32f4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f4 \ - --- build --release --manifest-path examples/stm32f469/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f469 \ - --- build --release --manifest-path examples/stm32f7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f7 \ - --- build --release --manifest-path examples/stm32c0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32c0 \ - --- build --release --manifest-path examples/stm32g0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32g0 \ - --- build --release --manifest-path examples/stm32g4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32g4 \ - --- build --release --manifest-path examples/stm32h5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32h5 \ - --- build --release --manifest-path examples/stm32h7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7 \ - --- build --release --manifest-path examples/stm32h7b0/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7b0 \ - --- build --release --manifest-path examples/stm32h723/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h723 \ - --- build --release --manifest-path examples/stm32h735/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h735 \ - --- build --release --manifest-path examples/stm32h755cm4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm4 \ - --- build --release --manifest-path examples/stm32h755cm7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm7 \ - --- build --release --manifest-path examples/stm32h7rs/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7rs \ - --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32l0 \ - --- build --release --manifest-path examples/stm32l1/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32l1 \ - --- build --release --manifest-path examples/stm32l4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32l4 \ - --- build --release --manifest-path examples/stm32l432/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32l432 \ - --- build --release --manifest-path examples/stm32l5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32l5 \ - --- build --release --manifest-path examples/stm32u0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32u0 \ - --- build --release --manifest-path examples/stm32u5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32u5 \ - --- build --release --manifest-path examples/stm32wb/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32wb \ - --- build --release --manifest-path examples/stm32wba/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32wba \ - --- build --release --manifest-path examples/stm32wba6/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32wba6 \ - --- build --release --manifest-path examples/stm32wl/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32wl \ - --- build --release --manifest-path examples/lpc55s69/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/lpc55s69 \ - --- build --release --manifest-path examples/mimxrt1011/Cargo.toml --target thumbv7em-none-eabihf --artifact-dir out/examples/mimxrt1011 \ - --- build --release --manifest-path examples/mimxrt1062-evk/Cargo.toml --target thumbv7em-none-eabihf --artifact-dir out/examples/mimxrt1062-evk \ - --- build --release --manifest-path examples/mspm0g3507/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0g3507 \ - --- build --release --manifest-path examples/mspm0g3519/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0g3519 \ - --- build --release --manifest-path examples/mspm0l1306/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0l1306 \ - --- build --release --manifest-path examples/mspm0l2228/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0l2228 \ - --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840,skip-include --artifact-dir out/examples/boot/nrf52840 \ - --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns,skip-include --artifact-dir out/examples/boot/nrf9160 \ - --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns,skip-include --artifact-dir out/examples/boot/nrf9120 \ - --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns,skip-include --artifact-dir out/examples/boot/nrf9151 \ - --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns,skip-include --artifact-dir out/examples/boot/nrf9161 \ - --- build --release --manifest-path examples/boot/application/rp/Cargo.toml --target thumbv6m-none-eabi --features skip-include --artifact-dir out/examples/boot/rp \ - --- build --release --manifest-path examples/boot/application/stm32f3/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32f3 \ - --- build --release --manifest-path examples/boot/application/stm32f7/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32f7 \ - --- build --release --manifest-path examples/boot/application/stm32h7/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32h7 \ - --- build --release --manifest-path examples/boot/application/stm32l0/Cargo.toml --target thumbv6m-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l0 \ - --- build --release --manifest-path examples/boot/application/stm32l1/Cargo.toml --target thumbv7m-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l1 \ - --- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l4 \ - --- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32wl \ - --- build --release --manifest-path examples/boot/application/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/boot/stm32wb-dfu \ - --- build --release --manifest-path examples/boot/application/stm32wba-dfu/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/boot/stm32wba-dfu \ - --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ - --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \ - --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \ - --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns \ - --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns \ - --- build --release --manifest-path examples/boot/bootloader/rp/Cargo.toml --target thumbv6m-none-eabi \ - --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32l496zg \ - --- build --release --manifest-path examples/boot/bootloader/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wb55rg \ - --- build --release --manifest-path examples/boot/bootloader/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wb55rg,verify \ - --- build --release --manifest-path examples/boot/bootloader/stm32wba-dfu/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-stm32/stm32wba65ri,verify \ - --- build --release --manifest-path examples/boot/bootloader/stm32-dual-bank/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32h743zi \ - --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --artifact-dir out/examples/wasm \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --artifact-dir out/tests/stm32f103c8 \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --artifact-dir out/tests/stm32f429zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446re --artifact-dir out/tests/stm32f446re \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --artifact-dir out/tests/stm32g491re \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --artifact-dir out/tests/stm32g071rb \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --artifact-dir out/tests/stm32c031c6 \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb --artifact-dir out/tests/stm32c071rb \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --artifact-dir out/tests/stm32h755zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi --artifact-dir out/tests/stm32h753zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7a3zi --artifact-dir out/tests/stm32h7a3zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --artifact-dir out/tests/stm32wb55rg \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h563zi --artifact-dir out/tests/stm32h563zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u585ai --artifact-dir out/tests/stm32u585ai \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5a5zj --artifact-dir out/tests/stm32u5a5zj \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba52cg --artifact-dir out/tests/stm32wba52cg \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l073rz --artifact-dir out/tests/stm32l073rz \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l152re --artifact-dir out/tests/stm32l152re \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4a6zg --artifact-dir out/tests/stm32l4a6zg \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r5zi --artifact-dir out/tests/stm32l4r5zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze --artifact-dir out/tests/stm32l552ze \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f767zi --artifact-dir out/tests/stm32f767zi \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f207zg --artifact-dir out/tests/stm32f207zg \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303ze --artifact-dir out/tests/stm32f303ze \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l496zg --artifact-dir out/tests/stm32l496zg \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55jc --artifact-dir out/tests/stm32wl55jc \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s3l8 --artifact-dir out/tests/stm32h7s3l8 \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f091rc --artifact-dir out/tests/stm32f091rc \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h503rb --artifact-dir out/tests/stm32h503rb \ - --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u083rc --artifact-dir out/tests/stm32u083rc \ - --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --features rp2040 --artifact-dir out/tests/rpi-pico \ - --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv8m.main-none-eabihf --features rp235xb --artifact-dir out/tests/pimoroni-pico-plus-2 \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51422 --artifact-dir out/tests/nrf51422-dk \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832 --artifact-dir out/tests/nrf52832-dk \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833 --artifact-dir out/tests/nrf52833-dk \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840 --artifact-dir out/tests/nrf52840-dk \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340 --artifact-dir out/tests/nrf5340-dk \ - --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160 --artifact-dir out/tests/nrf9160-dk \ - --- build --release --manifest-path tests/mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507 --artifact-dir out/tests/mspm0g3507 \ - --- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \ - $BUILD_EXTRA - +# Use devtool to build all combinations defined in the Cargo.tomls +cargo embassy-devtool build # MSPM0C1104 must be built seperately since cargo batch does not consider env vars set in `.cargo/config.toml`. # Since the target has 1KB of ram, we need to limit defmt's buffer size. -- cgit From ce4ffe52da4ec042c44f6073e036b363c9f89189 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 25 Aug 2025 19:47:08 +0200 Subject: add metadata for embassy-executor-time-queue --- embassy-executor-timer-queue/Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-executor-timer-queue/Cargo.toml b/embassy-executor-timer-queue/Cargo.toml index 0db327ba9..a0ac44420 100644 --- a/embassy-executor-timer-queue/Cargo.toml +++ b/embassy-executor-timer-queue/Cargo.toml @@ -33,3 +33,9 @@ timer-item-size-8-words = [] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-executor-timer-queue-v$VERSION/embassy-executor-timer-queue/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-executor-timer-queue/src/" target = "x86_64-unknown-linux-gnu" + +[package.metadata.embassy] +build = [ + {target = "thumbv7em-none-eabi", features = []}, + {target = "thumbv6m-none-eabi", features = []}, +] -- cgit From a416aac9c25c6aad226d8b7bdaefaab0015c5718 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 25 Aug 2025 19:48:34 +0200 Subject: fix: revert changes to ci.sh for now --- ci.sh | 336 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 325 insertions(+), 11 deletions(-) diff --git a/ci.sh b/ci.sh index f8a06c6fa..68bf38881 100755 --- a/ci.sh +++ b/ci.sh @@ -10,14 +10,6 @@ if ! command -v cargo-batch &> /dev/null; then exit 1 fi -if ! command -v cargo-embassy-devtool &> /dev/null; then - echo "cargo-embassy-devtool could not be found. Install it with the following command:" - echo "" - echo " cargo install --git https://github.com/embassy-rs/cargo-embassy-devtool --bin cargo-embassy-devtool --locked" - echo "" - exit 1 -fi - export RUSTFLAGS=-Dwarnings export DEFMT_LOG=trace,embassy_hal_internal=debug,embassy_net_esp_hosted=debug,cyw43=info,cyw43_pio=info,smoltcp=info if [[ -z "${CARGO_TARGET_DIR}" ]]; then @@ -31,8 +23,331 @@ if [ $TARGET = "x86_64-unknown-linux-gnu" ] || [ $TARGET = "aarch64-unknown-linu BUILD_EXTRA="--- build --release --manifest-path examples/std/Cargo.toml --target $TARGET --artifact-dir out/examples/std" fi -# Use devtool to build all combinations defined in the Cargo.tomls -cargo embassy-devtool build +# CI intentionally does not use -eabihf on thumbv7em to minimize dep compile time. +cargo batch \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features log \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features defmt \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features defmt \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features defmt,arch-cortex-m,executor-thread,executor-interrupt \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,rtos-trace \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-thread \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-interrupt \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features arch-cortex-m,executor-thread,executor-interrupt \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7a-none-eabi --features arch-cortex-ar,executor-thread \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7r-none-eabi --features arch-cortex-ar,executor-thread \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target armv7r-none-eabihf --features arch-cortex-ar,executor-thread \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features arch-riscv32 \ + --- build --release --manifest-path embassy-executor/Cargo.toml --target riscv32imac-unknown-none-elf --features arch-riscv32,executor-thread \ + --- build --release --manifest-path embassy-embedded-hal/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path embassy-embedded-hal/Cargo.toml --target thumbv7em-none-eabi --features time \ + --- build --release --manifest-path embassy-sync/Cargo.toml --target thumbv6m-none-eabi --features defmt \ + --- build --release --manifest-path embassy-time/Cargo.toml --target thumbv6m-none-eabi --features defmt,defmt-timestamp-uptime,mock-driver \ + --- build --release --manifest-path embassy-time/Cargo.toml --features defmt,std \ + --- build --release --manifest-path embassy-time-queue-utils/Cargo.toml --target thumbv6m-none-eabi \ + --- build --release --manifest-path embassy-time-queue-utils/Cargo.toml --target thumbv6m-none-eabi --features generic-queue-8 \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,medium-ethernet,packet-trace \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,multicast,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,dhcpv4,medium-ethernet,dhcpv4-hostname \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ieee802154 \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet,medium-ieee802154 \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv6,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet \ + --- build --release --manifest-path embassy-net/Cargo.toml --target thumbv7em-none-eabi --features defmt,tcp,udp,dns,proto-ipv4,proto-ipv6,medium-ip,medium-ethernet,medium-ieee802154 \ + --- build --release --manifest-path embassy-imxrt/Cargo.toml --target thumbv8m.main-none-eabihf --features mimxrt633s,defmt,unstable-pac,time,time-driver-rtc \ + --- build --release --manifest-path embassy-imxrt/Cargo.toml --target thumbv8m.main-none-eabihf --features mimxrt685s,defmt,unstable-pac,time,time-driver-rtc \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time,time-driver-rtc1,reset-pin-as-gpio \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time,time-driver-rtc1,nfc-pins-as-gpio \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf54l15-app-s,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf54l15-app-ns,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,log,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,defmt,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,defmt,time,time-driver-rtc1 \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,defmt,time \ + --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51,time \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,defmt,rp2040 \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,log,rp2040 \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,intrinsics,rp2040 \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features time-driver,qspi-as-gpio,rp2040 \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,defmt,rp235xa \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,log,rp235xa \ + --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv8m.main-none-eabihf --features time-driver,rp235xa,binary-info \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,single-bank,defmt \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c051f6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c091gb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c092rc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f038f6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030c6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f058t8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030r8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f031k6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030rc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f070f6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f078vb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f042g4,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f072c8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f401ve,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f405zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f407zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f412zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f413vh,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f415zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,time,split-pc2,split-pc3 \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h725re,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7b3ai,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7b3ai,defmt,exti,time-driver-tim1,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7r3z8,defmt,exti,time-driver-tim1,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7r7a8,defmt,exti,time-driver-tim1,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s3a8,defmt,exti,time-driver-tim1,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s7z8,defmt,exti,time-driver-tim1,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l431cb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l422cb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb15cc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l041f6,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l051k8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l073cz,defmt,exti,time-driver-any,low-power,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303c8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f398ve,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f378cc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g0b0ce,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g0c1ve,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti,time-driver-any,low-power,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32wl54jc-cm0p,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wle5jb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g431kb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g474pe,dual-bank,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f107vc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103re,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f100c4,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h503rb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h523cc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h562ag,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba50ke,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba55ug,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba62cg,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba65ri,defmt,exti,time-driver-any,low-power,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5f9zj,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5g9nj,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb35ce,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg,defmt,exti,time-driver-any,low-power,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u031r8,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u073mb,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u083rc,defmt,exti,time-driver-any,time \ + --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf --features lpc55,defmt \ + --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1011,rt,defmt,time-driver-pit \ + --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1062,rt,defmt,time-driver-pit \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1104dgs20,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507pm,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3519pz,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1306rhb,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l2228pn,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1345dgs28,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1106dgs28,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1228pm,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1107ycj,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3105rhb,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1505pt,defmt,time-driver-any \ + --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1519rhb,defmt,time-driver-any \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs' \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs' \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log,firmware-logs,bluetooth' \ + --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt,firmware-logs,bluetooth' \ + --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \ + --- build --release --manifest-path cyw43-pio/Cargo.toml --target thumbv6m-none-eabi --features 'embassy-rp/rp2040' \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf5340-app-s \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns \ + --- build --release --manifest-path embassy-boot-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns \ + --- build --release --manifest-path embassy-boot-rp/Cargo.toml --target thumbv6m-none-eabi --features embassy-rp/rp2040 \ + --- build --release --manifest-path embassy-boot-stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32l496zg \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --no-default-features \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features log \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features defmt \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features usbd-hid \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-1 \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-interface-count-8 \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \ + --- build --release --manifest-path embassy-usb/Cargo.toml --target thumbv6m-none-eabi --features max-handler-count-8 \ + --- build --release --manifest-path docs/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path docs/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path docs/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path docs/examples/layer-by-layer/blinky-irq/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path docs/examples/layer-by-layer/blinky-async/Cargo.toml --target thumbv7em-none-eabi \ + --- build --release --manifest-path examples/nrf52810/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/nrf52810 \ + --- build --release --manifest-path examples/nrf52840/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/nrf52840 \ + --- build --release --manifest-path examples/nrf5340/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf5340 \ + --- build --release --manifest-path examples/nrf54l15/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf54l15 \ + --- build --release --manifest-path examples/nrf9160/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9160 \ + --- build --release --manifest-path examples/nrf9151/s/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9151/s \ + --- build --release --manifest-path examples/nrf9151/ns/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/nrf9151/ns \ + --- build --release --manifest-path examples/nrf51/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/nrf51 \ + --- build --release --manifest-path examples/rp/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/rp \ + --- build --release --manifest-path examples/rp235x/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/rp235x \ + --- build --release --manifest-path examples/stm32f0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32f0 \ + --- build --release --manifest-path examples/stm32f1/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32f1 \ + --- build --release --manifest-path examples/stm32f2/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32f2 \ + --- build --release --manifest-path examples/stm32f3/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f3 \ + --- build --release --manifest-path examples/stm32f334/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f334 \ + --- build --release --manifest-path examples/stm32f4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f4 \ + --- build --release --manifest-path examples/stm32f469/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f469 \ + --- build --release --manifest-path examples/stm32f7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32f7 \ + --- build --release --manifest-path examples/stm32c0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32c0 \ + --- build --release --manifest-path examples/stm32g0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32g0 \ + --- build --release --manifest-path examples/stm32g4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32g4 \ + --- build --release --manifest-path examples/stm32h5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32h5 \ + --- build --release --manifest-path examples/stm32h7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7 \ + --- build --release --manifest-path examples/stm32h7b0/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7b0 \ + --- build --release --manifest-path examples/stm32h723/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h723 \ + --- build --release --manifest-path examples/stm32h735/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h735 \ + --- build --release --manifest-path examples/stm32h755cm4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm4 \ + --- build --release --manifest-path examples/stm32h755cm7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm7 \ + --- build --release --manifest-path examples/stm32h7rs/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7rs \ + --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32l0 \ + --- build --release --manifest-path examples/stm32l1/Cargo.toml --target thumbv7m-none-eabi --artifact-dir out/examples/stm32l1 \ + --- build --release --manifest-path examples/stm32l4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32l4 \ + --- build --release --manifest-path examples/stm32l432/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32l432 \ + --- build --release --manifest-path examples/stm32l5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32l5 \ + --- build --release --manifest-path examples/stm32u0/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/stm32u0 \ + --- build --release --manifest-path examples/stm32u5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32u5 \ + --- build --release --manifest-path examples/stm32wb/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32wb \ + --- build --release --manifest-path examples/stm32wba/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32wba \ + --- build --release --manifest-path examples/stm32wba6/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32wba6 \ + --- build --release --manifest-path examples/stm32wl/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32wl \ + --- build --release --manifest-path examples/lpc55s69/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/lpc55s69 \ + --- build --release --manifest-path examples/mimxrt1011/Cargo.toml --target thumbv7em-none-eabihf --artifact-dir out/examples/mimxrt1011 \ + --- build --release --manifest-path examples/mimxrt1062-evk/Cargo.toml --target thumbv7em-none-eabihf --artifact-dir out/examples/mimxrt1062-evk \ + --- build --release --manifest-path examples/mspm0g3507/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0g3507 \ + --- build --release --manifest-path examples/mspm0g3519/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0g3519 \ + --- build --release --manifest-path examples/mspm0l1306/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0l1306 \ + --- build --release --manifest-path examples/mspm0l2228/Cargo.toml --target thumbv6m-none-eabi --artifact-dir out/examples/mspm0l2228 \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840,skip-include --artifact-dir out/examples/boot/nrf52840 \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns,skip-include --artifact-dir out/examples/boot/nrf9160 \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns,skip-include --artifact-dir out/examples/boot/nrf9120 \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns,skip-include --artifact-dir out/examples/boot/nrf9151 \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns,skip-include --artifact-dir out/examples/boot/nrf9161 \ + --- build --release --manifest-path examples/boot/application/rp/Cargo.toml --target thumbv6m-none-eabi --features skip-include --artifact-dir out/examples/boot/rp \ + --- build --release --manifest-path examples/boot/application/stm32f3/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32f3 \ + --- build --release --manifest-path examples/boot/application/stm32f7/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32f7 \ + --- build --release --manifest-path examples/boot/application/stm32h7/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32h7 \ + --- build --release --manifest-path examples/boot/application/stm32l0/Cargo.toml --target thumbv6m-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l0 \ + --- build --release --manifest-path examples/boot/application/stm32l1/Cargo.toml --target thumbv7m-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l1 \ + --- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32l4 \ + --- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabi --features skip-include --artifact-dir out/examples/boot/stm32wl \ + --- build --release --manifest-path examples/boot/application/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/boot/stm32wb-dfu \ + --- build --release --manifest-path examples/boot/application/stm32wba-dfu/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/boot/stm32wba-dfu \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9120-ns \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9151-ns \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9161-ns \ + --- build --release --manifest-path examples/boot/bootloader/rp/Cargo.toml --target thumbv6m-none-eabi \ + --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32l496zg \ + --- build --release --manifest-path examples/boot/bootloader/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wb55rg \ + --- build --release --manifest-path examples/boot/bootloader/stm32wb-dfu/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wb55rg,verify \ + --- build --release --manifest-path examples/boot/bootloader/stm32wba-dfu/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-stm32/stm32wba65ri,verify \ + --- build --release --manifest-path examples/boot/bootloader/stm32-dual-bank/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32h743zi \ + --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --artifact-dir out/examples/wasm \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --artifact-dir out/tests/stm32f103c8 \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --artifact-dir out/tests/stm32f429zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446re --artifact-dir out/tests/stm32f446re \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --artifact-dir out/tests/stm32g491re \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --artifact-dir out/tests/stm32g071rb \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --artifact-dir out/tests/stm32c031c6 \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb --artifact-dir out/tests/stm32c071rb \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --artifact-dir out/tests/stm32h755zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi --artifact-dir out/tests/stm32h753zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7a3zi --artifact-dir out/tests/stm32h7a3zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --artifact-dir out/tests/stm32wb55rg \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h563zi --artifact-dir out/tests/stm32h563zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u585ai --artifact-dir out/tests/stm32u585ai \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32u5a5zj --artifact-dir out/tests/stm32u5a5zj \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32wba52cg --artifact-dir out/tests/stm32wba52cg \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l073rz --artifact-dir out/tests/stm32l073rz \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l152re --artifact-dir out/tests/stm32l152re \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4a6zg --artifact-dir out/tests/stm32l4a6zg \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r5zi --artifact-dir out/tests/stm32l4r5zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze --artifact-dir out/tests/stm32l552ze \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f767zi --artifact-dir out/tests/stm32f767zi \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f207zg --artifact-dir out/tests/stm32f207zg \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303ze --artifact-dir out/tests/stm32f303ze \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l496zg --artifact-dir out/tests/stm32l496zg \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55jc --artifact-dir out/tests/stm32wl55jc \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7s3l8 --artifact-dir out/tests/stm32h7s3l8 \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f091rc --artifact-dir out/tests/stm32f091rc \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32h503rb --artifact-dir out/tests/stm32h503rb \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32u083rc --artifact-dir out/tests/stm32u083rc \ + --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --features rp2040 --artifact-dir out/tests/rpi-pico \ + --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv8m.main-none-eabihf --features rp235xb --artifact-dir out/tests/pimoroni-pico-plus-2 \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv6m-none-eabi --features nrf51422 --artifact-dir out/tests/nrf51422-dk \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832 --artifact-dir out/tests/nrf52832-dk \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833 --artifact-dir out/tests/nrf52833-dk \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840 --artifact-dir out/tests/nrf52840-dk \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340 --artifact-dir out/tests/nrf5340-dk \ + --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160 --artifact-dir out/tests/nrf9160-dk \ + --- build --release --manifest-path tests/mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507 --artifact-dir out/tests/mspm0g3507 \ + --- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \ + $BUILD_EXTRA + # MSPM0C1104 must be built seperately since cargo batch does not consider env vars set in `.cargo/config.toml`. # Since the target has 1KB of ram, we need to limit defmt's buffer size. @@ -43,7 +358,6 @@ DEFMT_RTT_BUFFER_SIZE="72" cargo batch \ rm -rf out/tests/stm32f103c8 rm -rf out/tests/nrf52840-dk rm -rf out/tests/nrf52833-dk -rm -rf out/tests/nrf5340-dk # disabled because these boards are not on the shelf rm -rf out/tests/mspm0g3507 -- cgit From eb672cdbfe7c4f38124715ddb034e6dc9fc997b4 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 25 Aug 2025 20:11:22 +0200 Subject: fix: re-remove nrf53 dk --- ci.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci.sh b/ci.sh index 68bf38881..94bf83675 100755 --- a/ci.sh +++ b/ci.sh @@ -358,6 +358,7 @@ DEFMT_RTT_BUFFER_SIZE="72" cargo batch \ rm -rf out/tests/stm32f103c8 rm -rf out/tests/nrf52840-dk rm -rf out/tests/nrf52833-dk +rm -rf out/tests/nrf5340-dk # disabled because these boards are not on the shelf rm -rf out/tests/mspm0g3507 -- cgit From c1116d68c9b4e62c3636f83bcfa8478535fc9df6 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 25 Aug 2025 20:14:37 +0200 Subject: fix: bump metapac version --- embassy-stm32/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 92d2e7fda..dc8ee5d43 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -173,8 +173,8 @@ cortex-m = "0.7.6" futures-util = { version = "0.3.30", default-features = false } sdio-host = "0.9.0" critical-section = "1.1" -# stm32-metapac = { version = "17" } -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ecb93d42a6cbcd9e09cab74873908a2ca22327f7" } +stm32-metapac = { version = "18" } +#stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ecb93d42a6cbcd9e09cab74873908a2ca22327f7" } vcell = "0.1.3" nb = "1.0.0" @@ -202,8 +202,8 @@ proptest-state-machine = "0.3.0" proc-macro2 = "1.0.36" quote = "1.0.15" -# stm32-metapac = { version = "17", default-features = false, features = ["metadata"]} -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ecb93d42a6cbcd9e09cab74873908a2ca22327f7", default-features = false, features = ["metadata"] } +stm32-metapac = { version = "18", default-features = false, features = ["metadata"]} +#stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ecb93d42a6cbcd9e09cab74873908a2ca22327f7", default-features = false, features = ["metadata"] } [features] default = ["rt"] -- cgit From c40c20563664a62607f754fc734c7473d28ee955 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 25 Aug 2025 20:36:35 +0200 Subject: fix: stm32 wb sai --- embassy-stm32/src/sai/mod.rs | 50 +++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index 0c9c27797..524e01be7 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs @@ -48,7 +48,7 @@ pub enum Mode { } impl Mode { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn mode(&self, tx_rx: TxRx) -> vals::Mode { match tx_rx { TxRx::Transmitter => match self { @@ -83,7 +83,7 @@ pub enum SlotSize { } impl SlotSize { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn slotsz(&self) -> vals::Slotsz { match self { SlotSize::DataSize => vals::Slotsz::DATA_SIZE, @@ -106,7 +106,7 @@ pub enum DataSize { } impl DataSize { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn ds(&self) -> vals::Ds { match self { DataSize::Data8 => vals::Ds::BIT8, @@ -131,7 +131,7 @@ pub enum FifoThreshold { } impl FifoThreshold { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn fth(&self) -> vals::Fth { match self { FifoThreshold::Empty => vals::Fth::EMPTY, @@ -152,7 +152,7 @@ pub enum MuteValue { } impl MuteValue { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn muteval(&self) -> vals::Muteval { match self { MuteValue::Zero => vals::Muteval::SEND_ZERO, @@ -171,7 +171,7 @@ pub enum Protocol { } impl Protocol { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn prtcfg(&self) -> vals::Prtcfg { match self { Protocol::Free => vals::Prtcfg::FREE, @@ -229,7 +229,7 @@ pub enum StereoMono { } impl StereoMono { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn mono(&self) -> vals::Mono { match self { StereoMono::Stereo => vals::Mono::STEREO, @@ -248,7 +248,7 @@ pub enum BitOrder { } impl BitOrder { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn lsbfirst(&self) -> vals::Lsbfirst { match self { BitOrder::LsbFirst => vals::Lsbfirst::LSB_FIRST, @@ -267,7 +267,7 @@ pub enum FrameSyncOffset { } impl FrameSyncOffset { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn fsoff(&self) -> vals::Fsoff { match self { FrameSyncOffset::OnFirstBit => vals::Fsoff::ON_FIRST, @@ -286,7 +286,7 @@ pub enum FrameSyncPolarity { } impl FrameSyncPolarity { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn fspol(&self) -> vals::Fspol { match self { FrameSyncPolarity::ActiveLow => vals::Fspol::FALLING_EDGE, @@ -304,7 +304,7 @@ pub enum FrameSyncDefinition { } impl FrameSyncDefinition { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn fsdef(&self) -> bool { match self { FrameSyncDefinition::StartOfFrame => false, @@ -322,7 +322,7 @@ pub enum ClockStrobe { } impl ClockStrobe { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn ckstr(&self) -> vals::Ckstr { match self { ClockStrobe::Falling => vals::Ckstr::FALLING_EDGE, @@ -340,7 +340,7 @@ pub enum ComplementFormat { } impl ComplementFormat { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn cpl(&self) -> vals::Cpl { match self { ComplementFormat::OnesComplement => vals::Cpl::ONES_COMPLEMENT, @@ -359,7 +359,7 @@ pub enum Companding { } impl Companding { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn comp(&self) -> vals::Comp { match self { Companding::None => vals::Comp::NO_COMPANDING, @@ -378,7 +378,7 @@ pub enum OutputDrive { } impl OutputDrive { - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] const fn outdriv(&self) -> vals::Outdriv { match self { OutputDrive::OnStart => vals::Outdriv::ON_START, @@ -390,7 +390,7 @@ impl OutputDrive { /// Master clock divider. #[derive(Copy, Clone, PartialEq)] #[allow(missing_docs)] -#[cfg(any(sai_v1, sai_v2))] +#[cfg(any(sai_v1, sai_v1_4pdm, sai_v2))] pub enum MasterClockDivider { MasterClockDisabled, Div1, @@ -483,7 +483,7 @@ pub enum MasterClockDivider { } impl MasterClockDivider { - #[cfg(any(sai_v1, sai_v2))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2))] const fn mckdiv(&self) -> u8 { match self { MasterClockDivider::MasterClockDisabled => 0, @@ -704,7 +704,7 @@ fn update_synchronous_config(config: &mut Config) { config.mode = Mode::Slave; config.sync_output = false; - #[cfg(any(sai_v1, sai_v2))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2))] { config.sync_input = SyncInput::Internal; } @@ -858,7 +858,7 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> { ) -> Self { let ch = T::REGS.ch(sub_block as usize); - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] { ch.cr1().modify(|w| w.set_saien(false)); } @@ -884,7 +884,7 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> { } } - #[cfg(any(sai_v1, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] + #[cfg(any(sai_v1, sai_v1_4pdm, sai_v2, sai_v3_2pdm, sai_v3_4pdm, sai_v4_2pdm, sai_v4_4pdm))] { ch.cr1().modify(|w| { w.set_mode(config.mode.mode(if Self::is_transmitter(&ring_buffer) { @@ -899,14 +899,8 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> { w.set_syncen(config.sync_input.syncen()); w.set_mono(config.stereo_mono.mono()); w.set_outdriv(config.output_drive.outdriv()); - w.set_mckdiv(config.master_clock_divider.mckdiv()); - w.set_nodiv( - if config.master_clock_divider == MasterClockDivider::MasterClockDisabled { - vals::Nodiv::NO_DIV - } else { - vals::Nodiv::MASTER_CLOCK - }, - ); + w.set_mckdiv(config.master_clock_divider.mckdiv().into()); + w.set_nodiv(config.master_clock_divider == MasterClockDivider::MasterClockDisabled); w.set_dmaen(true); }); -- cgit