Skip to content

Commit 26fe7ad

Browse files
authored
ci: check all features with Clippy (apache#26591)
## Which issue does this PR close? Related to apache#26181 and the [CI follow-up requested in apache#26189](apache#26189 (comment)). ## Rationale for this change The existing Clippy feature set missed the Arrow buffer-pool lint failures exposed by `--all-features`. Run both configurations through the shared script so CI, local developers, and agents get the same checks. Keep the existing feature set: `force_hash_collisions` excludes normal hashing code when all features are enabled. ## What changes are included in this PR? - Run the existing feature-specific check followed by the all-features check in `ci/scripts/rust_clippy.sh`. - Apply `--write` and `--allow-dirty` consistently to both passes, retaining the clean-worktree guard and failure propagation. - Install CMake before invoking the script in CI, because the all-features build includes `snmalloc-sys`. ## What is the testing strategy for this PR? - `cargo fmt --all` and `git diff --check` pass. - Both Clippy passes in `ci/scripts/rust_clippy.sh` pass, as does `cargo clippy --all-targets --all-features -- -D warnings`. - The full `uv run ./dev/rust_lint.sh` suite passes, including the workflow validators and 28 workflow tests. - Ten shell behavior probes cover both configurations, write mode, the dirty-worktree guard, and failure propagation. A disposable Rust crate also verifies real fixes in both feature configurations, rejection of an initially dirty worktree, and `--allow-dirty` support. - The required extended workspace test command passes: 12,899 Rust tests and all 541 SQL logic test files; eight Rust tests are ignored. All validation above was run locally. Hosted CI must rerun for the updated head. ## Are there any user-facing changes? Local `rust_clippy.sh` and `dev/rust_lint.sh` runs now check both feature configurations. The all-features build requires CMake to be installed locally. No SQL behavior or public API changes.
1 parent 1e6017c commit 26fe7ad

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎.github/workflows/rust.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,9 @@ jobs:
835835
with:
836836
save-if: ${{ github.ref_name == 'main' }}
837837
shared-key: "amd-ci-clippy"
838+
- name: Install CMake
839+
# The all-features check builds snmalloc-sys, which requires CMake.
840+
run: apt-get install -y --no-install-recommends cmake
838841
- name: Run clippy
839842
run: ci/scripts/rust_clippy.sh
840843

‎ci/scripts/rust_clippy.sh‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -euo pipefail
2222
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2323
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
2424
CLIPPY_FEATURES="avro,integration-tests,extended_tests"
25-
CLIPPY_ARGS=(--all-targets --workspace --features "$CLIPPY_FEATURES")
25+
CLIPPY_ARGS=(--all-targets --workspace)
2626
CLIPPY_LINT_ARGS=(-- -D warnings)
2727

2828
source "${SCRIPT_DIR}/utils/git.sh"
@@ -34,7 +34,7 @@ usage() {
3434
cat >&2 <<EOF
3535
Usage: $SCRIPT_NAME [--write] [--allow-dirty]
3636
37-
Runs \`cargo clippy\` to lint.
37+
Runs \`cargo clippy\` with the standard feature set and with all features.
3838
--write Run \`cargo clippy --fix\` to apply fixes for clippy lints (requires a clean git worktree, no uncommitted changes).
3939
--allow-dirty Allow \`--write\` to run even when the git worktree has uncommitted or staged changes.
4040
EOF
@@ -65,12 +65,14 @@ fi
6565

6666
CLIPPY_CMD=(cargo clippy)
6767
if [[ "$MODE" == "write" ]]; then
68-
CLIPPY_CMD+=(--fix)
69-
if [[ $ALLOW_DIRTY -eq 1 ]]; then
70-
CLIPPY_CMD+=(--allow-dirty --allow-staged)
71-
fi
68+
CLIPPY_CMD+=(--fix --allow-dirty --allow-staged)
7269
fi
73-
CLIPPY_CMD+=("${CLIPPY_ARGS[@]}" "${CLIPPY_LINT_ARGS[@]}")
7470

75-
echo "[${SCRIPT_NAME}] \`${CLIPPY_CMD[*]}\`"
76-
"${CLIPPY_CMD[@]}"
71+
run_clippy() {
72+
local clippy_cmd=("${CLIPPY_CMD[@]}" "${CLIPPY_ARGS[@]}" "$@" "${CLIPPY_LINT_ARGS[@]}")
73+
echo "[${SCRIPT_NAME}] \`${clippy_cmd[*]}\`"
74+
"${clippy_cmd[@]}"
75+
}
76+
77+
run_clippy --features "$CLIPPY_FEATURES"
78+
run_clippy --all-features

0 commit comments

Comments
 (0)