Skip to content

fix(herdr): run the panel on Windows through Git for Windows' sh - #924

Merged
runkids merged 1 commit into
mainfrom
runkids/922-herdr-windows
Nov 16, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/922-herdr-windows

Conversation

@runkids

@runkids runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Closes #922

Problem

The Herdr panel failed on Windows in two stages:

  • Every exec ran sh, which is not on a Windows PATH. A default Git for Windows install adds only Git\cmd, so Herdr rejected with cannot start sh: program not found.
  • With a working sh, each job printed its temp folder as MSYS sees it (/tmp/skillshare-panel.X). The panel polls code with Herdr's native readTextFile, which cannot open that path, so every job waited out its 15-minute budget.

Change

  • withShell in jobs.js runs sh as before. When sh cannot start, it asks git --exec-path for the Git root (<root>/<mingw64|ucrt64|clangarm64>/libexec/git-core) and retries with <root>/bin/sh.exe. That launcher sets up the MSYS PATH itself; usr/bin/sh.exe would pick up Windows' find.exe. The shell found is kept per machine, because a space's machine can run a different OS than the window. A failure is not kept, and the original error stands when Git for Windows is absent.
  • READY prints cygpath -m "$d" (C:/...) when cygpath exists. MSYS sh accepts that form, so ALIVE, SWEEP and rm -rf keep working. Platforms without cygpath are unchanged.
  • The issue's second item (adding MSYS directories to PATHS) is not needed: bin/sh.exe sets that PATH.
  • README.md and both RECIPE.md files name the Windows shell. The standalone mod is regenerated.

Not covered

  • No run inside Herdr on Windows: Herdr has no ARM64 Windows build, and the local test VM is ARM64. How Herdr's exec rejects for a missing sh comes from herdr.d.ts and the reporter's hc exec output.
  • The install dialog's clone folder (@dir) stays an MSYS path. It is only passed back to sh and to skillshare.exe (MSYS converts the argument), never to readTextFile. Not exercised on Windows.

Checks run

  • make check in a devcontainer-image container: passed.
  • make test-herdr: 143 passed, 5 new (herdr/tests/jobs.test.mjs): the sh.exe fallback, no git call where sh starts, one lookup per machine, the original error without Git for Windows, and job files read at the path cygpath prints.
  • python3 scripts/herdr/package-mod.py --check and herdr-app check on both mod folders (macOS): passed.
  • Windows 11 ARM64 (UTM), desktop user, full token, Git for Windows ARM64 with only Git\cmd on PATH, skillshare.exe built from 5a6873ec9:
    • git --exec-path printed C:/Program Files/Git/clangarm64/libexec/git-core, and the derived C:/Program Files/Git/bin/sh.exe exists.
    • With only System32 on PATH, that sh.exe resolved find, mktemp and cygpath from /usr/bin and git from /clangarm64/bin.
    • The panel's START through it printed C:/Users/<user>/AppData/Local/Temp/skillshare-panel.X. PowerShell Get-Content read code = 0 and out = the version within 500 ms; the old /tmp/... form failed Test-Path. ALIVE and rm -rf worked on the C:/ path, and the job detached with set -m (no setsid).

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Windows has no sh on PATH, so every panel exec failed with "program not
found". A default Git for Windows install puts only Git\cmd on PATH, so
when sh cannot start the panel asks `git --exec-path` for the Git root
and uses its bin/sh.exe, which sets up the MSYS PATH itself. The shell
found is kept per machine, because a space's machine can run a
different OS than the window.

Under that sh, jobs printed their temp folder as /tmp/..., which Herdr's
native readTextFile cannot open, so every job waited out its 15 minutes.
READY now prints the cygpath -m form (C:/...) when cygpath exists; MSYS
sh accepts it too, and other platforms are unchanged.

Closes #922
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T14:03:42.089176Z c01bb87 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 313ffde into main Nov 16, 2026
9 checks passed
@runkids
runkids deleted the runkids/922-herdr-windows branch November 16, 2026 14:15
@eirikc

eirikc commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Same on Windows 11 Enterprise with Git for Windows using the older mingw64 layout. Your fix works here too.

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.

herdr panel: doesn't work on Windows (sh not found, then every job "took longer than 15 minutes")

2 participants