cmd/go: invalidate cached binaries when statically-linked external libraries change
haohui opened this issue · 3 comments
haohui commented
What version of Go are you using (go version
)?
go 1.11.4
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
amd64
What did you do?
We have a number of C libraries that need to be linked externally. We did it by manually passing CGO_LDFLAGS
in the build process. Whenever we change the library, go cache does not detect the changes and thus the binary is not always relinked.
Turning GOCACHE off and deleting the binary will solve the problem. As go 1.12 will require the cache to be turned on, the workaround will no long work. What would be the best way to go forward?
bronze1man commented
reletive to #29132 ?
bcmills commented
See #24355 (comment): for now, you will have to rebuild with -a
when you change the underlying libraries.