Repository navigation
fix(doctor): reject failed and malformed local Go runtimes - #50
Merged
Merged
Conversation
johnny4young
marked this pull request as ready for review
October 7, 2026 00:23
…validation # Conflicts: # CHANGELOG.md
- move the check into a helper that scopes LC_ALL=C to the regex alone - reject C1 controls and non-ASCII bytes instead of echoing them - accept the minor-less go1 release output - cover more platforms, devel and distro formats, and malformed bytes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ExmnfUngrDYjAheGvYwMnn
…validation # Conflicts: # CHANGELOG.md
Git Bash's C locale classifies bytes above 0x7e as printable, so the pattern alone accepted a 0xff byte there. Check for printable ASCII byte-wise with tr before matching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ExmnfUngrDYjAheGvYwMnn
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.
Problem
gos doctortreated locatinggoon PATH as evidence of a working runtime.go versionfailures were masked by|| true, so the command could return a healthy report and exit 0 even when Go exits 7. A harmless executable fixture reproduces the false positive on main05d9e25361e1d7e328f0fc057b7d79b442ee2304.Change
goproblem, with the original exit code and actionable PATH/runtime repair guidanceX:and-X:), and Windows CRLFGOTOOLCHAIN=local; never request an SDK download or automatically reinstall during diagnosisThe parser is a runtime diagnostic, not proof of binary authenticity.
gos verifyremains the archive-backed integrity command.Duplicate-PR audit
Inspected every open patch before implementing: #41 dependency bump, #44 project resolver, #45 concurrency, #46 suite observations, #47 partial/skip classification, #48 user-command execution, and #49 sudo-output replay. None changes this check. This fix is independent on main. Existing work and user changes were preserved.
The CI proposal to remove the later
gos verify --jsonwalk is deliberately not included: it exercises the installed CLI/JSON integration separately from actionverify:true. Preserving both contracts is more valuable than an unproven saving. No matrix, checksum/feed policy, integrity check, timeout, threshold, release or deployment is changed.Verification
go versionresponse with exit 7 fails the new test against unchanged main because doctor incorrectly returns 0scripts/validate-local.bashpasses all 32 Linux Bash suites, command-surface sync, workflow YAML/invariants, Bash syntax, ShellCheck 0.11.0, Zsh syntax, CLI smoke and whitespace checksReview notes
Compatibility review checked official Go sources:
cmd/go/internal/version/version.goprints runtime.Version plus GOOS/GOARCH; toolchain names permit vendor suffixes; linker metadata permits experiment markers with either separators. These cases are explicit regressions. Existing Windows fixtures establish the CRLF boundary.Hosted qualification
CI run 37551330622 completed successfully on exact source head
5e72248ef64549919b8f4005305c2bb14149d580: all 10 workflow jobs and all 11 checks (including GitGuardian) are green.tests/doctor-runtime.bashregression ran and passed on Linux, macOS Bash 3.2.57 (and the regular macOS pass), and Windows Git Bash. It was not skipped on any host.homebrew-tapandpackaging, covered on Linux). Windows: 13 passed, 19 existing OS-skipped suites. These are the existing platform rules, not 32 executed suites on each platform.Qualified for review; merge remains the maintainer's decision. No merge or release was performed.
Main was refreshed before publication and remains
05d9e25361e1d7e328f0fc057b7d79b442ee2304. The doctor parser uses a local C locale for deterministic character classes. The final source tree passed hosted shfmt. Changelog additions may need a small conflict resolution after other pending PRs merge; retain all entries.