Skip to content

bug: Windows MSVC lint fails in CLI SSH cancellation #4190

Description

@feloy

User Story

I maintain OpenShell PR #3775 and use the project's Windows MSVC CI to validate changes. After rebasing the PR onto main and running the test:windows checks, I directly encountered lint failures on both Windows architectures.

Problem Statement

The Windows MSVC PR lint and test jobs fail while linting openshell-cli at crates/openshell-cli/src/ssh.rs. Clippy reports one unnecessary Result return and two mutable references that are not used mutably on Windows. The lint task treats warnings as errors, so the Test step does not run.

The affected ssh.rs is identical in PR #3775 and its main base (71c3cd957abef062eb7f37010056717cd49f2ed3). The failure is therefore reproducible with current main source when the Windows jobs actually run.

Impact / Why This Matters

The test:windows check cannot validate current main based PRs on either Windows x64 or ARM64, and it provides no test result because lint fails first. Several recent Windows MSVC workflow runs appear green but skipped the lint and test jobs because their PRs lack the test:windows label. The other open labeled PRs with passing Windows jobs use older ssh.rs code.

Acceptance Criteria

  • Windows MSVC lint succeeds with warnings denied for the current CLI SSH cancellation code on x64 and ARM64.
  • The Windows MSVC Test step runs on both architectures for a labeled PR containing the fix.
  • Unix SSH cancellation and signal handling behavior remains intact.

Reproduction Steps

  1. Check out OpenShell PR refactor(providers)!: declare imported profile behavior safely #3775 at 1ac5b17f6370ad5391a3df9363495c9545325f6f (or its main base, which has the same ssh.rs).
  2. On the Windows x64 and ARM64 CI runners, run the repository's mise run --skip-tools windows:lint:x64 and mise run --skip-tools windows:lint:arm64 tasks, respectively.
  3. Observe the three Clippy errors in openshell-cli. In the CI run, both lint jobs fail and both Test steps are skipped.

Environment

  • OpenShell: PR refactor(providers)!: declare imported profile behavior safely #3775 head 1ac5b17f6370ad5391a3df9363495c9545325f6f; base 71c3cd957abef062eb7f37010056717cd49f2ed3
  • Rust: 1.95.0 (checked-in rust-toolchain.toml)
  • CI: Windows MSVC, windows-2025 x64 and windows-11-arm ARM64 runners
  • Deployment: not required; this is an OpenShell source checkout and CI lint failure

Logs

error: this function's return value is unnecessarily wrapped by `Result`
  --> crates/openshell-cli/src/ssh.rs:362:5
error: this parameter is a mutable reference but is not used mutably
  --> crates/openshell-cli/src/ssh.rs:369:25
error: this parameter is a mutable reference but is not used mutably
  --> crates/openshell-cli/src/ssh.rs:416:19
error: could not compile `openshell-cli` (lib) due to 3 previous errors

x64 CI job · ARM64 CI job

Investigation

On Windows, #[cfg(unix)] removes the TerminationSignals field and its signal-handling branches from ConnectCancellation. This leaves ConnectCancellation::new() infallible and the mutable references in wait and run_main_attach_supervised unused mutably. Recent green runs such as #3445 contain the same ssh.rs but skipped their Windows jobs at the workflow's test:windows gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions