-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: list -json includes assembly files among CompiledGoFiles #28749
Comments
Change https://golang.org/cl/149237 mentions this issue: |
This is a workaround for a go list regression that broke go/packages but went unnoticed by because of a missing call to packages.PrintErrors, added here. Updates golang/go#28749 Change-Id: I1819a6143134a422791106ac037d3458ef864322 Reviewed-on: https://go-review.googlesource.com/c/149237 Reviewed-by: Ian Cottrell <iancottrell@google.com>
var srcfiles []string // .go and non-.go
srcfiles = append(srcfiles, gofiles...)
srcfiles = append(srcfiles, sfiles...)
srcfiles = append(srcfiles, cfiles...)
srcfiles = append(srcfiles, cxxfiles...)
b.cacheSrcFiles(a, srcfiles)
We should make cmd/go filter out non-Go files. There's a comment in the go/packages source code, where it manually skips
If we don't fix this for 1.12, we'll have to keep the workaround in go/packages for a long time. And expand it to cover I'll send a CL to expand the go/packages workaround, but I think it might be good to know how risky it is to fix this yet in cmd/go. |
Change https://golang.org/cl/163597 mentions this issue: |
Updates golang/go#28749 Change-Id: I76eb264f61b511fec7e05cef1bdd35e1c7fd603b Reviewed-on: https://go-review.googlesource.com/c/163597 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Change https://golang.org/cl/313131 mentions this issue: |
Also include SWIG C++ files in cgo hash. For #28749 Fixes #37098 Change-Id: I6d912db2788200c2abdf328e382d4fbefda0a9ac Reviewed-on: https://go-review.googlesource.com/c/go/+/313131 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Hello from the future - I just ran into this :) Would a patch be welcome? Edit: I am also confused by the workaround in go/packages; it seems to imply this was fixed in cmd/go in Go 1.12, but I still see the same problem. For example:
|
For those wanting a workaround which isn't tied to
|
Change https://go.dev/cl/451285 mentions this issue: |
Looking at the fix CL, I believe this bug was introduced in https://go.dev/cl/148904 (ironically, authored by @alandonovan 😅). |
Heh, that fellow must be feeling pretty stupid. Thanks for the fix. |
Change https://go.dev/cl/452059 mentions this issue: |
Looking forward to deleting my workaround in a year or two :) |
Before this change, the workaround for golang/go#28749 filtered out the files from OtherFiles from CompiledGoFiles to remove non-go files that are appearing in CompiledGoFiles. But OtherFiles requires NeedFiles, so the value of NeedFiles is affecting CompiledGoFiles which should only be controlled by NeedCompliedGoFiles. Instead remove all files that don't look like Go files. Fixes golang/go#56632 Change-Id: Ib5e310f39f2470ee3b3488b6c4b74b70e3164d4c Reviewed-on: https://go-review.googlesource.com/c/tools/+/452059 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Matloob <matloob@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com>
The text was updated successfully, but these errors were encountered: