Conversation
9d28a85 to
92be55e
Compare
Chessing234
left a comment
There was a problem hiding this comment.
Practical Windows/Hermit fix. Checking -x on bin/<tool> before falling back to PATH correctly handles the "symlink checked out as a text file" case without needing Developer Mode. Duplicating hermit_tool into both scripts is fine for now; if a third script needs it, consider a tiny scripts/lib/hermit.sh. The lefthook soft-skip is the right call when the shim isn't runnable. LGTM.
92be55e to
581f259
Compare
581f259 to
8af482a
Compare
Windows checks out bin/ symlinks as text and has no Hermit build, so dev-setup and run-tests aborted at exit 127. Skip lefthook when absent. Signed-off-by: sumit-m <33051892+sumit-m@users.noreply.github.com>
8af482a to
958fc29
Compare
🔐 Codex Security Review
|
Summary
Falls back to a PATH-resolved tool when a Hermit shim in
bin/is not executable.Hermit's
bin/entries are git symlinks. On Windows they are checked out as plain text files whenevercore.symlinksis false — which is the default without Developer Mode or an elevated shell — so"${REPO_ROOT}/bin/just"fails with exit 127. Hermit has no Windows build, so there is nothing to repair locally; the tools are simply installed on PATH instead.scripts/dev-setup.shandscripts/run-tests.shnow route their Hermit invocations through a small helper:The
-xtest means every Hermit-enabled host keeps using the pinned shim exactly as before. Only a host where the shim is not executable takes the PATH path.lefthook installis also guarded rather than assumed, with a warning pointing at the install docs, since it is not a hard requirement to run the suite.Related issue
Part of #2388 (Windows Support).
No duplicate found: 11 open PRs touch
scripts/run-tests.shorscripts/dev-setup.sh, but none add hermit or PATH-fallback handling. Checked by intersecting changed-file paths across all open PRs.Testing
Verified on Windows 11 (
x86_64-pc-windows-msvc, Git Bash):scripts/dev-setup.shexits 127 at"${REPO_ROOT}/bin/just"—bin/justis a 19-byte text file containing the symlink target, not an executable.justfrom PATH and completes.scripts/run-tests.shlikewise reaches the test run instead of failing at tool resolution.bash -nclean on both scripts.Not verified on macOS or Linux — I have no such hardware. On any host where Hermit's shims are real symlinks the
-xtest succeeds and the resolved path is byte-identical to today's, so the change is inert there by construction.Worth flagging: this makes the scripts run on Windows, but it means those runs use whatever tool versions are on PATH rather than Hermit's pinned ones. That seemed better than not running at all, though I would understand a maintainer preferring an explicit warning when the fallback fires.