From 3fcd13625aea072ef9673c9f0a774785c1c2f95d Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 26 Jan 2024 13:31:59 +0100 Subject: [PATCH 1/3] Error on duplicate crates Signed-off-by: Oliver Tale-Yazdi --- .github/scripts/check-workspace.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/check-workspace.py b/.github/scripts/check-workspace.py index fb3b53acb0c56..d200122fee9f7 100644 --- a/.github/scripts/check-workspace.py +++ b/.github/scripts/check-workspace.py @@ -27,6 +27,7 @@ def main(root, exclude): all_crates = get_crates(root, exclude) print(f'📦 Found {len(all_crates)} crates in total') + check_duplicates(workspace_crates) check_missing(workspace_crates, all_crates) check_links(all_crates) @@ -89,6 +90,16 @@ def get_crates(workspace_dir, exclude_crates) -> dict: return crates +# Check that there are no duplicate entries in the workspace. +def check_duplicates(workspace_crates): + print(f'🔎 Checking for duplicate crates') + found = {} + for path in workspace_crates: + if path in found: + print(f'❌ crate is listed twice in the workspace {path}') + sys.exit(1) + found[path] = True + # Check that all crates are in the workspace. def check_missing(workspace_crates, all_crates): print(f'🔎 Checking for missing crates') From 8081ce0509ed8e368a89497504258032bb15bc32 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 26 Jan 2024 13:32:21 +0100 Subject: [PATCH 2/3] Remove duplicate Signed-off-by: Oliver Tale-Yazdi --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1edc64217fdfc..20cc16039fe48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -159,7 +159,6 @@ members = [ "polkadot/node/gum/proc-macro", "polkadot/node/jaeger", "polkadot/node/malus", - "polkadot/node/subsystem-bench", "polkadot/node/metrics", "polkadot/node/network/approval-distribution", "polkadot/node/network/availability-distribution", From cb5942f8eba99517e68df6713d4ca2ad6619e996 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 26 Jan 2024 22:29:24 +0100 Subject: [PATCH 3/3] Remove duplicate Signed-off-by: Oliver Tale-Yazdi --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fd8708a3daddc..20cc16039fe48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -175,7 +175,6 @@ members = [ "polkadot/node/service", "polkadot/node/subsystem", "polkadot/node/subsystem-bench", - "polkadot/node/subsystem-bench", "polkadot/node/subsystem-test-helpers", "polkadot/node/subsystem-types", "polkadot/node/subsystem-util",