We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
% go version go version go1.12.2 linux/amd64
Yes
go env
% go env GOARCH="amd64" GOBIN="" GOCACHE="/home/cy/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/cy/go" GOPROXY="" GORACE="" GOROOT="/home/cy/go/go1.12.2" GOTMPDIR="" GOTOOLDIR="/home/cy/go/go1.12.2/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/cy/tmp/gobuildsymlinks/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build527931708=/tmp/go-build -gno-record-gcc-switches"
When I have a directory that contains only symlinks to .go source files, and I am in module mode, go build fails.
Not using module mode, or adding a single non-symlink file as a workaround, fixes the issue.
% ls -laR .: total 16 drwxrwxr-x 4 cy cy 4096 Apr 26 15:01 . drwxrwxr-x 38 cy cy 4096 Apr 26 14:58 .. drwxrwxr-x 2 cy cy 4096 Apr 26 14:59 real drwxrwxr-x 2 cy cy 4096 Apr 26 15:00 sym ./real: total 12 drwxrwxr-x 2 cy cy 4096 Apr 26 14:59 . drwxrwxr-x 4 cy cy 4096 Apr 26 15:01 .. -rw-rw-r-- 1 cy cy 66 Apr 26 14:59 main.go ./sym: total 8 drwxrwxr-x 2 cy cy 4096 Apr 26 15:00 . drwxrwxr-x 4 cy cy 4096 Apr 26 15:01 .. lrwxrwxrwx 1 cy cy 15 Apr 26 15:00 main.go -> ../real/main.go % go build -o /dev/null ./sym % go mod init gobuildsymlinks go: creating new go.mod: module gobuildsymlinks % go build -o /dev/null ./sym build gobuildsymlinks/sym: cannot load gobuildsymlinks/sym: no Go source files % echo "package main" >> ./sym/hack.go % go build -o /dev/null ./sym
go build successfully produces a binary.
go build
fails with: cannot load <package>: no Go source files
cannot load <package>: no Go source files
The text was updated successfully, but these errors were encountered:
I did not correctly test with the latest release, looks like it was fixed in 3726d91
Sorry, something went wrong.
Reopening now that I've confirmed this reproduces in the latest release (go1.12.4), but is fixed at HEAD.
Would it be possible to cherrypick this fix into a minor release?
Closing as a duplicate of #28107, but will request the cherrypick (backport) from that issue.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When I have a directory that contains only symlinks to .go source files, and I am in module mode, go build fails.
Not using module mode, or adding a single non-symlink file as a workaround, fixes the issue.
What did you expect to see?
go build
successfully produces a binary.What did you see instead?
fails with:
cannot load <package>: no Go source files
The text was updated successfully, but these errors were encountered: