Skip to content
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

Closed
rakyll opened this issue Sep 7, 2016 · 10 comments
Closed

cmd/go: improve the "no buildable Go source files" message #17008

rakyll opened this issue Sep 7, 2016 · 10 comments
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Sep 7, 2016

Consider the following main source file:

// +build cgo

package main

func main() {

}


$ CGO_ENABLED=0 go build .
go build hello/subtests: no buildable Go source files in /Users/jbd/src/hello/subtests

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.

@quentinmit quentinmit added this to the Go1.8Maybe milestone Sep 7, 2016
@quentinmit
Copy link
Contributor

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.

@rakyll
Copy link
Contributor Author

rakyll commented Sep 7, 2016

(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.)

@davecheney
Copy link
Contributor

I agree, there are 7 implicit build tags applied quietly by the go tool,
go1.1, go1.2, etc. Any failure message would have to include those tags as
well as any supplied and that's going to be super confusing for newcomers,
not to mention the implicit GOOS and GOARCH tags. Especially as they cannot
see where those tags are defined or how to turn them off or on.

On Thu, 8 Sep 2016, 04:31 Quentin Smith notifications@github.com wrote:

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.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#17008 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA1Bi4vGKVYP7HYup6FPZF0VuXK0Xks5qnwLjgaJpZM4J2duO
.

@ironiridis
Copy link

What about simply mentioning "(some files were excluded due to unmet build tags)"?

@rakyll
Copy link
Contributor Author

rakyll commented Sep 13, 2016

@ironiridis, it sounds like a good and easy-to-implement idea. I will create a CL.

@rakyll rakyll self-assigned this Sep 13, 2016
@gopherbot
Copy link

CL https://golang.org/cl/29113 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/34662 mentions this issue.

gopherbot pushed a commit that referenced this issue Dec 21, 2016
…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>
@rakyll rakyll reopened this Dec 21, 2016
@rakyll rakyll modified the milestones: Go1.9, Go1.8Maybe Dec 21, 2016
@minux
Copy link
Member

minux commented Dec 21, 2016 via email

@gopherbot
Copy link

CL https://golang.org/cl/37256 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/46427 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 23, 2018
@rsc rsc unassigned rakyll Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants