Skip to content

fix(scripts): resolve go-installed binaries via GOPATH/bin fallback#107

Merged
CybotTM merged 1 commit into
mainfrom
fix/resolve-global-bin-gopath
Jul 16, 2026
Merged

fix(scripts): resolve go-installed binaries via GOPATH/bin fallback#107
CybotTM merged 1 commit into
mainfrom
fix/resolve-global-bin-gopath

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

make install-gup reported Error: Installation via go completed but binary not found although go install had succeeded. resolve_global_bin verifies installs via PATH with an npm-global-bin fallback only — a go-installed binary in ${GOPATH:-$HOME/go}/bin is invisible when that dir is off PATH. Added the GOPATH/bin fallback; the existing warn_if_bin_off_path then 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
  • Full suite: 677 passed, 1 skipped; shellcheck clean; smoke tests pass
  • E2E: ./scripts/install_tool.sh gup install now completes with the off-PATH warning instead of the false error

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>
Copilot AI review requested due to automatic review settings July 16, 2026 21:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.45%. Comparing base (cd3c011) to head (a761b0c).

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           
Flag Coverage Δ
unittests 72.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CybotTM
CybotTM merged commit e903fae into main Jul 16, 2026
21 of 22 checks passed
@CybotTM
CybotTM deleted the fix/resolve-global-bin-gopath branch July 16, 2026 22:28
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
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.

2 participants