Skip to content

Commit

Permalink
Merge pull request #92 from paritytech/bkchr-ignore-dev-and-build-deps
Browse files Browse the repository at this point in the history
Ingore dev and build dependencies in feature checking
  • Loading branch information
bkchr authored Dec 12, 2022
2 parents 9abda8d + c7d53a0 commit 86c3c22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust-features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function feature_does_not_imply() {
echo "📏 Checking that $ENABLED does not imply $STAYS_DISABLED ..."

# Check if the forbidden feature is enabled anywhere in the workspace.
if cargo tree --no-default-features --locked --workspace -e features --features "$ENABLED" | grep -qF "feature \"$STAYS_DISABLED\""; then
# But only check "normal" dependencies, so no "dev" or "build" dependencies.
if cargo tree --no-default-features --locked --workspace -e features,normal --features "$ENABLED" | grep -qF "feature \"$STAYS_DISABLED\""; then
echo "$ENABLED implies $STAYS_DISABLED in the workspace"
else
echo "$ENABLED does not imply $STAYS_DISABLED in the workspace"
Expand All @@ -61,7 +62,7 @@ function feature_does_not_imply() {
echo "🔍 Checking all $NUM_CRATES crates - this takes some time."

for CARGO in $CARGOS; do
OUTPUT=$(cargo tree --no-default-features --locked --offline -e features --features $ENABLED --manifest-path $CARGO 2>&1 || true)
OUTPUT=$(cargo tree --no-default-features --locked --offline -e features,normal --features $ENABLED --manifest-path $CARGO 2>&1 || true)

if echo "$OUTPUT" | grep -qF "not supported for packages in this workspace"; then
# This case just means that the pallet does not support the
Expand Down

0 comments on commit 86c3c22

Please sign in to comment.