feat(shfmt): add Windows support#51964
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated mvdan/sh package metadata: registry release-asset selection logic and platform handling for shfmt were revised (new exact-version and semver-based overrides, removed supported_envs/files blocks, added windows_arm_emulation/rosetta2/replacements, and checksums on specific overrides). pkg.yaml gained explicit pins for several older shfmt versions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
53fe505 to
253c955
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
|
2421f29 argd s -cmd shfmt -B mvdan/sh |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [aquaproj/aqua-registry](https://github.com/aquaproj/aqua-registry) | minor | `v4.492.0` → `v4.493.0` | 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>aquaproj/aqua-registry (aquaproj/aqua-registry)</summary> ### [`v4.493.0`](https://github.com/aquaproj/aqua-registry/releases/tag/v4.493.0) [Compare Source](aquaproj/aqua-registry@v4.492.0...v4.493.0) [Issues](https://github.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.493.0) | [Merge Requests](https://github.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.493.0) | <aquaproj/aqua-registry@v4.492.0...v4.493.0> #### 🎉 New Packages [#​51977](aquaproj/aqua-registry#51977) [trzsz/trzsz-go](https://github.com/trzsz/trzsz-go) - trzsz-go is the go version of trzsz, makes all terminals that support local shell to support trzsz ( trz / tsz ) [@​ZeroAurora](https://github.com/ZeroAurora) [#​51929](aquaproj/aqua-registry#51929) [micelio.dev/hif](https://micelio.dev/micelio/micelio/tree/hif) - The hif CLI - a forge-first version control system for the agent era [@​pepicrft](https://github.com/pepicrft) [#​51717](aquaproj/aqua-registry#51717) [IBM-Cloud/ibm-cloud-cli-release](https://github.com/IBM-Cloud/ibm-cloud-cli-release) - Command line interface for IBM Cloud [@​dnwe](https://github.com/dnwe) [#​51715](aquaproj/aqua-registry#51715) [pgplex/pgschema](https://github.com/pgplex/pgschema) - Terraform-style, declarative schema migration CLI for Postgres. Agent friendly [@​kaz](https://github.com/kaz) #### Fixes [#​51964](aquaproj/aqua-registry#51964) mvdan/sh: Support Windows [@​zeitlinger](https://github.com/zeitlinger) [#​51905](aquaproj/aqua-registry#51905) temporalio/temporal: refresh server bundle binaries [@​chaptersix](https://github.com/chaptersix) #### Security [#​51716](aquaproj/aqua-registry#51716) gleam-lang/gleam: GitHub artifact attestations config [@​scop](https://github.com/scop) </details> --- ### Configuration 📅 **Schedule**: (UTC) - 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:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTMuMCIsInVwZGF0ZWRJblZlciI6IjQzLjExMy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
aquaproj/aqua-registry#51964 added Windows support for shfmt and has been merged and released. Switch to the aqua: backend so shfmt installs as a plain binary without a version suffix in the name. Drop versioned_bin_fmt field, resolve_bin_name(), find_bin_with_prefix(), and .versioned_bin() builder — shfmt was the only user. Remove mise_tools parameter from runner::run/prepare/build_invocations (no longer needed). Add ("github:mvdan/sh", "aqua:mvdan/shfmt") to OBSOLETE_KEYS so existing consumers get an automatic migration hint and flint update can fix it. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
## Summary - Remove `os = ["linux", "macos"]` from `registry/shfmt.toml` - Bundled aqua-registry snapshot already supports shfmt on Windows (aquaproj/aqua-registry#51964) - aqua auto-completes `.exe` suffix for `format: raw` assets, so `aqua:mvdan/sh` works on Windows - `go:mvdan.cc/sh/v3/cmd/shfmt` cross-compiles fine Currently the bare `shfmt` short name is filtered out on Windows at the short-name dispatcher layer before it can reach the aqua backend, forcing Windows users to specify `aqua:mvdan/sh` explicitly. ## Test plan - [ ] CI Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
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
shfmt ships Windows binaries since at least v3.8.0 (e.g.
shfmt_v3.12.0_windows_amd64.exeandshfmt_v3.12.0_windows_386.exe), but the registry only listsdarwin,linux, andamd64insupported_envs.Aqua auto-appends
.exeon Windows, so no template changes are needed — only addingwindowstosupported_envsin all three version override entries.Verified by checking that shfmt's GitHub releases include
_windows_amd64.exeand_windows_386.exeassets across all three version constraint ranges.Summary by CodeRabbit
New Features
Chores