-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: packages in different GOPATH are not rebuilt when modified #3749
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
Labels
Milestone
Comments
Hello, you can reproduce exactly following these steps: D:\>echo %GOPATH% D:\code;D:\devel\trunk D:\>type D:\code\src\demo\main.go package main import "dddd" func main() { dddd.F() } D:\>type D:\devel\trunk\src\dddd\dddd.go package dddd func F() { println("ccc") } D:\>go install demo D:\>demo ccc // here, edit the content to "eee" D:\>type D:\devel\trunk\src\dddd\dddd.go package dddd func F() { println("eee") } D:\>go install demo D:\>demo ccc D:\> |
It's easy to reproduce this issue. The build flags are shared by the build, install, run, and test commands: -a force rebuilding of packages that are already up-to-date. Command go Compile packages and dependencies http://golang.org/cmd/go/#Compile_packages_and_dependencies For example, D:\>go install -a demo |
It's easy to reproduce this issue. The build flags are shared by the build, install, run, and test commands: -a force rebuilding of packages that are already up-to-date. Command go Compile packages and dependencies http://golang.org/cmd/go/#Compile_packages_and_dependencies For example, to solve the problem, run, D:\>go install -a demo |
I can reproduce your problem now, thank you. And I can reproduce it on both windows and linux. Trying to understand why it is happening. Here is the code: http://code.google.com/p/go/source/browse/src/cmd/go/pkg.go#515 If you look at the comment just above: // ... If a package p is not in the same tree as any // package named on the command-line, assume it is up-to-date // no matter what the modification times on the source files indicate. // This avoids rebuilding $GOROOT packages when people are // working outside the Go root, and it effectively makes each tree // listed in $GOPATH a separate compilation world. // See issue #3149. Given that comment, in addition to extract from http://code.google.com/p/go/source/detail?r=a461bcce05f6 commit message: * Do not recompile packages across roots (Fixes issue #3149 .) I surmise it is working as intended. So I should be closing this issue as such. But, as a fellow programer, I can see this behavior confusing in your scenario. Perhaps this needs to be documented somewhere at the very least. Leaving it for others to decide what to do. Alex Status changed to Accepted. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by diogin:
The text was updated successfully, but these errors were encountered: