-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: documentation cmd/go get claims "installs" but "go install" has a different effect #15825
Comments
I can't recreate this problem. Can you show the output of |
@ianlancetaylor thanks for trying to reproduce my problem. Nevertheless the missing "compile" in the "go get" section already is an inconsistency in the documentation. And given that I have a situation where I get an unexpected rebuild, some hints |
In my problem-showing-setup I think the go version was switched a few times: the rebuild happens with github.com/mattn/go-sqlite3 all the time and I've noticed it Given the documentation this should probably not have happened. |
I don't have any suggestions, other than running I don't think we can fix this without a way to reproduce the problem, or at least a trace showing what is happening. |
@ianlancetaylor thanks for your response. The technical part (which initially matched the documentation inconsistency) needs to be investigated |
CL https://golang.org/cl/23925 mentions this issue. |
Make the documentation for `go get` match the documentation for `go install`, since `go get` essentially invokes `go install`. Update #15825. Change-Id: I374d80efd301814b6d98b86b7a4a68dd09704c92 Reviewed-on: https://go-review.googlesource.com/23925 Reviewed-by: Andrew Gerrand <adg@golang.org>
https://groups.google.com/forum/#!topic/golang-nuts/7t9PFp3zYPo seems to be related to this case. You |
If sqlite3 is present on disk it will not be fetched and therefore not As you saw in that thread I recommend using go install -v always. This will On Thu, 16 Jun 2016, 15:59 Sascha L. Teichmann notifications@github.com
|
@davecheney but what is your reason to recommend "go install" over "go get" when "go get" |
@davecheney Oh, are you saying that "go get" will not compile and install, if it already finds a version on disc? In my test case that would mean I got the "download" and "compile" steps done, but not the "install" step? How could I create this situation? (I probably only used "go get" maybe some "go installs" and later go build on my local source code. The local source finds the go-sqlite3 pacages and uses it, so it must be compiled at the right place I think.) |
I think @davecheney is recommending the To be clear: |
Closing as I don't see anything else to do here |
Please answer these questions before submitting your issue. Thanks!
go version
)?go1.6.2 linux/amd64
go1.6.2 linux/386
go env
)?GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Trying to build a software from source with dependencies
and then continue developing this software in the cycle:
change code, recompile, run.
The dependencies shall not be recompiled each time.
Using
go get -u -v github.com/mattn/go-sqlite3
and then trying to recompile with "go build"
with lead to recompiling go-sqlite3 each time, though it did not change.
After an
go install github.com/mattn/go-sqlite3
It works without recompiling.
The documentation to "go get" says:
https://golang.org/cmd/go/
"""Download and install packages and dependencies
Get downloads and installs the packages named by the import paths, along with their dependencies. """
and "go install" says:
"""Compile and install packages and dependencies
Install compiles and installs the packages named by the import paths, along with their dependencies. """
There are two inconsistencies:
a) go get seems to also compile, otherwise I could not use it and there wouldn't be the reference
to the build flags. But compilation is not mentioned.
b) go install seems to do something else than just "install", but it is not documented.
Reason: there is a different behaviour for recompilation, but both commands list "install"
and "go install" does not describe a different additional action.
Both inconsistencies solved, so my mental model about what is happening can
be more easily constructed.
Possily: An explanation when recompilation checks will be happen and how to avoid them.
The inconsistencies above.
The text was updated successfully, but these errors were encountered: