-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go: deprecate installing binaries using 'go get' in Go 1.17 and make 'go get -d' the default behavior #43684
Comments
It is not clear to me whether we should print a deprecation notice in Go 1.17 and change the default behavior in Go 1.18, or change the default behavior in 1.17 and merely print a notice informing the user of the change if their |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I‘m all for this. Its a regular source of confusion that go get fails when I pull the sources for later cross-compile and the go get fails with architecture-specific error messages. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This issue is currently labeled as early-in-cycle for Go 1.17. |
The sooner the better. Just add a short instruction for the non-Go user stumbling upon older source that "Since Go 1.17 to install an app from the source you need to use |
Friendly ping @bcmills, @jayconrod, @matloob since this is a release blocking issue and has an early in cycle label. |
Change https://golang.org/cl/305670 mentions this issue: |
Change https://golang.org/cl/305649 mentions this issue: |
'go get' will link here when the arguments refer to main packages and the -d flag is not enabled. For golang/go#43684 Change-Id: I62045a4451bb767a83d9401665420b164c6ca255 Reviewed-on: https://go-review.googlesource.com/c/website/+/305649 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
The notice is shown when 'go get' is invoked with the -d flag, and the arguments match at least one main package. This reverts CL 274552. For #43684 Change-Id: I42e6731455f22988bf72dde1d5a76d197e9e3954 Reviewed-on: https://go-review.googlesource.com/c/go/+/305670 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
If installing binaries using 'go get' is deprecated, the Go documentation should lead by example and use the recommended 'go install' command. There are:
Also, many README files in the Go repositories instruct the user to install binaries using 'go get': https://github.com/golang/blog |
@bcmills We're getting close to the freeze. Just checking in as this issue is both early-in-cycle and a release-blocker. Any updates? |
Jay implemented the deprecation notice in CL 305670. I believe we're planning to actually change the default behavior in 1.18, so I think we're done with the 1.17 parts of this.) (I'd like to confirm that understanding with Jay after he gets back, though. Leaving as release-blocker and marking okay-after-beta1 to make sure we do that.) |
@bcmills comment is correct. I still need to add a release note and update documentation for 1.17. After that, we can re-milestone to 1.18 for the default behavior change. |
Change https://golang.org/cl/318570 mentions this issue: |
Is not the If what I suspect is true then usage of |
For #43684 Change-Id: I9ce47de82203ec87e7d3683f56e6c6d61ae255f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/352151 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
With this deprecated, what is the recommended way to install something like
Forgive me if this has been brought up before (I can't recall if it has). |
@zikaeroh This change is admittedly sacrificing flexibility in exchange for simplicity and predictability. For gopls development, and in general when developing tools where a lot of changes are made across multiple modules, I expect the most convenient workflow will be to run As a user of a tool, if you want to upgrade dependencies beyond what the tool's go.mod asked for, you can do something like:
|
I see. That's effectively what I do now, I suppose (with https://github.com/zikaeroh/gotools, which does the above for gopls by converting its relative replacements to absolute replacements). I was hoping to rewrite my tool manager to use I'm sure it's rare, I'm just one to always be testing |
@zikaeroh Sorry for the extra trouble. I'm pretty sure we talked about this at some point in #40276, since it would have been easy to interpret arguments the same way |
No worries, I do agree that the ambiguity isn't worth it. I just also know that It's not too bad for me to preserve the code that automates that |
Change https://golang.org/cl/354149 mentions this issue: |
This test hasn't passed since CL 349997, but the failure was not detected because the Go project's builders do not have a 'fossil' binary installed (#48802). For #43684 Change-Id: I25544574ab48f4f146ae3795e541179e78815758 Reviewed-on: https://go-review.googlesource.com/c/go/+/354149 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
Is this done? What's left to do if not? |
Implementation work is done. I still need to take a pass through the website and update any |
Change https://golang.org/cl/355209 mentions this issue: |
Change https://golang.org/cl/355249 mentions this issue: |
For golang/go#43684 Change-Id: Ifdb0695d15961150960f7be3eb0fb44ac1f0d4d2 Reviewed-on: https://go-review.googlesource.com/c/website/+/355249 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
In module-aware mode, 'go get' no longer builds or installs packages. - 'go generate' explains build commands do not run generate commands. 'go get' is no longer a build command, so this CL removes mention of it. - 'go get' will continue to accept build flags, but they're ignored. The documentation no longer mentions them, though it does mention -x for printing VCS commands. For #43684 Change-Id: I1eea7241eecf72ba9f98238b729d91cc77ec7665 Reviewed-on: https://go-review.googlesource.com/c/go/+/355209 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Change https://golang.org/cl/355493 mentions this issue: |
Change https://golang.org/cl/357714 mentions this issue: |
Updates golang/go#43684 Updates golang/go#49101 Change-Id: I2f0c7920bcd6ce0429f1b7bdda3747bf376775f2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/357714 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Trust: Rebecca Stambler <rstambler@golang.org> Trust: Peter Weinberger <pjw@google.com> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org>
'go get' will link here when the arguments refer to main packages and the -d flag is not enabled. For golang/go#43684 Change-Id: I62045a4451bb767a83d9401665420b164c6ca255 Reviewed-on: https://go-review.googlesource.com/c/website/+/305649 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#43684 Change-Id: Ic72fd0b6d1f4ff3262115e1cdaf028c315dc18f8 Reviewed-on: https://go-review.googlesource.com/c/website/+/329500 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
In 1.17 users are presented with a deprecation warning when using go get like this. Now go install is more appropriate. Fixes golang/go#47939 Updates golang/go#43684 Change-Id: Ia5530cfd432d216029b6618d55488de89eaff835 Reviewed-on: https://go-review.googlesource.com/c/website/+/347211 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Website-Publish: DO NOT USE <dmitshur@google.com> Trust: Cody Oss <codyoss@google.com>
'go install' works properly with modules and allows installing go-contrib-init and git-codereview from anywhere. Updates golang/go#43684 Change-Id: I69edf897e9ca632f4035facc91303fc1248f9f3c Reviewed-on: https://go-review.googlesource.com/c/website/+/349249 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Trust: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
For golang/go#43684 Change-Id: Ifdb0695d15961150960f7be3eb0fb44ac1f0d4d2 Reviewed-on: https://go-review.googlesource.com/c/website/+/355249 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Proposal #40276 added a versioned
go install
variant that works outside of a module.As part of the changes approved in that proposal, we plan to deprecate the use of the
go get
to install binaries, and makego get -d
(which downloads source code for but does not build the requested packages) the default behavior.We had planned to warn about the use of
go get
to install binaries in Go 1.16 and make it the default in Go 1.17. However, in #42885 we decided to also delay the warning until Go 1.17, so that third-party projects that support the most recent two major Go releases (as the Go project itself does) can give users a single non-deprecated install command, rather than a confusing menu of commands that vary by Go version.I don't see an issue filed yet to track that change in Go 1.17, so this is that tracking issue. (CC @jayconrod @matloob)
The text was updated successfully, but these errors were encountered: