Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Jan 29, 2026

Summary

This PR adds comprehensive Windows support to usage by:

  1. Adding Windows build targets to releases (resolves Windows binaries missing from github releases #470)
  2. Fixing shell completions on Windows (resolves complete-word not working on windows #471)

Changes

1. Windows Binary Distribution

Added two Windows build targets to .github/workflows/publish-cli.yml:

  • x86_64-pc-windows-msvc - 64-bit Intel/AMD Windows with MSVC toolchain
  • aarch64-pc-windows-msvc - ARM64 Windows (Surface Pro X, etc.) with MSVC toolchain

Both targets:

  • Use windows-latest GitHub runners for native compilation
  • Use cargo as the build tool (not cross)
  • Produce .zip archives automatically via taiki-e/upload-rust-binary-action

This follows the proven pattern from hk, pitchfork, and fnox repositories.

2. Cross-Platform Shell Invocation

Updated lib/src/sh.rs to use platform-specific shell commands:

  • Unix: sh -c (existing behavior, unchanged)
  • Windows: cmd /c (new, fixes completions)

Used conditional compilation (#[cfg(unix)] and #[cfg(windows)]) for clean separation.

Why cmd.exe and not PowerShell?

  • Universally available on all Windows versions
  • More reliable for basic script execution
  • Simpler syntax, no PATH concerns
  • Matches patterns used by most cross-platform Rust tools

Testing

✅ All tests pass on Linux (GitHub Actions will verify Windows builds)
✅ Cargo build successful
✅ No breaking changes to existing Unix behavior

Impact

After merging and the next release:

Release Notes

Windows support! This release adds:

  • Pre-built Windows binaries (x86_64 and ARM64) to GitHub releases
  • Working shell completions on Windows using cmd.exe

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]


Note

Medium Risk
Moderate risk because it changes the release pipeline matrix to produce Windows artifacts and alters how scripts are executed on Windows, which could affect packaging/command behavior there.

Overview
Adds native Windows builds to the release workflow by extending publish-cli.yml to compile and upload x86_64-pc-windows-msvc and aarch64-pc-windows-msvc artifacts using cargo on windows-latest runners.

Updates lib/src/sh.rs to invoke the platform-appropriate shell (sh -c on Unix, cmd /c on Windows) and adjusts error messages accordingly, improving Windows compatibility for any features that run shell scripts (e.g., completion generation).

Written by Cursor Bugbot for commit 2d61309. This will update automatically on new commits. Configure here.

Add Windows build targets (x86_64 and ARM64) to the release workflow
and fix shell invocation to use cmd.exe on Windows instead of sh.

This change addresses two GitHub issues:
- #470: Windows binaries missing from releases
- #471: complete-word not working on Windows

Changes:
- Add x86_64-pc-windows-msvc and aarch64-pc-windows-msvc build targets
  to publish-cli.yml workflow
- Update lib/src/sh.rs to use platform-specific shell invocation:
  - Unix: sh -c (existing behavior)
  - Windows: cmd /c (new)

Windows binaries will now be automatically built and published as .zip
archives in GitHub releases, and completions will work properly on
Windows using cmd.exe.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings January 29, 2026 11:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive Windows support by enabling pre-built Windows binaries in releases and fixing shell completions to work on Windows.

Changes:

  • Added Windows build targets (x86_64 and ARM64) to the GitHub Actions release workflow
  • Updated shell invocation to use platform-specific commands (cmd /c on Windows, sh -c on Unix)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/publish-cli.yml Adds x86_64 and ARM64 Windows build targets to release workflow
lib/src/sh.rs Implements conditional compilation for platform-specific shell invocation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.57%. Comparing base (46e90b4) to head (2d61309).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/sh.rs 0.00% 5 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
- Coverage   70.73%   70.57%   -0.16%     
==========================================
  Files          47       47              
  Lines        6591     6597       +6     
  Branches     6591     6597       +6     
==========================================
- Hits         4662     4656       -6     
- Misses       1259     1264       +5     
- Partials      670      677       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdx jdx merged commit be3e588 into main Jan 29, 2026
12 checks passed
@jdx jdx deleted the feat/windows-support branch January 29, 2026 12:01
jdx pushed a commit that referenced this pull request Jan 29, 2026
### 🚀 Features

- **(windows)** add Windows binaries and fix completion support by
[@jdx](https://github.com/jdx) in
[#472](#472)
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 2, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [usage](https://github.com/jdx/usage) | minor | `2.15.1` → `2.16.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jdx/usage (usage)</summary>

### [`v2.16.1`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2161---2026-01-31)

[Compare Source](jdx/usage@v2.16.0...v2.16.1)

##### 🐛 Bug Fixes

- **(docs)** increase gap between feature grid and action buttons on landing page by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;482](jdx/usage#482)
- **(parse)** handle variadic ellipsis inside brackets like \[args...] by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;481](jdx/usage#481)

##### 📚 Documentation

- add bash array pattern for variadic args by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;480](jdx/usage#480)

##### 📦️ Dependency Updates

- update rust crate clap to v4.5.56 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;474](jdx/usage#474)
- update apple-actions/import-codesign-certs action to v6 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;477](jdx/usage#477)
- update dependency node to v24 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;478](jdx/usage#478)
- update rust crate criterion to 0.8 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;475](jdx/usage#475)

### [`v2.16.0`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2160---2026-01-29)

[Compare Source](jdx/usage@v2.15.1...v2.16.0)

##### 🚀 Features

- **(windows)** add Windows binaries and fix completion support by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;472](jdx/usage#472)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45NC42IiwidXBkYXRlZEluVmVyIjoiNDIuOTUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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.

complete-word not working on windows Windows binaries missing from github releases

2 participants