cmd/go: build caching failed to notice cgo header changes #25419
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +3868a371a8 Tue May 15 20:47:43 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes.
Example
Two files t.go and t.h are needed. t.go just calls a static function defined in t.h.
Reproduction steps
go build ignores changes to the cgo header file.
Discussion
Of course, changes like this is arguably hard for the Go tool to detect, and in fact, sometimes, we
don't want the Go tools to read all transitively required header files just to determine whether
to rebuild a package that uses cgo. However, the current behavior is very confusing, as it quietly
disregards changes to the header files, even the one in the package's directory.
I think we either should handle this completely (i.e. tap into gcc's -MM and handle changes to any transitively included files), or at least handle the directly included header file in Go source files (and make this problem clear in release notes.)
The text was updated successfully, but these errors were encountered: