fix(shims): rehash scans both v3 and legacy gopath bin (Option C — additive, #545)#548
Open
jlec wants to merge 1 commit into
Open
fix(shims): rehash scans both v3 and legacy gopath bin (Option C — additive, #545)#548jlec wants to merge 1 commit into
jlec wants to merge 1 commit into
Conversation
…ditive) Strictly additive fix: resolver and rehash now consult both $GOENV_ROOT/versions/$ver/gopath/bin and $HOME/go/$ver/bin so that tools installed by either layout appear as shims. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Option C of three for issue #545.
Strictly additive fix: resolver and rehash now consult both
$GOENV_ROOT/versions/$version/gopath/binand$HOME/go/$version/bin. Tools installed under either layout become shims. No behaviour is removed, no migration is needed.Changes
internal/config/config.go— addsLegacyHomeGopathBin(version)returning$HOME/go/$version/bin(empty string onos.UserHomeDir()error).internal/resolver/resolver.go:ResolveBinarychecksLegacyHomeGopathBinafterVersionGopathBin(when GOPATH is enabled).GetBinaryDirectoriesincludes the legacy path.FindVersionsWithBinaryincludes the legacy path.internal/resolver/resolver_test.go(new) — 5 tests covering the new behaviour and the GOPATH-disabled negative case.Trade-offs
Test plan
go build ./...go vet ./...go test ./...— all packages pass, including 5 new resolver testsgoenv rehashagainst an environment with 32 tools in~/go/$ver/binproduces 38 shims (same as v2 master).🤖 Generated with Claude Code