Skip to content

Fix plannotator-tui fetch for native Windows (Git Bash/MSYS/Cygwin) - #33

Closed
amirimranamiruddin wants to merge 1 commit into
plannotator:mainfrom
amirimranamiruddin:fix/windows-plannotator-tui-fetch
Closed

Fix plannotator-tui fetch for native Windows (Git Bash/MSYS/Cygwin)#33
amirimranamiruddin wants to merge 1 commit into
plannotator:mainfrom
amirimranamiruddin:fix/windows-plannotator-tui-fetch

Conversation

@amirimranamiruddin

Copy link
Copy Markdown

Problem

The README documents native Windows as a supported platform ("macOS, Linux, or Windows... On Windows, native Herdr plugin support is preview/best-effort"), and plannotator-tui releases already publish an x86_64-pc-windows-msvc.exe asset. However scripts/fetch-plannotator-tui.sh's uname-based case statement only matches Darwin and Linux:

case "$(uname -s)/$(uname -m)" in
  Darwin/arm64)            target=aarch64-apple-darwin ;;
  Darwin/x86_64)           target=x86_64-apple-darwin ;;
  Linux/x86_64)            target=x86_64-unknown-linux-gnu ;;
  Linux/aarch64|Linux/arm64) target=aarch64-unknown-linux-gnu ;;
  *) echo "warning: no plannotator-tui build for $(uname -s)/$(uname -m); the review pane is unavailable" >&2; exit 0 ;;
esac

On native Windows, Herdr's plugin build step runs this script under Git Bash/MSYS, where uname -s reports MINGW64_NT-... (not Darwin/Linux). It falls through to the default branch, prints a warning, and exits 0 without downloading — silently leaving the document-review pane (annotate.open / annotate.last) unavailable, even though a matching release binary exists.

Fix

Add a case for MINGW64*/MSYS_NT*/CYGWIN* on x86_64 that selects the x86_64-pc-windows-msvc target and appends .exe when fetching/verifying the asset. The existing sha256 verification against SHA256SUMS is unchanged and reused as-is.

Verification

On Windows (Git Bash), with a clean bin/:

$ bash scripts/fetch-plannotator-tui.sh
downloading https://github.com/plannotator/plannotator-tui/releases/download/v0.3.1/plannotator-tui-x86_64-pc-windows-msvc.exe
installed plannotator-tui 0.3.1 (x86_64-pc-windows-msvc)

$ bin/plannotator-tui --version
plannotator-tui 0.3.1

$ bash scripts/plannotator-tui.sh --version
plannotator-tui 0.3.1

Also confirmed herdr plugin install plannotator/herdr-annotate --yes picks this branch up correctly and the annotate.open/annotate.last review pane actions work end-to-end on Windows afterward.

The README documents Windows as a supported platform for the plugin
build/link workflow, and plannotator-tui releases already ship an
x86_64-pc-windows-msvc.exe asset, but fetch-plannotator-tui.sh's
uname-based case statement only matched Darwin and Linux. On native
Windows, the build step runs under Git Bash/MSYS, where uname -s
reports MINGW64_NT-..., so the script fell into the default branch,
printed a warning, and skipped the download entirely -- silently
leaving the document-review pane unavailable.

Add a case for MINGW64/MSYS_NT/CYGWIN x86_64 that selects the
windows-msvc target and appends the .exe extension when fetching and
verifying the release asset (the same sha256 verification path is
reused unchanged). Verified locally: after this fix, running
scripts/fetch-plannotator-tui.sh from a clean bin/ downloads and
sha256-verifies the pinned release, and both bin/plannotator-tui and
scripts/plannotator-tui.sh --version report the correct version.
@backnotprop

Copy link
Copy Markdown
Contributor

Thanks for the clean writeup, but this fixes a path that never executes. The bash build entry in herdr-plugin.toml is gated to platforms = ["macos", "linux"], so on Windows Herdr skips this script entirely; it only reports MINGW/MSYS uname values if someone runs it by hand in Git Bash, which is not a supported install path.

Native Windows install support is already in the tree as scripts/fetch-plannotator-tui.ps1 (native architecture detection, same SHA256SUMS verification, no MSYS layer). It is deliberately dormant: the review pane cannot start on Windows until Herdr resolves relative pane commands against the plugin root (herdrdev/herdr#3024), so fetching a binary today would leave users with a download nothing can run. When that lands upstream, the Windows build entry and platform gates flip on and the PowerShell fetcher takes over.

Closing since the Git Bash case will not become a supported path, but appreciated regardless, and the report is a useful signal that people are trying to use this on Windows.

@backnotprop backnotprop closed this Sep 1, 2026
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