Skip to content

[Enhancement✨] Gate CommitLog prefetch import for Linux clippy #7761

Description

@mxsm

Current Behavior

PR #7760 (build(deps): bump indicatif from 0.18.5 to 0.18.6) fails the GitHub Actions RocketMQ Rust CI / Check (fmt + clippy) job.

The failing command is:

cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings

The CI log reports an unused import in rocketmq-store/src/log_file/commit_log_loader.rs:

error: unused import: `crate::utils::ffi::prefetch_virtual_memory`
  --> rocketmq-store/src/log_file/commit_log_loader.rs:38:5
  = note: `-D unused-imports` implied by `-D warnings`

The import is only needed by the Windows PrefetchVirtualMemory path, while the failing CI job runs on Linux.

Proposed Enhancement

Gate the prefetch_virtual_memory import with the same Windows-only cfg boundary as the call site in CommitLogLoader::apply_file_prefetch.

This keeps the Windows recovery file prefetch behavior intact while preventing Linux/Unix clippy from seeing an unused Windows-only import.

Benefits

  • Restores the root workspace clippy gate for Linux CI.
  • Keeps the CommitLog recovery prefetch implementation platform-specific and explicit.
  • Unblocks dependency update PRs such as build(deps): bump indicatif from 0.18.5 to 0.18.6 #7760 that otherwise fail on unrelated lint noise.

Additional Context

Observed failing job: https://github.com/mxsm/rocketmq-rust/actions/runs/28551274313/job/84648782240?pr=7760

Local validation performed for the fix:

cargo fmt --all
cargo clippy -p rocketmq-store --no-deps --all-targets --all-features -- -D warnings
cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings

An additional Linux target clippy attempt was blocked locally by the missing x86_64-linux-gnu-gcc cross compiler required by native build dependencies.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions