Skip to content

fix(mvdan/sh): add Windows .exe override for shfmt#52150

Closed
zeitlinger wants to merge 2 commits intoaquaproj:mainfrom
zeitlinger:fix/shfmt-windows-exe
Closed

fix(mvdan/sh): add Windows .exe override for shfmt#52150
zeitlinger wants to merge 2 commits intoaquaproj:mainfrom
zeitlinger:fix/shfmt-windows-exe

Conversation

@zeitlinger
Copy link
Copy Markdown
Contributor

@zeitlinger zeitlinger commented Apr 16, 2026

Problem

shfmt Windows release assets have .exe extension (shfmt_v3.13.1_windows_amd64.exe) but the registry asset template shfmt_{{.Version}}_{{.OS}}_{{.Arch}} produces shfmt_v3.13.1_windows_amd64 without the extension. Aqua fails to download the binary on Windows.

Fix

Add a package-level Windows override that appends .exe to the asset name:

overrides:
  - goos: windows
    asset: shfmt_{{.Version}}_{{.OS}}_{{.Arch}}.exe

This applies to all version_overrides since they all share the same asset naming pattern.

Verification

Release assets confirm .exe is required on Windows:

  • shfmt_v3.13.1_windows_386.exe
  • shfmt_v3.13.1_windows_amd64.exe

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Windows support for shfmt downloads so the correct .exe binary is used, preventing failed installations and execution errors.
    • No other package metadata or version rules were changed.
    • Improves reliability of shfmt installs and updates on Windows systems.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 42e5c1f6-d271-40b7-9d98-6c7736ebc2a3

📥 Commits

Reviewing files that changed from the base of the PR and between f1e20e4 and 094a4cf.

📒 Files selected for processing (1)
  • registry.yaml
✅ Files skipped from review due to trivial changes (1)
  • registry.yaml

📝 Walkthrough

Walkthrough

Added a Windows-specific override for the shfmt package in pkgs/mvdan/sh/registry.yaml that sets the downloaded asset name to use the .exe extension (shfmt_{{.Version}}_{{.OS}}_{{.Arch}}.exe) when goos: windows.

Changes

Cohort / File(s) Summary
Windows Asset Override
pkgs/mvdan/sh/registry.yaml
Added an overrides entry targeting goos: windows to change the shfmt asset naming pattern to include the .exe extension (shfmt_{{.Version}}_{{.OS}}_{{.Arch}}.exe).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 I hopped into the code tonight,

Windows names now end with light,
shfmt.exe hops into place,
A tiny change, a joyful trace. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a Windows .exe override for the shfmt package to fix a download issue on Windows.
Description check ✅ Passed The description provides a clear problem statement, explains the fix with code example, and includes verification details. However, it does not explicitly check off the required checklist items from the repository template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@suzuki-shunsuke
Copy link
Copy Markdown
Member

I don't think this fix is necessary.

https://aquaproj.github.io/docs/reference/registry-config/complete-windows-ext/

Many Windows executable files have the suffix .exe, so aqua completes the suffix automatically.

aqua completes the suffix .exe to the following attributes.

asset
url
files.src

Generally speaking, If you want to send a pull request to fix a bug, you should describe the bug.

  • how to reproduce the bug
  • expected behaviour
  • actual behavior

At least, CI succeeded on Windows.

@zeitlinger zeitlinger closed this Apr 17, 2026
@github-project-automation github-project-automation Bot moved this to Done in main Apr 17, 2026
zeitlinger added a commit to grafana/flint that referenced this pull request Apr 21, 2026
Blocked by aquaproj/aqua-registry#52150

## Summary

- aquaproj/aqua-registry#51964 (Windows support for shfmt) merged and
released
- Switch `check_shfmt()` from `github:mvdan/sh` to bare `shfmt` key
(mise resolves via `aqua:mvdan/sh`)
- Drop entire `versioned_bin_fmt` feature — shfmt was the only user
- Remove `mise_tools` param from
`runner::run`/`prepare`/`build_invocations` (no longer needed)
- Add `("github:mvdan/sh", "shfmt")` to `OBSOLETE_KEYS` for automatic
migration hint
- Update `mise.toml`, test fixtures, and `renovate-tracked-deps.json`

## Test plan

- [ ] CI passes (Linux, macOS, Windows)
- [ ] `flint update` migrates `github:mvdan/sh` → `shfmt` in consumer
repos
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