Repository navigation
fix(herdr): run the panel on Windows through Git for Windows' sh - #924
Merged
Merged
Conversation
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
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Same on Windows 11 Enterprise with Git for Windows using the older mingw64 layout. Your fix works here too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
Closes #922
Problem
The Herdr panel failed on Windows in two stages:
sh, which is not on a Windows PATH. A default Git for Windows install adds onlyGit\cmd, so Herdr rejected withcannot start sh: program not found.sh, each job printed its temp folder as MSYS sees it (/tmp/skillshare-panel.X). The panel pollscodewith Herdr's nativereadTextFile, which cannot open that path, so every job waited out its 15-minute budget.Change
withShellinjobs.jsrunsshas before. Whenshcannot start, it asksgit --exec-pathfor 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.exewould 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.READYprintscygpath -m "$d"(C:/...) whencygpathexists. MSYSshaccepts that form, soALIVE,SWEEPandrm -rfkeep working. Platforms withoutcygpathare unchanged.PATHS) is not needed:bin/sh.exesets that PATH.README.mdand bothRECIPE.mdfiles name the Windows shell. The standalone mod is regenerated.Not covered
execrejects for a missingshcomes fromherdr.d.tsand the reporter'shc execoutput.@dir) stays an MSYS path. It is only passed back toshand toskillshare.exe(MSYS converts the argument), never toreadTextFile. Not exercised on Windows.Checks run
make checkin a devcontainer-image container: passed.make test-herdr: 143 passed, 5 new (herdr/tests/jobs.test.mjs): thesh.exefallback, nogitcall whereshstarts, one lookup per machine, the original error without Git for Windows, and job files read at the pathcygpathprints.python3 scripts/herdr/package-mod.py --checkandherdr-app checkon both mod folders (macOS): passed.Git\cmdon PATH,skillshare.exebuilt from5a6873ec9:git --exec-pathprintedC:/Program Files/Git/clangarm64/libexec/git-core, and the derivedC:/Program Files/Git/bin/sh.exeexists.System32on PATH, thatsh.exeresolvedfind,mktempandcygpathfrom/usr/binandgitfrom/clangarm64/bin.STARTthrough it printedC:/Users/<user>/AppData/Local/Temp/skillshare-panel.X. PowerShellGet-Contentreadcode=0andout= the version within 500 ms; the old/tmp/...form failedTest-Path.ALIVEandrm -rfworked on theC:/path, and the job detached withset -m(nosetsid).Checklist
make check) — for code changes