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

proposal: cmd/go: manage binaries installed in GOBIN #50261

Open
georgettica opened this issue Dec 19, 2021 · 10 comments
Open

proposal: cmd/go: manage binaries installed in GOBIN #50261

georgettica opened this issue Dec 19, 2021 · 10 comments
Labels
Milestone

Comments

@georgettica
Copy link

As a user, I would like to have a command that iterates through my $GOBIN and checks if all of the packages I installed are in their latest version.
the new go install command is great and allows installing the binaries without changing anything on the machine.

some solutions I can see in mind for this:

  1. have a similar solution of go.mod or a section inside go.mod that relates to binaries so go list can display them and then can be easily iterated on.
  2. create a new go_install.mod specific for this solution
  3. add metadata in the $GOBIN folder on what binary version was installed and the go install will read it when using the --list-outdated flag
  4. other

this issue comes from the fact I have an update command that upgrades all of the components on my machine fairly frequently and rust has https://github.com/nabijaczleweli/cargo-update for that case

@gopherbot gopherbot added this to the Proposal milestone Dec 19, 2021
@georgettica
Copy link
Author

this could also make the vim-go binary installation simpler
https://github.com/fatih/vim-go/blob/585e12d32b3a1defcf863bd405b440cefbd4e31a/plugin/go.vim#L78

@kortschak
Copy link
Contributor

This can be done with external tooling, for example https://github.com/kortschak/ugbt/.

@seankhliao seankhliao changed the title proposal: cmd/go/internal/work/build: go install will have a --list-outdated flag proposal: cmd/go: manage binaries installed in GOBIN Dec 19, 2021
@georgettica
Copy link
Author

Searched external tooling for a while and didn't find this.

I'll try it out and report back 😀

@beoran
Copy link

beoran commented Mar 16, 2022

If go clean -i does not do this already then it should.

@georgettica
Copy link
Author

I forgot to report back. the tool works great!
collaborated with @kortschak on it and created https://github.com/georgettica/ugbt-update-all-gobin to accomodate my own needs

@georgettica
Copy link
Author

@beoran not sure how your comment is related to the issue, but if you meant:

go clean -i ${GO_REPO_NAME}@${GO_REPO_VERSION}

for deleting what was installed via gobin it didn't work.

@rsc rsc added this to Proposals Aug 10, 2022
@rsc rsc moved this to Incoming in Proposals Aug 10, 2022
@phanirithvij
Copy link

Found one https://github.com/nao1215/gup (an external tool)

@georgettica
Copy link
Author

not as heavy into go binaries now, but if others think that gup is more mature than ugbt I'll switch my stuff there

@mvdan
Copy link
Member

mvdan commented May 7, 2024

I thought I'd add my 2c to this issue: I have a script that reinstalls a set of tools I use regularly at their latest (or master/main, depending on each case) versions. It's much dumber than the other kinds of automatic tools proposed here, but I'm fine with that. Every now and then I'll delete my entire GOBIN, so any tools that I installed once and miss, I add to the script so they are reinstalled and kept up to date.

@vikblom
Copy link

vikblom commented May 13, 2024

I think it would make sense if go install could manage and keep programs at least up to date, both in terms of source code and compiled-with version.

I have my own program that does what I expect gup and other tools are doing. Loop over programs in $GOBIN and work with the version info the compiler puts in binaries (since a while back).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

7 participants