kevincobain2000 / gobrew

Go version manager, written in Go. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.
https://medium.com/web-developer/go-version-manager-gobrew-c8750157dfe6
MIT License
364 stars 24 forks source link

Extend so that we can install golang gotip #109

Closed gedw99 closed 1 year ago

gedw99 commented 1 year ago

Wondering if it can also handle downloading golang beta versions ?

would be nice for smoke testing

kevincobain2000 commented 1 year ago

Works with beta and rc

gedw99 commented 1 year ago

true its does

its not possible to get green builds of 1.21 ?

kevincobain2000 commented 1 year ago

Are those green builds publicly available somewhere?

kevincobain2000 commented 1 year ago

I am not sure if I follow correctly

gedw99 commented 1 year ago

Am not sure if they are available.

i think their build farm url

gedw99 commented 1 year ago

https://dev.golang.org/release

kevincobain2000 commented 1 year ago

Thanks and no. There is no support for that. Currently it downloads from the url below

https://github.com/kevincobain2000/gobrew/blob/8455f6eeb1bb7c80a536d9a9461f0bcfe84ed3b0/gobrew.go#L24

If there is tar available there then it shows up on the list of versions that can be installed.

╰─$ gobrew ls-remote|grep 1.20 -A 5 -B 5

1.19    1.19.0  1.19.1  1.19.2  1.19.3  1.19.4
    1.19.5  1.19.6  1.19.7  1.19.8  1.19.9
    1.19beta1  1.19rc1  1.19rc2

1.20    1.20.0  1.20.1  1.20.2  1.20.3  1.20.4
    1.20rc1  1.20rc2  1.20rc3

--

I am also not sure how badly would an application engineer using Go would want that feature. Open to ideas tho

gedw99 commented 1 year ago

yep no worries.

If i find another way will PR it. sure a way in the past, just need to research it again.

gedw99 commented 1 year ago

And it’s low priority anyway like you said . Too hard

kevincobain2000 commented 1 year ago

Neh. Difficulty is not an issue. Just that not much value to mass users.

gedw99 commented 1 year ago

finally remembered it:

https://pkg.go.dev/golang.org/dl/gotip

i am working on this and needed latest go: https://github.com/stealthrocket/wasi-go/tree/main#with-go

Its possible we could incorporate this, and so then devs wont have to think twice

kevincobain2000 commented 1 year ago

なるほど I am ok if this feature is available, but probably won't be implementing it anytime soon. Little busy with work these days. Open to pull reqs if you can submit?

gedw99 commented 1 year ago

Yeah I will try to find time to make a PR.

It will be really helpful for me and hopefully others.

will reopen it so others can see this..

kevincobain2000 commented 1 year ago

sure, thanks.

gedw99 commented 1 year ago

looks like this will work thanks to gotip and gobrew holding the downloaded artifacts as same structure, but different root paths.

the go env is identical except for 2 things.


gotip structure:

go install golang.org/dl/gotip@latest
gotip download
...
tree /Users/apple/sdk/gotip/
api/   bin/   doc/   lib/   misc/  pkg/   src/   test/

Gotip go env
...
GOTOOLDIR='/Users/apple/sdk/gotip/pkg/tool/darwin_amd64'
GOVERSION='devel go1.21-b0e1707 Tue Jun 13 03:06:54 2023 +0000'

gobrew structure:

tree /Users/apple/.gobrew/versions/1.20.4/go/
api/   bin/   doc/   lib/   misc/  pkg/   src/   test/

go env
...
GOTOOLDIR="/Users/apple/.gobrew/current/go/pkg/tool/darwin_amd64"
GOVERSION="go1.20.5"

So its might be as simple as importing gotip into gobrew and then calling gotip download and moving the files into tree /Users/apple/.gobrew/versions/gotip/go/

gotip is the version.

kevincobain2000 commented 1 year ago

hmm thanks. I think it can be kept isolated from gobrew, once go is installed users can just use go install golang.org/dl/gotip@latest I still don't see much merit in merging it with gobrew

gedw99 commented 1 year ago

I disagree. You have to do :

so “gotip go env.”

so it messes up all your scripts.

I worked out a way to make it be integrated easily with only minor changes.

Will pr it and you decide.

kevincobain2000 commented 1 year ago

okay

gedw99 commented 1 year ago

I have it merged such that code is separate.. you will see what I mean.

Also is it ok Iif I add a makefile to root of repo ? Just makes things tighter . Will then delete .sh files which don’t work on windows. Makefile works on all OS’s

gedw99 commented 1 year ago

Will keep git.io.sh obviously :) for curl install. I guess that works on Windows ?

kevincobain2000 commented 1 year ago

Well. The installation process should just be one liner. I think with makefile there’d be clone as extra step required.

kevincobain2000 commented 1 year ago

Can I close this issue? @gedw99