From ea139050cfae61ae274cc932612a43044c84e2ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:12:02 +0000 Subject: [PATCH 1/2] build(deps): bump the cargo-crates group with 2 updates Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) and [public-api](https://github.com/cargo-public-api/cargo-public-api) to permit the latest version. Updates `cargo_metadata` to 0.18.1 - [Release notes](https://github.com/oli-obk/cargo_metadata/releases) - [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md) - [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.18.0...0.18.1) Updates `public-api` to 0.41.0 - [Release notes](https://github.com/cargo-public-api/cargo-public-api/releases) - [Changelog](https://github.com/cargo-public-api/cargo-public-api/blob/main/CHANGELOG.md) - [Commits](https://github.com/cargo-public-api/cargo-public-api/compare/public-api-v0.41.0...public-api-v0.41.0) --- updated-dependencies: - dependency-name: cargo_metadata dependency-type: direct:production dependency-group: cargo-crates - dependency-name: public-api dependency-type: direct:production dependency-group: cargo-crates ... Signed-off-by: dependabot[bot] --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } From 5ab67dce0881690b705eed2e010bcc0fae169122 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 26 Nov 2024 11:47:41 -0500 Subject: [PATCH 2/2] Use TargetKind enum and Target::is_proc_macro These are added in cargo_metadata 0.19.0. --- test/integration-test/build.rs | 4 ++-- xtask/src/public_api.rs | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) 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(), )