-
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: 'go build' does not cache linked executables #31629
Comments
/cc @bcmills @jayconrod |
Can you give us more info to reproduce this? Specifically, we'd be looking for a test repository that reproduces this problem and output of two consecutive runs of |
I've added the output of three consecutive I will look into providing a test repo, but I reckon it might take some time since the code is not open source. |
It looks like all the actions in the second and third logs are link actions. That makes sense I guess. Executables never get written to the cache, but when executables are installed (with Executables were originally not written to the cache because before 1.12, caching was optional, and there was nowhere to put them outside of the cache if we weren't installing them. Now that the cache is mandatory, we could store executables in the cache fairly easily. This may increase cache size significantly though, and it doesn't seem like there's much benefit. |
@jayconrod You say that executables never get written to the cache, and mention
As I understand it they should be written to the cache, although a separate one, even without using the |
I think that snippet is referring to packages (.a files) only. I don't see mention of binaries. When building with |
I'm experiencing the exact same thing. Never been able to do any incremental builds. Go build or even Go install will build the whole thing every time go version go1.9.3 linux/amd64 I can give you the complete project to investigate once you let me know how I can upload files for you |
@jeffsaremi, per the release policy Go 1.9 has not been supported since 2018-08-24 (when Go 1.11 was released). Please upgrade to a supported version (1.12 or 1.13) and see whether you can still reproduce the issue. |
Thank you. I shall do as instructed and report back |
As per @bcmills recommendation, I upgraded go and the problem is solved. go build now does incremental build with beautifully go version go1.13 linux/amd64 |
@jeffsaremi I guess you did |
No I did a plain go build. It was smart enough not to rebuild the final binary. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I expected
go build
to do an incremental build, but it seems like it recompiles everything every time I build. Seego install
for comparisonWhat did you see instead?
I expected the second
go build
to be incremental, rather than rebuilding everything again.The text was updated successfully, but these errors were encountered: