From 02c47b3a12feb0f80bf306feb917d3dede2a6f64 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Wed, 4 Dec 2024 05:43:11 +0100 Subject: [PATCH] Upgrade cargo_metadata to 0.19 --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- Cargo.toml | 4 ++-- src/workspace.rs | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 623e5f90..c3cd7d7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,7 +254,7 @@ dependencies = [ "serde_json", "similar", "strum", - "syn 2.0.46", + "syn 2.0.90", "tempfile", "test-log", "time", @@ -277,9 +277,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb9ac64500cc83ce4b9f8dafa78186aa008c8dea77a09b94cd307fd0cd5022a8" +checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ "camino", "cargo-platform", @@ -363,7 +363,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] @@ -390,7 +390,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.74" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1270,14 +1270,14 @@ checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -1351,7 +1351,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] @@ -1367,9 +1367,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.46" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1434,27 +1434,27 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] @@ -1562,7 +1562,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", ] [[package]] @@ -1674,7 +1674,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -1696,7 +1696,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 122ab44b..db9ab64b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ eula = false [dependencies] anyhow = "1.0.86" camino = "1.1.6" -cargo_metadata = "0.18" +cargo_metadata = "0.19" clap = { version = "4.4.1", features = [ "deprecated", "derive", @@ -47,7 +47,7 @@ patch = "0.7" path-slash = "0.2" quote = "1.0.35" regex = "1.10" -serde_json = "1.0.117" +serde_json = "1.0.118" similar = "2.1" strum = { version = "0.26", features = ["derive"] } tempfile = "3.8" diff --git a/src/workspace.rs b/src/workspace.rs index 62228ef8..ee1aef1f 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -22,7 +22,7 @@ use std::process::Command; use anyhow::{anyhow, bail, ensure, Context}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_metadata::Metadata; +use cargo_metadata::{Metadata, TargetKind}; use itertools::Itertools; use serde_json::Value; use tracing::{debug, debug_span, error, warn}; @@ -306,7 +306,17 @@ fn package_top_sources( fn should_mutate_target(target: &cargo_metadata::Target) -> bool { for kind in &target.kind { - if kind == "bin" || kind == "proc-macro" || kind.ends_with("lib") { + // bin / proc-macro / *lib + if matches!( + kind, + TargetKind::Bin + | TargetKind::ProcMacro + | TargetKind::CDyLib + | TargetKind::DyLib + | TargetKind::Lib + | TargetKind::RLib + | TargetKind::StaticLib + ) { return true; } }