Skip to content

Commit d5473e6

Browse files
authored
Add new zepter duplicate-deps check as part of CI (#9809)
# Description This PR builds on my previous [PR](#9233) and addresses feedback from Basti’s comment [here](#9283 (comment)). To prevent the same situation from recurring in the future, I’ve introduced a new **lint check** in **Zepter**, which is now also integrated into the CI workflow. The purpose of this check is to automatically detect and block cases where the same dependency is declared both under `[dependencies]` and `[dev-dependencies]`.
1 parent 9e06365 commit d5473e6

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

.config/zepter.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version:
22
format: 1
33
# Minimum version of the binary that is expected to work. This is just for printing a nice error
44
# message when someone tries to use an older version.
5-
binary: 1.78.0
5+
binary: 1.82.1
66

77
# The examples in this file assume crate `A` to have a dependency on crate `B`.
88
workflows:
@@ -13,21 +13,33 @@ workflows:
1313
'propagate-feature',
1414
# These are the features to check:
1515
'--features=try-runtime,runtime-benchmarks,std,bandersnatch-experimental',
16-
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
16+
# Do not try to add a new section into `[features]` of `A` only because `B` exposes that feature.
17+
# There are edge-cases where this is still needed, but we can add them manually.
1718
'--left-side-feature-missing=ignore',
18-
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
19+
# Ignore the case that `A` is outside of the workspace. Otherwise it will report errors
20+
# in external dependencies that we have no influence on.
1921
'--left-side-outside-workspace=ignore',
20-
# Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used.
22+
# Some features imply that they activate a specific dependency as non-optional.
23+
# Otherwise the default behaviour with a `?` is used.
2124
'--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking',
2225
# Do not propagate std feature from sp-wasm-interface down to wasmtime dependency.
2326
'--ignore-missing-propagate=sp-wasm-interface/std:wasmtime/std',
24-
# Auxillary flags:
27+
# Auxiliary flags:
2528
'--offline',
2629
'--locked',
2730
'--show-path',
2831
'--quiet',
2932
]
30-
# The umbrella crate uses more features, so we to check those too:
33+
- [
34+
'lint',
35+
# Check that dependencies are not duplicated between normal and dev sections.
36+
'duplicate-deps',
37+
'--offline',
38+
'--locked',
39+
'--quiet',
40+
]
41+
42+
# The umbrella crate uses more features, so we need to check those too:
3143
check_umbrella:
3244
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
3345
# Same as `check_*`, but with the `--fix` flag.
@@ -39,7 +51,7 @@ workflows:
3951
help:
4052
text: |
4153
Polkadot-SDK uses the Zepter CLI to detect abnormalities in the feature configuration.
42-
It looks like one more more checks failed; please check the console output. You can try to automatically address them by running `zepter`.
54+
It looks like one or more checks failed; please check the console output. You can try to automatically address them by running `zepter`.
4355
Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you.
4456
links:
4557
- "https://github.com/paritytech/polkadot-sdk/issues/1831"

.github/workflows/checks-quick.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: |
4949
cd substrate/
5050
../.gitlab/ensure-deps.sh
51-
check-rust-feature-propagation:
51+
check-zepter:
5252
runs-on: ubuntu-latest
5353
timeout-minutes: 20
5454
needs: [preflight]
@@ -62,7 +62,7 @@ jobs:
6262
time cargo metadata --format-version=1 --locked > /dev/null
6363
- name: Install newer Zepter
6464
run: |
65-
cargo install zepter@1.78.2 --locked -q
65+
cargo install zepter@1.82.1 --locked -q
6666
- name: run zepter
6767
run: |
6868
zepter --version
@@ -143,7 +143,7 @@ jobs:
143143
run: pip3 install "cargo-workspace>=1.2.4" toml
144144
- name: Install newer Zepter
145145
run: |
146-
cargo install zepter@1.78.2 --locked -q && zepter --version
146+
cargo install zepter@1.82.1 --locked -q && zepter --version
147147
- name: check umbrella correctness
148148
run: |
149149
# Fixes "detected dubious ownership" error in the ci
@@ -242,7 +242,7 @@ jobs:
242242
needs:
243243
- fmt
244244
- check-dependency-rules
245-
- check-rust-feature-propagation
245+
- check-zepter
246246
- test-rust-features
247247
- check-toml-format
248248
- check-workspace

substrate/bin/utils/chain-spec-builder/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ sp-tracing = { workspace = true, default-features = true }
3737

3838
[dev-dependencies]
3939
cmd_lib = { workspace = true }
40-
docify = { workspace = true }
4140
pretty_assertions = { workspace = true }
4241
substrate-test-runtime = { workspace = true }
4342

substrate/frame/staking-async/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ anyhow = { workspace = true }
4040
env_logger = { workspace = true }
4141
frame-benchmarking = { workspace = true, default-features = true }
4242
frame-support = { features = ["experimental"], workspace = true, default-features = true }
43-
log = { workspace = true }
4443
pallet-bags-list = { workspace = true, default-features = true }
4544
pallet-balances = { workspace = true, default-features = true }
4645
rand_chacha = { workspace = true, default-features = true }

0 commit comments

Comments
 (0)