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: cannot use packages ... from different roots #33037

Open
ianlancetaylor opened this issue Jul 10, 2019 · 5 comments
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 10, 2019

With current tip (CL 185517, 9d56dd8):

> go get -d github.com/yunabe/gobug30768
> go build -linkshared github.com/yunabe/gobug30768
installing shared library: cannot use packages archive/tar and internal/x/crypto/chacha20poly1305 from different roots /home/iant/go/pkg/linux_amd64_dynlink and 

I don't know what causes this error, but my immediate gripe is that it says "different roots" but one of the roots appears to be the empty string.

CC @bcmills @jayconrod

@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone Jul 10, 2019
@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jul 10, 2019

Is this in module mode, or GOPATH mode? (Could you attach go env?)

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jul 10, 2019

The extra-weird thing is that the package internal/x/crypto/chacha20poly1305 doesn't exist any more. (It's now in vendor/golang.org/x/crypto.)

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor Author

@ianlancetaylor ianlancetaylor commented Jul 10, 2019

go env output:

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/iant/.cache/go-build"
GOENV="/home/iant/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/iant/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org"
GOROOT="/home/iant/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/iant/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/iant/go/src/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-build624273732=/tmp/go-build -gno-record-gcc-switches"
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor Author

@ianlancetaylor ianlancetaylor commented Jul 10, 2019

Thanks for pointing that out. This must have something to do with existing files in $GOROOT/pkg/linux_amd64_dynlink. If I move that directory aside, I get

> go build -linkshared github.com/yunabe/gobug30768
# github.com/yunabe/gobug30768
/home/iant/go/pkg/tool/linux_amd64/link: cannot implicitly include runtime/cgo in a shared library
@ianlancetaylor ianlancetaylor modified the milestones: Go1.13, Go1.14 Jul 10, 2019
@924838

This comment was marked as off-topic.

Copy link

@924838 924838 commented Sep 8, 2019

Hi help

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.