Skip to content
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: invalidate cached binaries when statically-linked external libraries change #29843

Open
haohui opened this issue Jan 20, 2019 · 3 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@haohui
Copy link

haohui commented Jan 20, 2019

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
Copy link
Contributor

reletive to #29132 ?

@bcmills
Copy link
Contributor

bcmills commented Jan 22, 2019

Probably more closely related to #24355.

@bcmills bcmills changed the title Go cache fails to detect changes on cgo library cmd/go: invalidate cached binaries when statically-linked external libraries change Jan 22, 2019
@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels Jan 22, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 22, 2019

See #24355 (comment): for now, you will have to rebuild with -a when you change the underlying libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants