Skip to content

Commit 6690a8c

Browse files
committed
fixup
1 parent bff5dfc commit 6690a8c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

hack/clippy-package-features.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ if [[ "$PACKAGE" == "hyperlight-host" ]]; then
2020
REQUIRED_FEATURES="kvm,mshv3"
2121
# Get all features for the package (excluding default and required features)
2222
features=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name == \"$PACKAGE\") | .features | keys[]" | grep -v -E "^(default|kvm|mshv3)$" || true)
23-
else
23+
elif [[ "$PACKAGE" == "hyperlight-guest-bin" ]]; then
24+
REQUIRED_FEATURES="printf"
25+
# Get all features for the package (excluding default and required features)
26+
features=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name == \"$PACKAGE\") | .features | keys[]" | grep -v -E "^(default|printf)$" || true)
27+
else
2428
REQUIRED_FEATURES=""
2529
# Get all features for the package (excluding default)
2630
features=$(cargo metadata --format-version 1 --no-deps | jq -r ".packages[] | select(.name == \"$PACKAGE\") | .features | keys[]" | grep -v "^default$" || true)
@@ -29,23 +33,23 @@ fi
2933
# Test with minimal features
3034
if [[ -n "$REQUIRED_FEATURES" ]]; then
3135
echo "Testing $PACKAGE with required features only ($REQUIRED_FEATURES)..."
32-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES" --profile="$PROFILE" -- -D warnings
36+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES" --profile="$PROFILE" -- -D warnings)
3337
else
3438
echo "Testing $PACKAGE with no features..."
35-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --profile="$PROFILE" -- -D warnings
39+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --profile="$PROFILE" -- -D warnings)
3640
fi
3741

3842
echo "Testing $PACKAGE with default features..."
39-
cargo clippy -p "$PACKAGE" --all-targets --profile="$PROFILE" -- -D warnings
43+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --profile="$PROFILE" -- -D warnings)
4044

4145
# Test each additional feature individually
4246
for feature in $features; do
4347
if [[ -n "$REQUIRED_FEATURES" ]]; then
4448
echo "Testing $PACKAGE with feature: $REQUIRED_FEATURES,$feature"
45-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES,$feature" --profile="$PROFILE" -- -D warnings || echo "Feature $feature failed for $PACKAGE"
49+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES,$feature" --profile="$PROFILE" -- -D warnings || echo "Feature $feature failed for $PACKAGE")
4650
else
4751
echo "Testing $PACKAGE with feature: $feature"
48-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$feature" --profile="$PROFILE" -- -D warnings || echo "Feature $feature failed for $PACKAGE"
52+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$feature" --profile="$PROFILE" -- -D warnings || echo "Feature $feature failed for $PACKAGE")
4953
fi
5054
done
5155

@@ -54,9 +58,9 @@ if [[ -n "$features" ]]; then
5458
all_features=$(echo $features | tr '\n' ',' | sed 's/,$//')
5559
if [[ -n "$REQUIRED_FEATURES" ]]; then
5660
echo "Testing $PACKAGE with all features: $REQUIRED_FEATURES,$all_features"
57-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES,$all_features" --profile="$PROFILE" -- -D warnings || echo "All features failed for $PACKAGE"
61+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$REQUIRED_FEATURES,$all_features" --profile="$PROFILE" -- -D warnings || echo "All features failed for $PACKAGE")
5862
else
5963
echo "Testing $PACKAGE with all features: $all_features"
60-
cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$all_features" --profile="$PROFILE" -- -D warnings || echo "All features failed for $PACKAGE"
64+
(set -x; cargo clippy -p "$PACKAGE" --all-targets --no-default-features --features "$all_features" --profile="$PROFILE" -- -D warnings || echo "All features failed for $PACKAGE")
6165
fi
6266
fi

0 commit comments

Comments
 (0)