golang / go

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

gollvm: cmd/go: httpguts, hpack, idna are not using a known version control system #41368

Open advancedwebdeveloper opened 4 years ago

advancedwebdeveloper commented 4 years ago

What version of Go are you using (go version)?

$ go version
go version go1.15rc2 gollvm LLVM 12.0.0git linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/tools"
GCCGO="/usr/local/bin/llvm-goc"
AR="ar"
CC="/usr/bin/clang"
CXX="/usr/bin/clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build842983669=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

I was trying to get StreamSets Data Collector Edge working.

$ go get -u github.com/streamsets/datacollector-edge

What did you expect to see?

At least - no warning or errors.

What did you see instead?

package golang.org/x/net/http/httpguts: directory "/usr/local/src/golang.org/x/net/http/httpguts" is not using a known version control system package golang.org/x/net/http2/hpack: directory "/usr/local/src/golang.org/x/net/http2/hpack" is not using a known version control system package golang.org/x/net/idna: directory "/usr/local/src/golang.org/x/net/idna" is not using a known version control system

@bradfitz, @FiloSottile , @alanbato, @mpvl - any suggestions?

Ivan

alanbato commented 4 years ago

None at all, I don't even use go 🤔

Maybe you meant to tag someone else? 😅

ianlancetaylor commented 4 years ago

CC @thanm @cherrymui

Do you have any replace directives in your go.mod file?

advancedwebdeveloper commented 4 years ago

CC @thanm @cherrymui

Do you have any replace directives in your go.mod file? @ianlancetaylor , which file are you referring here?

advancedwebdeveloper commented 4 years ago

https://github.com/streamsets/datacollector-edge project does not contain any go.mod file.

thanm commented 4 years ago

I took a look at this -- I can reproduce, but I don't have any insight into what's going wrong. I don't see any replace directives at least as far as I can tell.

jayconrod commented 4 years ago

I don't think this is related to modules. This error would be reported in GOPATH mode if a repository root path resolves to a directory in $GOPATH/src but that directory doesn't actually contain a repository subdirectory (like .git).

Does the directory $GOPATH/src/golang.org/x/net/.git exist? What about $GOPATH/src/golang.org/x/net/http/httpguts/.git?

thanm commented 4 years ago

Does the directory $GOPATH/src/golang.org/x/net/.git exist?

Yes, $GOPATH/src/golang.org/x/net/.git exists.

What about $GOPATH/src/golang.org/x/net/http/httpguts/.git?

No, that does not exist.

bcmills commented 4 years ago

Those three packages are vendored into the standard library: https://github.com/golang/go/blob/86dbeefe1f2770daad3c8d8b46a8b7f21b2c69e1/src/vendor/modules.txt#L14-L17

So probably this has something to do with standard-library vendoring in GOPATH mode, but I'm not sure what.

bcmills commented 4 years ago

Yeah, that go env output indicates GOROOT="/usr/local", so the path /usr/local/src/golang.org/x/net/http/httpguts would be in GOROOT/src, but it's presumably not in GOROOT/src because the correct path there (in Go 1.15rc2) would be /usr/local/src/vendor/golang.org/x/net/http/httpguts.

advancedwebdeveloper commented 4 years ago

@bcmills , so what should be patched?

bcmills commented 4 years ago

@advancedwebdeveloper, that depends on what the root cause turns out to be. 😅

Could you run ls -d /usr/local/src/golang.org and ls -d /usr/local/src/vendor/golang.org and post the results?

advancedwebdeveloper commented 4 years ago

I don't think this is related to modules. This error would be reported in GOPATH mode if a repository root path resolves to a directory in $GOPATH/src but that directory doesn't actually contain a repository subdirectory (like .git).

Does the directory $GOPATH/src/golang.org/x/net/.git exist?

@jayconrod , $GOPATH is not defined (for some reason) - and that a "by default" state, since I have installed compiled "release" build of gollvm. Better ask @thanm and @cherrymui , what is the problem with $GOPATH, during the installation process.

But a de-facto directory does exist:

~$ file $GOPATH/src/golang.org/x/net/.git /src/golang.org/x/net/.git: cannot open `/src/golang.org/x/net/.git' (No such file or directory) ~$ file go/src/golang.org/x/net/.git go/src/golang.org/x/net/.git: directory ~$ file go/src/golang.org/x/net/.git/ go/src/golang.org/x/net/.git/: directory ~$ ls go/src/golang.org/x/net/.git/ FETCH_HEAD HEAD ORIG_HEAD branches config description hooks index info logs objects packed-refs refs $ cat go/src/golang.org/x/net/.git/HEAD ref: refs/heads/master

What about $GOPATH/src/golang.org/x/net/http/httpguts/.git?

Well, in case of this file - neither de-facto nor relative path/fiel exists:

~$ file $GOPATH/src/golang.org/x/net/http/httpguts/.git /src/golang.org/x/net/http/httpguts/.git: cannot open /src/golang.org/x/net/http/httpguts/.git' (No such file or directory) ~$ file go/src/golang.org/x/net/http/httpguts/.git go/src/golang.org/x/net/http/httpguts/.git: cannot opengo/src/golang.org/x/net/http/httpguts/.git' (No such file or directory) $ ls go/src/golang.org/x/net/http/httpguts/ guts.go httplex.go httplex_test.go $ ls -a go/src/golang.org/x/net/http/httpguts/ . .. guts.go httplex.go httplex_test.go

Ivan

advancedwebdeveloper commented 4 years ago

Yeah, that go env output indicates GOROOT="/usr/local", so the path /usr/local/src/golang.org/x/net/http/httpguts would be in GOROOT/src, but it's presumably not in GOROOT/src because the correct path there (in Go 1.15rc2) would be /usr/local/src/vendor/golang.org/x/net/http/httpguts.

@bcmills , it is hirely undesirable to use system sub-folders - I would be glad to stick to my directories inside the home folder. I can check by specifying $GOPATH (so it would point to "~/go") and report. Ivan

advancedwebdeveloper commented 4 years ago

@advancedwebdeveloper, that depends on what the root cause turns out to be. 😅

Could you run ls -d /usr/local/src/golang.org and ls -d /usr/local/src/vendor/golang.org and post the results?

Surely I am able to do that:

$ ls -d /usr/local/src/golang.org ls: cannot access '/usr/local/src/golang.org': No such file or directory

dir. does not exist

$ ls -d /usr/local/src/vendor/golang.org ls: cannot access '/usr/local/src/vendor/golang.org': No such file or directory

same here.

Ivan

gopherbot commented 4 years ago

Change https://golang.org/cl/256319 mentions this issue: libgo: don't put golang.org packages in zstdpkglist.go

gopherbot commented 4 years ago

Change https://golang.org/cl/256362 mentions this issue: gollvm: don't add golang.org packges to zstdpkglist.go