Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Proposal: officially deprecate gobin as of Go 1.16 #103

Closed
myitcv opened this issue Mar 13, 2021 · 3 comments · Fixed by #104
Closed

Proposal: officially deprecate gobin as of Go 1.16 #103

myitcv opened this issue Mar 13, 2021 · 3 comments · Fixed by #104
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@myitcv
Copy link
Owner

myitcv commented Mar 13, 2021

Apologies for being slow at getting round to raising this issue. Thanks to @howardjohn for raising #102.

Go 1.16 supports go install $pkg@$version to install commands without affecting the main module. This is the default mode of operation for gobin.

But another change in Go 1.16:

Build commands like go build and go test no longer modify go.mod and go.sum by default. Instead, they report an error if a module requirement or checksum needs to be added or updated (as if the -mod=readonly flag were used). Module requirements and sums may be adjusted with go mod tidy or go get.

means that changes are required in gobin for it (gobin) to continue to function when using cmd/go 1.16 (tests currently fail for example)

It's not clear to me however that it is worth making these changes (although I would be very open to someone else making the required changes). Whilst these Go 1.16 changes do not entirely cover the gobin use cases, go install $pkg@$version is generally sufficient.

Also noting the recently accepted proposal to support go run $pkg@$version, which should hopefully land in Go 1.17.

However, I'm raising this issue for discussion in case others disagree.

cc @rogpeppe @mvdan (and @mmcloughlin from a #tools message on Slack)

@myitcv myitcv added help wanted Extra attention is needed question Further information is requested labels Mar 13, 2021
mmcloughlin added a commit to mmcloughlin/addchain that referenced this issue Mar 19, 2021
The stress test CI job has been failing due to an error in bootstrap:

https://github.com/mmcloughlin/addchain/runs/2129921772?check_suite_focus=true#step:5:24

The problem relates to `gobin` under Go 1.16 myitcv/gobin#103.

This PR fixes the issue by using a `tools.mod` file to manage tools dependencies as suggested in:

https://www.bwplotka.dev/2020/bingo/
https://github.com/prometheus-operator/prometheus-operator/blob/5a2412883718ffe889fe741d5e0e5e7ae6b5f183/scripts/go.mod
@mmcloughlin
Copy link

Thanks for raising this discussion. I have hit this issue in a couple of repositories so far:

mmcloughlin/avo#166
mmcloughlin/addchain#61

However in both cases I've been able to easily deal with it by switching to the preferred tools.mod solution. And once we get to Go 1.17 (and therefore don't have to maintain 1.15 behavior) I can just switch to the new go install behavior if I want.

So from my point of view I think deprecating gobin going forward is fine.

@mvdan
Copy link
Collaborator

mvdan commented Mar 22, 2021

I also agree that deprecating gobin is a good option right now. I seem to recall that Jay and others want to collect data and user reports on how they are affected by the limitations of go install path@version, but that can happen without the need of rewriting part of gobin.

@myitcv
Copy link
Owner Author

myitcv commented Mar 23, 2021

I've also added a note to the description that a proposal to support go run $pkg@$version was recently accepted and will hopefully land in Go 1.17.

myitcv added a commit that referenced this issue Mar 23, 2021
Once we merge this PR we will archive the project.

Fixes #103
myitcv added a commit that referenced this issue Mar 23, 2021
Once we merge this PR we will archive the project.

Fixes #103
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants