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

x/vgo: pkgX found in both modY and modZ #24788

Closed
myitcv opened this issue Apr 10, 2018 · 2 comments
Closed

x/vgo: pkgX found in both modY and modZ #24788

myitcv opened this issue Apr 10, 2018 · 2 comments
Milestone

Comments

@myitcv
Copy link
Member

myitcv commented Apr 10, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.1 linux/amd64 vgo:2018-02-20.1

Specifically vgo is as of 5db81b5cd6ab5ee1dd1b1b0ee0843f194ab7b908 (current tip)

Does this issue reproduce with the latest release?

Yes.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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-build540309307=/tmp/go-build -gno-record-gcc-switches"
GOPROXY=

What did you do?

Per https://github.com/myitcv/x/wiki/Notes-on-migrating-to-a-Go-mono-repo, I'm in the process of migrating all myitcv.io/... packages to a mono repo at: https://github.com/myitcv/x

Notwithstanding #24751 and #24687, I have currently migrated:

  • myitcv.io/gogenerate
  • myitcv.io/immutable/...

Which leaves myitcv.io/react/... and a number of others still to do.

Now if I create a new module and try and install myitcv.io/react/cmd/reactGen:

cd `mktemp -d`
echo 'module "rubbish.com/blah"' > go.mod
vgo install myitcv.io/react/cmd/reactGen

I get:

vgo: resolving import "myitcv.io/react/cmd/reactGen"
vgo: finding myitcv.io/react (latest)
vgo: adding myitcv.io/react v0.0.0-20180401174332-7cf02ba84fd8
vgo: resolving import "myitcv.io/gogenerate"
vgo: finding myitcv.io (latest)
vgo: adding myitcv.io v0.0.0-20180409175419-9d9cad103b4f
vgo: import "myitcv.io/react/cmd/reactGen": found in both myitcv.io v0.0.0-20180409175419-9d9cad103b4f and myitcv.io/react v0.0.0-20180401174332-7cf02ba84fd8

myitcv.io/react/cmd/reactGen (which has not been migrated) depends on myitcv.io/gogenerate (which has been migrated).

To my mind this situation, whilst perhaps not common, is not unreasonable - thoughts?

What did you expect to see?

myitcv.io/react/cmd/reactGen to be successfully installed.

What did you see instead?

Installation failed with error:

vgo: import "myitcv.io/react/cmd/reactGen": found in both myitcv.io v0.0.0-20180409175419-9d9cad103b4f and myitcv.io/react v0.0.0-20180401174332-7cf02ba84fd8
@gopherbot gopherbot added this to the vgo milestone Apr 10, 2018
@myitcv
Copy link
Member Author

myitcv commented Apr 11, 2018

I'm actually going to close this issue because post this reported problem I don't think the current behaviour is unreasonable because the situation as described is also a problem for go get (which breaks my backwards compatibility).

The "issue" is the introduction of a the mono repo at the import path myitcv.io. Whilst there are myitcv.io/... packages that remain outside the mono repo (in their own repos) that have a dependency on packages in the mono repo we effectively creates an ambiguous resolution for myitcv.io (terrible wording but hopefully the point is clear). And the same is true vice versa when trying to use vgo to install a yet-to-be-migrated package.

So now I think this scenario is rather strange/unlikely for most. It feels like I've got a big-bang switch on the cards... which should be fine because the mono-repo is effectively tested in isolation.

@myitcv myitcv closed this as completed Apr 11, 2018
@myitcv
Copy link
Member Author

myitcv commented Apr 12, 2018

On reflection I wonder whether #24804 (comment) would help here from a vgo perspective.

@golang golang locked and limited conversation to collaborators Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants