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: improve the "no buildable Go source files" message #17008
Comments
I suggest only changing the error message if there was a source file that was ignored due to build tags. Otherwise I think it will confuse new users to see the build tags. |
(It might be beyond the scope of this bug, but it might be nice to think how the go tool can report a package's build tags.) |
I agree, there are 7 implicit build tags applied quietly by the go tool, On Thu, 8 Sep 2016, 04:31 Quentin Smith notifications@github.com wrote:
|
What about simply mentioning "(some files were excluded due to unmet build tags)"? |
@ironiridis, it sounds like a good and easy-to-implement idea. I will create a CL. |
CL https://golang.org/cl/29113 mentions this issue. |
CL https://golang.org/cl/34662 mentions this issue. |
…rrors" This reverts commit eee727d (https://golang.org/cl/29113) The " (.go files ignored due to build tags)" error message is not always accurate. Fixes #18396 Updates #17008 Change-Id: I609653120603a7f6094bc1dc3a83856f4b259241 Reviewed-on: https://go-review.googlesource.com/34662 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
If we fix it again, perhaps we should just make go build -x
show the reason for each ignored file.
$ go build -x cmd/go
# file cmd/go/bootstrap.go ignored due to build tag cmd_go_bootstrap not
satisfied.
WORK=/tmp/go-build638479375
mkdir -p $WORK/cmd/go/_obj/
...
Not only it's clearer, it will actually help more you're debugging
a build tag problem. Right now it's very hard to debug such
problems (precisely because usually it's caused by a typo,
and it's really really hard for people to spot such things.
and this will also help if we introduce a new GOOS, and
make some random x_NEWGOOS.go excluded. People
who debug this issue might not know about this new GOOS)
|
CL https://golang.org/cl/37256 mentions this issue. |
CL https://golang.org/cl/46427 mentions this issue. |
Consider the following main source file:
The error message is very unfriendly for the new comers. It should better say "no buildable Go sources for buildtags=%q". And the user can double check if they are setting all the build tags right or will understand that the package is not supporting their build tag combination.
The text was updated successfully, but these errors were encountered: