Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Go] Delete existing go install before extracting new version #1099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mitesch
Copy link

@mitesch mitesch commented Aug 19, 2024

We're running into some errors in our codespace and it seems to be related to the mcr.microsoft.com/devcontainers/go image being on go 1.22.6 and the ghcr.io/devcontainers/features/go:1 feature being on go 1.23.0.

go install github.com/golangci/golangci-lint/cmd/[email protected]
# runtime
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:71:2: other declaration of mallocHeaderSize
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:101:2: other declaration of minSizeForMallocHeader
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:60:6: heapBitsInSpan redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:112:6: other declaration of heapBitsInSpan
....

Reinstalling go fixes it.

wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz

https://go.dev/doc/install

Do not untar the archive into an existing /usr/local/go tree. This is known to produce broken Go installations.

I didn't verify the exact pair of files that is causing the problem, but it appears that Go 1.23.0 renamed or deleted or added a file that conflicts with a file in Go 1.22.6 that doesn't get overwritten by the extraction of the new version.

@mitesch mitesch requested a review from a team as a code owner August 19, 2024 17:40
src/go/install.sh Outdated Show resolved Hide resolved
src/go/install.sh Show resolved Hide resolved
src/go/install.sh Show resolved Hide resolved
@mitesch mitesch changed the title Delete existing go install before extracting new version [Go] Delete existing go install before extracting new version Aug 26, 2024
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