-
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/cover: doesn't work with tip when using //go: annotations #18285
Comments
They look like linker errors. Does it work without |
The cmd/cover package just generates annotated source files. So just guessing that some modification to runtime package during Go 1.8 development cycle breaks the existing plumbing work for shared libraries. |
Change-Id: Icb633c7b3e13504a5d26c8d947c76cb0dd800269
Okay, root cause is that the compiler directives in Confirmed with, $ go tool cover -mode=count runtime/os3_solaris.go
# .. notice that the compiler directives are present ...
$ ../pkg/tool/linux_amd64/cover -mode=count runtime/os3_solaris.go
# ... notice absence of compiler directives ... This is happening because of my own change: golang.org/cl/30161. Coverage instrumentation removes all comments that are not present as nodes in the AST; because they were interfering with inserted code. Parser doesn't keep these compiler directives as nodes in AST, but instead as Working on the fix. PS: The issue will go away with JayNakrani@4a16ac8 because doing that makes parser keep those comments in AST. Parser only keeps comments into the tree that can potentially be document-comments |
I think Ian had told me some time earlier that the compiler directives are associated with something (a function or variable, etc). If that's the case, fix would be JayNakrani@4a16ac8. Let me confirm with him again. |
Thanks for the investigation. As you mentioned above, a few packages that import runtime symbols by using /CC @ianlancetaylor |
CL https://golang.org/cl/34563 mentions this issue. |
golang.org/cl/34563 takes care of such compiler directives that aren't attached to any node in the AST. My another attempt to let printer print such compiler directives, failed. Because |
With go1.7.4:
With devel +0716fef:
The text was updated successfully, but these errors were encountered: