mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-30 05:40:55 +00:00
fix: use patched versions
This commit is contained in:
parent
0d8f9614a1
commit
1f229f745c
@ -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
|
||||
|
@ -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<I, K, V>(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result<String>
|
||||
where
|
||||
@ -166,25 +152,6 @@ impl CargoArgsBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn args<S>(mut self, args: &[S]) -> Self
|
||||
where
|
||||
S: Clone + Into<String>,
|
||||
{
|
||||
for arg in args {
|
||||
self.args.push(arg.clone().into());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_arg<S>(&mut self, arg: S) -> &mut Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.args.push(arg.into());
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn build(&self) -> Vec<String> {
|
||||
let mut args = vec![];
|
||||
|
@ -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};
|
||||
|
@ -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<ReleaseType, anyhow::Error> {
|
||||
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<ReleaseType, anyhow::Error> {
|
||||
}
|
||||
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() {
|
||||
|
@ -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)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user