Skip to content

feat(cli): build the user CLI for Windows x64 and ARM64 - #2146

Merged
alpergundogdu merged 2 commits into
mainfrom
feat/windows-client
Sep 24, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
feat/windows-client

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

The walletless on-ramp (decdn/sponsord#6) installs decdn.exe on Windows at launch, on x64 and ARM64. CI only ever built for Linux, and the CLI didn't compile for Windows: decdn-common probed free disk space with the Unix-only nix::sys::statvfs.

  • common/disk.rs: free-space probing goes through fs4 (statvfs on Unix, GetDiskFreeSpaceExW on Windows). The workspace forbids unsafe, so a safe wrapper beats hand-written FFI. fs4 builds on rustix/windows-sys, which are already in the tree. cargo deny and the crate-edges check are clean.
  • common/identity.rs, incentive/eth_identity.rs: the Windows placeholder functions return Ok(()) to match their fallible Unix variants. They get a scoped #[allow] with a reason. The Unix-only std::io::Read import moves into the Unix function that uses it.
  • cli/Cargo.toml: rexpect becomes a cfg(unix) dev-dependency. The pty test that uses it was already #![cfg(unix)].
  • CI: a new windows job, gated like the other Rust jobs and wired into CI success. It runs cargo clippy -p decdn-cli -D warnings for x86_64-pc-windows-msvc and aarch64-pc-windows-msvc. The x64 leg smoke-runs the built decdn.exe through --version, key-gen, and whoami, and checks both report the same address. Test suites stay Linux-only: several drive POSIX-only surfaces (ptys, mode bits).
  • Release: the CLI also ships for aarch64-pc-windows-msvc, cross-compiled on the x64 runner. EXPECTED_ARCHIVES goes 10 → 11 and RELEASING.md is updated to match.

Test plan

  • cross check/cross clippy -p decdn-cli -D warnings for x86_64-pc-windows-gnu (mingw): clean
  • decdn.exe built with cross and run under Wine: key-gen writes C:\decdn-smoke\keystore.json, and whoami reports the same address
  • Native: cargo clippy -p decdn-common -p decdn-incentive -p decdn-cli --all-targets -D warnings, cargo nextest run -p decdn-common -p decdn-incentive (718 passed), cargo deny check, crate edges, all pre-commit hooks
  • The new windows CI job on real MSVC runners (x64 + ARM64). This is the authoritative check.

🤖 Generated with Claude Code

The walletless on-ramp installs `decdn.exe` on Windows, and CI only ever
built for Linux, so the CLI did not compile there.

- common: probe free disk space through `fs4` (`statvfs` on Unix,
  `GetDiskFreeSpaceExW` on Windows) instead of the Unix-only `nix`.
- common, incentive: scope the lints the Windows placeholder functions
  trip, and the Unix-only `std::io::Read` import, to the Unix build.
- cli: `rexpect` (pty tests, already `cfg(unix)`) is a Unix-only
  dev-dependency.
- ci: a `windows` job lints `decdn-cli` for x86_64- and
  aarch64-pc-windows-msvc and smoke-runs the x64 binary through
  `key-gen` and `whoami`.
- release: ship the CLI for aarch64-pc-windows-msvc as well (eleven
  archives).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 24, 2026 14:57
@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@github-code-quality

github-code-quality Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit db9996a in the feat/windows-client branch remains at 85%, unchanged from commit 9a4de88 in the main branch.

Show a line coverage summary of the most impacted files.
File main 9a4de88 feat/windows-client db9996a +/-
crates/client/src/streamer.rs 92% 91% -1%
crates/incentiv...eth_identity.rs 99% 98% -1%
crates/common/src/disk.rs 97% 96% -1%
crates/cache/src/origin/mod.rs 60% 65% +5%

Solidity / code-coverage/forge

The overall line coverage in commit db9996a in the feat/windows-client branch remains at 92%, unchanged from commit 9a4de88 in the main branch.


Updated September 24, 2026 15:17 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A few inconsistencies introduced in the updated code/docs (dependency versioning convention, misleading API naming, and comment/lint-suppression clarity) should be cleaned up before merge.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 Low severity

Open (4)
What changed in this PR

This PR makes the decdn user CLI buildable (and clippy-clean) on Windows for both x64 and ARM64, and wires that support into CI and release packaging so the walletless on-ramp can install decdn.exe on Windows reliably.

Changes:

  • Replace Unix-only free-disk probing with a cross-platform fs4 implementation (statvfs on Unix, GetDiskFreeSpaceExW on Windows).
  • Adjust Unix-only identity/keystore permission helpers and CLI dev-dependencies to compile cleanly on Windows.
  • Add a Windows CI job (x64 + ARM64) and extend release artifacts to include Windows ARM64 for the CLI; update release docs accordingly.
File Description
RELEASING.md Updates documentation to reflect the additional Windows ARM64 CLI archive.
crates/​incentive/​src/​eth_identity.rs Makes Windows stubs fallible like Unix variants; scopes Unix-only imports.
crates/​common/​src/​identity.rs Makes Windows validation stubs return anyhow::Result<()> for signature parity.
crates/​common/​src/​disk.rs Switches disk free-space probing to cross-platform fs4.
crates/​common/​Cargo.toml Adds fs4 dependency for the common crate.
crates/​cli/​Cargo.toml Gates rexpect dev-dependency to Unix since the pty test is Unix-only.
Cargo.lock Locks fs4 and related transitive dependency updates.
.github/​workflows/​release.yml Adds Windows ARM64 CLI artifact and updates expected archive count.
.github/​workflows/​ci.yml Adds Windows CI job and wires it into the branch-protection gate job.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml Resolved
Comment thread crates/common/Cargo.toml Resolved
Comment thread crates/common/src/identity.rs Resolved
Comment thread crates/incentive/src/eth_identity.rs Resolved
- ci: the branch-protection comment sits above `ci-success` again.
- fs4 is a workspace dependency, like the rest.
- Split the Windows-stub lint allows so each carries its own reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alpergundogdu
alpergundogdu merged commit ae78859 into main Sep 24, 2026
32 checks passed
@alpergundogdu
alpergundogdu deleted the feat/windows-client branch September 24, 2026 15:25
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.

2 participants