-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet: +build comment error is confusingly worded #31410
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
Comments
Generate g for Go 1.12; no changes here compared to Go 1.11, however go1.12 build build fails because of +build in .s file: # lab.nexedi.com/kirr/go123/tracing/internal/xruntime ./runtime_g_amd64.s:3:1: +build comment must appear before package clause and be followed by a blank line Build problem reported upstream: golang/go#31410
Thanks beforehand for looking into this, |
CC @jayconrod |
The error could be improved (obviously there is no package clause), but it is correct to be complaining. The A more appropriate error would be ./runtime_g_amd64.s:3:1: +build comment must appear before first non-comment source line and the "blank line" should be dropped in this instance. When the blank line is relevant the message should be ./runtime_g_amd64.s:3:1: blank line must separate +build comment from first non-comment source line |
This continues b46436b (tracing/runtime: Try to add support for Go1.12): Move `+build ...` constraint in assembly files to the top, as suggested by Russ Cox: golang/go#31410 (comment) Then go stops complaining about it. The build constraint had no effect previously, but it was not caught because getg is used only on race builds and I was testing on amd64 only, which is practically almost the only ISA supported by race detector as of Go1.11 .
@rsc thanks for feedback. I confirm that moving |
@ianthehat, how do you want us to triage (@alandonovan is still listed as the primary owner on dev.golang.org/owners, but I'm guessing there might be someone else on your team stepping up for CC @josharian @mvdan (secondary owners) |
Please answer these questions before submitting your issue. Thanks!
What did you do?
Hello up there. I was updating my tracing/xruntime package for Go1.12 and hit test error:
The error here complains about
+build
directive in assembly file:---- 8< ---- (
runtime_g_amd64.s
)(https://lab.nexedi.com/kirr/go123/blob/7ee2de42/tracing/internal/xruntime/runtime_g_amd64.s)
It was working with Go1.11 and previous releases.
What did you expect to see?
Build and test succeed; test pass, as with e.g. Go1.11:
What did you see instead?
System details
The text was updated successfully, but these errors were encountered: