golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.83k stars 17.65k forks source link

cmd/go: missing import stack for 'no buildable source files' error #9558

Closed btracey closed 9 years ago

btracey commented 9 years ago

Some packages that my code depends on went through breaking changes, which caused the disappearance of "github.com/gonum/blas/goblas". When I build my code, I get the error

brendan:~/Documents/mygo/src/github.com/reggo/reggo/supervised/nnet$ go test 
go build github.com/gonum/blas/goblas: no buildable Go source files in /Users/brendan/Documents/mygo/src/github.com/gonum/blas/goblas
FAIL    github.com/reggo/reggo/supervised/nnet [build failed]

Which is exactly the error one would expect. However, there is no explicit dependence of supervised/nnet on gonum/blas/goblas, and I had to manually hunt through the import path to find the actual dependency. Could this error be enhanced to show which package tries to import a non-existant package? I'm thinking something along the lines of

go build github.com/gonum/blas/goblas: no buildable Go source files in 
/Users/brendan/Documents/mygo/src/github.com/gonum/blas/goblas
 (imported by /Users/brendan/Documents/mygo/src/github.com/reggo/reggo/common/regtest)
rsc commented 9 years ago

See also #11456.

gopherbot commented 9 years ago

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