diff --git a/Cargo.toml b/Cargo.toml index 2361ffe3..a78f2fa3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ async-io = { version = "2.0", default-features = false } bindgen = { version = "0.70", default-features = false } bitflags = { version = "2.2.1", default-features = false } bytes = { version = "1", default-features = false } -cargo_metadata = { version = "0.18.0", default-features = false } +cargo_metadata = { version = "0.19.0", default-features = false } clap = { version = "4", default-features = false } const-assert = { version = "1.0.1", default-features = false } dialoguer = { version = "0.11", default-features = false } @@ -82,7 +82,7 @@ object = { version = "0.36", default-features = false } once_cell = { version = "1.20.1", default-features = false } proc-macro-error = { version = "1.0", default-features = false } proc-macro2 = { version = "1", default-features = false } -public-api = { version = "0.41.0", default-features = false } +public-api = { version = "0.42.0", default-features = false } quote = { version = "1", default-features = false } rand = { version = "0.8", default-features = false } rbpf = { version = "0.3.0", default-features = false } diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index dfa78789..c019b4fc 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -8,7 +8,7 @@ use std::{ }; use cargo_metadata::{ - Artifact, CompilerMessage, Message, Metadata, MetadataCommand, Package, Target, + Artifact, CompilerMessage, Message, Metadata, MetadataCommand, Package, Target, TargetKind, }; use xtask::{exec, AYA_BUILD_INTEGRATION_BPF, LIBBPF_DIR}; @@ -281,7 +281,7 @@ fn main() { let Package { targets, .. } = integration_ebpf_package; for Target { name, kind, .. } in targets { - if *kind != ["bin"] { + if *kind != [TargetKind::Bin] { continue; } let dst = out_dir.join(name); diff --git a/xtask/src/public_api.rs b/xtask/src/public_api.rs index ac11ee18..8fec2bc6 100644 --- a/xtask/src/public_api.rs +++ b/xtask/src/public_api.rs @@ -56,16 +56,13 @@ pub fn public_api(options: Options, metadata: Metadata) -> Result<()> { if matches!(publish, Some(publish) if publish.is_empty()) { Ok(()) } else { - let target = target.as_ref().and_then(|target| { - let proc_macro = targets.iter().any(|Target { kind, .. }| { - kind.iter().any(|kind| kind == "proc-macro") - }); - (!proc_macro).then_some(target) - }); + let target = (!targets.iter().any(Target::is_proc_macro)) + .then(|| target.clone()) + .flatten(); let diff = check_package_api( &name, toolchain, - target.cloned(), + target, bless, workspace_root.as_std_path(), )