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

Formula depends on Go for building #16

Open
OrBin opened this issue Nov 11, 2022 · 2 comments
Open

Formula depends on Go for building #16

OrBin opened this issue Nov 11, 2022 · 2 comments

Comments

@OrBin
Copy link

OrBin commented Nov 11, 2022

This formula depends on Go for building.

It means that it installs go from the stable channel and leaves it there after installing buf, which is not really necessary.
It also means that it creates confusion regrading which is the "correct" Go binary, if another Go version is installed (e.g. go@1.18 from brew) or Go is installed in other way (e.g. downloaded from https://go.dev/dl/).

I believe it's possible to change this formula so it just downloads the pre-built binary from https://github.com/bufbuild/buf/releases, at least for explicitly for linux and macOS (can still install Go and build from source otherwise, to avoid losing comptability for non-linux-and-macOS-OSes). I think it should also make the formula installation faster and more reliable (why build from source on every installation if we can use the officially-released pre-built binary?).

If you agree with my suggestion, I'd love to submit a PR that does that.

@rhbuf
Copy link

rhbuf commented Nov 25, 2022

Hi 👋 - while I know very little about homebrew, I've discussed this with the team and we'd be open to the change if you're happy to implement.

@MelleKoning
Copy link

MelleKoning commented Jan 4, 2025

I found that after installing buf with homebrew, my default go version got changed!

Earlier installed version 1.23.3, and after installing buf, the default version of go that is picked up now is 1.23.4

Found this issue, as this could indeed be a problem especially when you don't want your go version to be updated because you were just installing or updating buf...

The reason the default go version that is picked up has changed on my machine is simply because homebrew puts it environment path in front of the default earlier set go-path (in the $PATH variable).

On linux/ubuntu when in a shell executing
which go
/home/linuxbrew/.linuxbrew/bin/go

while my go installation is in the default install folder /usr/local/go/bin/go

asking that version gives:

/usr/local/go/bin/go version
go version go1.23.3 linux/amd64

instead of the brew formula installed version 1.23.4

Of course, this minor difference on my machine is not that much of an issue, but in general a whole team could want to make a careful decision before upgrading from one go version to the next, even when installing buf as proto linter.

So, updating the go version from installing buf is not something that should happen; when we accidentally move developers to a different default go-version after installing buf, this could lead to issues when different developers suddenly use different go versions, right?

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

No branches or pull requests

3 participants