From 4a6a28065fc913083b8c64af920601b527154853 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Fri, 21 Jun 2024 21:09:24 +0000 Subject: [PATCH] check for bin target collisions in CI --- dev-tools/xtask/src/check_workspace_deps.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dev-tools/xtask/src/check_workspace_deps.rs b/dev-tools/xtask/src/check_workspace_deps.rs index 94de557a46..73d5643ffb 100644 --- a/dev-tools/xtask/src/check_workspace_deps.rs +++ b/dev-tools/xtask/src/check_workspace_deps.rs @@ -146,6 +146,23 @@ pub fn run_cmd() -> Result<()> { } } + let mut seen_bins = BTreeSet::new(); + for package in &workspace.packages { + if workspace.workspace_members.contains(&package.id) { + for target in &package.targets { + if target.is_bin() { + if !seen_bins.insert(&target.name) { + eprintln!( + "error: bin target {:?} seen multiple times", + target.name + ); + nerrors += 1; + } + } + } + } + } + eprintln!( "check-workspace-deps: errors: {}, warnings: {}", nerrors, nwarnings