gvm icon indicating copy to clipboard operation
gvm copied to clipboard

Cannot install Go 1.4

Open grandstairs opened this issue 1 year ago • 9 comments

I am struggling to figure out how to install Go on an ARM / Apple Silicon macbook.

$ gvm install go1.4
Installing go1.4...
 * Compiling...
/Users/owner/.gvm/scripts/install: line 93: go: command not found
ERROR: Failed to compile. Check the logs at /Users/owner/.gvm/logs/go-go1.4-compile.log
ERROR: Failed to use installed version

Line 93 requires go env to be working which it isn't because there is no Go binary installed.

So then I tried to install a Go 1.4 binary directly and that failed as well.

$ gvm install go1.4 -B                 
Installing go1.4 from binary source
ERROR: Failed to download binary go
$ echo $PATH
/Users/owner/.rvm/bin:/Users/owner/.gvm/bin:/opt/homebrew....
$ which go
go not found

grandstairs avatar Feb 16 '24 17:02 grandstairs

Did you find a fix?

kaykhan avatar Apr 03 '24 10:04 kaykhan

No, I went back to using homebrew for now and just manually changing versions if needed.

$ which go
/opt/homebrew/bin/go
$ go version
go version go1.22.0 darwin/arm64

grandstairs avatar Apr 03 '24 14:04 grandstairs

I found a workaround (on macos). Instead of doing the crazy bootstrapping chain, you can do this:

  1. Download the .tar.gz file from the official site https://go.dev/dl/ and unpack it somewhere (it'll decompress to a go dir)
  2. In a terminal add the go to PATH:
export PATH="<where your go dir is>/bin:$PATH"
  1. Run gvm install go1.22.3 or whatever version you need.
  2. Delete the go dir in step 1
  3. Then run gvm use go1.22.3 --default. Otherwise it'll complain about invalid go version (you need to set a default, gvm doesn't set it for you).

Note the latest go actually requires >= 1.20 to compile

ryan-ju avatar May 30 '24 21:05 ryan-ju

I found a workaround (on macos). Instead of doing the crazy bootstrapping chain, you can do this:

  1. Download the .tar.gz file from the official site https://go.dev/dl/ and unpack it somewhere (it'll decompress to a go dir)
  2. In a terminal add the go to PATH:
export PATH="<where your go dir is>/bin:$PATH"
  1. Run gvm install go1.22.3 or whatever version you need.
  2. Delete the go dir in step 1
  3. Then run gvm use go1.22.3 --default. Otherwise it'll complain about invalid go version (you need to set a default, gvm doesn't set it for you).

Note the latest go actually requires >= 1.20 to compile

This works perfectly! Thanks!

Kyungminkim31 avatar Jul 02 '24 02:07 Kyungminkim31

I found a workaround (on macos). Instead of doing the crazy bootstrapping chain, you can do this:

  1. Download the .tar.gz file from the official site https://go.dev/dl/ and unpack it somewhere (it'll decompress to a go dir)
  2. In a terminal add the go to PATH:
export PATH="<where your go dir is>/bin:$PATH"
  1. Run gvm install go1.22.3 or whatever version you need.
  2. Delete the go dir in step 1
  3. Then run gvm use go1.22.3 --default. Otherwise it'll complain about invalid go version (you need to set a default, gvm doesn't set it for you).

Note the latest go actually requires >= 1.20 to compile

perfectly works!!! thank you

mhazizk avatar Jul 24 '24 15:07 mhazizk