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

Closed
ianlancetaylor opened this issue Jul 10, 2019 · 6 comments
Closed

cmd/go: cannot use packages ... from different roots #33037

ianlancetaylor opened this issue Jul 10, 2019 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 10, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone Jul 10, 2019
@bcmills
Copy link
Contributor

bcmills commented Jul 10, 2019

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

@bcmills
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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 has been minimized.

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@seankhliao
Copy link
Member

Obsoleted by #47788

@golang golang locked and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants