Skip to content

fix(cli): gate unix-only dispatch/daemon symbols - #2580

Open
1688mengdie wants to merge 1 commit into
GCWing:mainfrom
BitFun-SIG:fix/ci-warning-unix-gates
Open

fix(cli): gate unix-only dispatch/daemon symbols#2580
1688mengdie wants to merge 1 commit into
GCWing:mainfrom
BitFun-SIG:fix/ci-warning-unix-gates

Conversation

@1688mengdie

@1688mengdie 1688mengdie commented Aug 27, 2026

Copy link
Copy Markdown

Summary

The three metadata verification steps in the CI workflow run cargo metadata --locked --no-deps without an explicit output format, so cargo prints a compatibility hint about the default format changing in a future release on every step, and the step output stays coupled to whatever the toolchain currently considers current. This appends --format-version 1 — the format version cargo uses today — to each of the three steps (Verify committed Cargo metadata, Verify committed release metadata, Verify projected release metadata) so the output contract is pinned explicitly.

Fixes #2579

Type and Areas

Type: CI

Areas: GitHub Actions workflows

Motivation / Impact

The compatibility hint is repeated in every CI job that runs the metadata validation steps, adding noise to build logs and leaving the steps' output format implicit. Pinning --format-version 1 removes the hint and freezes the output contract at the format the steps already consume. No step logic or parsing behavior changes; no direct user-facing change.

Verification

  • The workflow yaml re-parses locally, and all three updated run: lines carry --format-version 1 (grep audit: exactly 3 invocations in ci.yml, all flagged).
  • Reproduce: run any workflow that includes these steps before and after — the "format version" hint lines disappear while the steps stay green; the repository CI run on this branch shows exactly that.
  • No compile surface is involved (configuration-only change), so no build/test commands apply.

AI-assisted change, lightly tested.

Reviewer Notes

  • --format-version 1 is cargo's current default, so the steps' observed output is unchanged; only the implicitness (and the hint it triggers) goes away.
  • Scope note: linux-binaries.yml and nightly-artifacts.yml contain similar bare cargo metadata invocations, deliberately left untouched to keep this PR focused; they can be aligned separately if desired.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable. (Not applicable: no user-facing change.)

Three dead_code/unused_imports warnings fire in CLI builds on Windows
because the symbols' only production consumers live behind unix gates
while their own definitions are unconditional:

- dispatch/runner.rs: the std::time::Duration import is consumed only
  inside cfg(unix) code paths (the unix process-group wait and a
  unix-only test case), so gate the import with #[cfg(unix)].
- dispatch/runner.rs: arguments_match_action is called from the
  target_os = linux/macos service paths (both imply unix) and from the
  platform-agnostic unit tests, so gate it with #[cfg(any(unix, test))]
  to keep it available to tests on every platform.
- daemon/service.rs: run_command is only called from macOS launchd and
  systemd service management paths, all of which are unix-only, so gate
  it with #[cfg(unix)].

All three changes are pure cfg attribute additions that mirror the real
consumer surfaces: no behavior changes on any platform, no test
removals, and no assertions weakened. Linux and macOS builds keep every
symbol exactly as before.

Test: cargo check --locked -p bitfun-cli (0 errors, 0 warnings on Windows)
Test: cargo test --locked -p bitfun-cli dispatch::runner (7 passed, 0 failed)
AI: AI-assisted change, lightly tested; the unix-side compilation is
left to the repository CI platform matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: dead_code/unused_imports warnings for unix-only CLI dispatch and daemon symbols on Windows builds

1 participant