-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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 the -i flag #41696
Comments
Are there any objections to doing this? I see plenty of emoji in favor and nothing else. |
My only potential objection is breaking people who learned to use |
@mvdan, yes, deprecate and remove means it will have a release of printing a warning that -i is going away followed by the actual removal in the next release. |
Based on the discussion above, this seems like a likely accept. |
No change in consensus, so accepted. |
Change https://golang.org/cl/266368 mentions this issue: |
build, install, and test will now print deprecation messages when the -i flag is used. clean will continue to support -i. For #41696 Change-Id: I956c235c487a872c5e6c1395388b4d6cd5ef817a Reviewed-on: https://go-review.googlesource.com/c/go/+/266368 Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Change https://golang.org/cl/268581 mentions this issue: |
test_race_install checks that 'go test -i -race …' does not rebuild already installed packages, by also passing '-v' and verifying that no package names are printed to stderr. CL 266368 added a deprecation message for the '-i' flag that caused the stderr output to be non-empty, although it still does not print any package names. Updates #41696 Change-Id: I13e10e49b7c33139be9b13f24cb393c9f58fd85d Reviewed-on: https://go-review.googlesource.com/c/go/+/268581 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
It just occurred to me that sometimes I still used I guess I can move to |
@mvdan, is there a way to use the (Perhaps |
Doesn't seem like I can use For clarity, what I liked about But maybe there are better ways to inspect what's being a bottleneck in a Go build :) There's
|
Maybe |
Change https://golang.org/cl/322629 mentions this issue: |
Instead, check that stale packages in the standard library are not rebuilt when already present in the build cache, and are not installed implicitly when rebuilt. We retain the staleness checks for the runtime package in tests involving '-i', because those are guaranteed to fail anyway if the package is stale and the "stale" failure message is arguably clearer. They can be removed if/when we remove the '-i' flag, but the runtime package is less likely to become stale because it does not have cgo dependencies. Fixes #46347 Updates #33598 Updates #35459 Updates #41696 Change-Id: I7b0a808addd930f9f4911ff53ded62272af75a40 Reviewed-on: https://go-review.googlesource.com/c/go/+/322629 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
Change https://go.dev/cl/416094 mentions this issue: |
Change https://go.dev/cl/449075 mentions this issue: |
Updates #41696. Updates #50332. Updates #41583. Change-Id: I99e96a2996f14da262570a5cb5273dcdce45df2b Reviewed-on: https://go-review.googlesource.com/c/go/+/449075 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com>
`-i` flag was removed from the Go 1.17, see golang/go#41696. Besides, this PR fixes a jsonrpc issue that has three same interface names. Signed-off-by: Xuewei Niu <justxuewei@apache.org>
`-i` flag was removed from the Go 1.17, see golang/go#41696. Besides, this PR fixes a jsonrpc issue that has three same interface names. `DOCKER_HOST_IP` is not used. Obtaining it depends on ifconfig, which is not built-in on Ubuntu. This could lead to the command not found issue. Signed-off-by: Xuewei Niu <justxuewei@apache.org>
go build
,go install
, andgo test
accept the-i
flag. Fromgo help build
:For example, if you run
go build -i example.com/a
, andexample.com/x
importsexample.com/y
,go build
installs the file$GOPATH/pkg/$GOOS_$GOARCH/example.com/y.a
.This was useful for speeding up builds before Go 1.10, since previously installed packages didn't need to be recompiled.
go build
re-used packages installed in$GOPATH/pkg
.Go 1.10 introduced the build cache, so the
$GOPATH/pkg
directory is largely obsolete. Compiled packages are now stored in$GOCACHE
. The-i
flag merely copies files out of the build cache, so there's no longer any performance advantage.The
-i
can cause errors when a target directory is not writable, as in #37962. In that issue, VSCode installed tools with-i
, which caused errors when$GOROOT/pkg
was not writable (common when Go is installed system-wide with an installer). Something causedruntime/cgo
to be recompiled (perhaps a newclang
version or flag), but it couldn't be written to$GOROOT/pkg/darwin_amd64/runtime/cgo.a
.Because of these problems, we should consider deprecating and eventually removing the
-i
flag.The text was updated successfully, but these errors were encountered: