From 8a0120123896f8ee81eb34193a31373737fcec71 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 20 Sep 2025 10:21:06 +0200 Subject: [PATCH 1/2] Bump to cargo 0.91 --- Cargo.toml | 6 +++--- src/build.rs | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3e2dd95..ee29408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-c" -version = "0.10.15+cargo-0.90.0" +version = "0.10.16+cargo-0.91.0" authors = ["Luca Barbato "] description = "Helper program to build and install c-like libraries" license = "MIT" @@ -9,7 +9,7 @@ readme = "README.md" repository = "https://github.com/lu-zero/cargo-c" categories = ["command-line-utilities", "development-tools::cargo-plugins"] keywords = ["cargo", "cdylib"] -rust-version = "1.87" +rust-version = "1.88" [[bin]] name = "cargo-capi" @@ -28,7 +28,7 @@ name = "cargo-ctest" path = "src/bin/ctest.rs" [dependencies] -cargo = "0.90.0" +cargo = "0.91.0" cargo-util = "0.2" semver = "1.0.3" log = "0.4" diff --git a/src/build.rs b/src/build.rs index 48a726b..dee19b9 100644 --- a/src/build.rs +++ b/src/build.rs @@ -939,7 +939,7 @@ fn compile_with_exec( .iter() .filter_map(|l| { let id = l.unit.pkg.package_id(); - if let Some(ref m) = l.script_meta { + l.script_metas.iter().flatten().find_map(|m| { if let Some(env) = r.extra_env.get(m) { env.iter().find_map(|e| { if e.0 == "OUT_DIR" { @@ -951,9 +951,7 @@ fn compile_with_exec( } else { None } - } else { - None - } + }) }) .collect(); From 752a3bdb78b3e130d1716a80e8669acb2abe9015 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 20 Sep 2025 10:23:23 +0200 Subject: [PATCH 2/2] Bump toml to 0.9 --- Cargo.toml | 2 +- src/build.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee29408..d7118b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ log = "0.4" clap = { version = "4.5.18", features = ["color", "derive", "cargo", "string", "wrap_help"] } regex = "1.5.6" cbindgen = { version="0.29.0", default-features=false } -toml = "0.8" +toml = "0.9" serde = "1.0.123" serde_derive = "1.0" serde_json = "1.0.62" diff --git a/src/build.rs b/src/build.rs index dee19b9..1adea0c 100644 --- a/src/build.rs +++ b/src/build.rs @@ -308,7 +308,7 @@ impl FingerPrint { let mut f = open(self.path())?; let mut cache_str = String::new(); f.read_to_string(&mut cache_str)?; - let cache = toml::de::from_str(&cache_str)?; + let cache = toml::from_str(&cache_str)?; Ok(cache) } @@ -326,7 +326,7 @@ impl FingerPrint { hash, static_libs: self.static_libs.to_owned(), }; - let buf = toml::ser::to_string(&cache)?; + let buf = toml::to_string(&cache)?; write(self.path(), buf)?; } @@ -486,7 +486,7 @@ fn load_manifest_capi_config( .crate_name(); let root_path = pkg.root().to_path_buf(); let manifest_str = read(&root_path.join("Cargo.toml"))?; - let toml = manifest_str.parse::()?; + let toml = manifest_str.parse::()?; let capi = toml .get("package")