fix(scripts): resolve go-installed binaries via GOPATH/bin fallback#107
Merged
Conversation
make install-gup failed with 'Installation via go completed but binary
not found' whenever ${GOPATH:-$HOME/go}/bin was not on PATH: go install
succeeds, but resolve_global_bin only checked PATH and npm's global bin.
Add a GOPATH/bin fallback so the verify finds the binary and the existing
off-PATH warning fires instead of a false error.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
=======================================
Coverage 72.45% 72.45%
=======================================
Files 22 22
Lines 3402 3402
=======================================
Hits 2465 2465
Misses 937 937
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CybotTM
added a commit
that referenced
this pull request
Jul 17, 2026
…#111) ## Summary `make upgrade-all`'s go@1.26 step printed `before: <none> / after: <none>` while claiming success, and `~/go/bin` accumulated 12 orphaned version wrappers (`go1.25.5` … `go1.26.5`). Root cause — same class as #107: after `go install golang.org/dl/go1.26.5@latest` the script checked `have go1.26.5` (PATH lookup), but `go install` lands in GOBIN (default `GOPATH/bin`), which may be off PATH. The SDK download and `go1.26` cycle-symlink update were then silently skipped, and each run left another orphaned wrapper. - resolve wrappers explicitly via `go env GOBIN`/`GOPATH` — install verification, SDK download, symlink update, and the before/after version probes - prune superseded same-cycle wrappers **and their `~/sdk` trees** after a successful update (`go1.26.0`, `go1.26.2` → gone once `go1.26.5` is in place); other cycles are untouched - drop the unused `TOOL` var (pre-existing SC2034 that blocked the shellcheck hook on this file) ## Tests - `tests/test_go_multiversion.py` (3 tests, red→green, go/curl/python3 PATH-stubbed with GOPATH/bin deliberately off PATH): SDK download + symlink happen despite GOBIN off PATH, after-version probes GOBIN instead of reporting `<none>`, superseded same-cycle wrappers and SDKs pruned while other cycles survive - Full suite: 692 passed, 1 skipped; shellcheck clean; smoke tests pass
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.



Summary
make install-gupreported Error: Installation via go completed but binary not found althoughgo installhad succeeded.resolve_global_binverifies installs via PATH with an npm-global-bin fallback only — a go-installed binary in${GOPATH:-$HOME/go}/binis invisible when that dir is off PATH. Added the GOPATH/bin fallback; the existingwarn_if_bin_off_paththen tells the user to add the dir to PATH instead of failing the install.Tests
tests/test_resolve_global_bin.py(4 tests, red→green): GOPATH/bin fallback, $HOME/go default, PATH precedence, missing-binary empty result./scripts/install_tool.sh gup installnow completes with the off-PATH warning instead of the false error