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: problem with multimodule repos hosted on Gitlab #26017

Closed
mwf opened this issue Jun 22, 2018 · 2 comments
Closed

x/vgo: problem with multimodule repos hosted on Gitlab #26017

mwf opened this issue Jun 22, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mwf
Copy link

mwf commented Jun 22, 2018

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

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

Latest vgo:

commit 48cc2d845c20abc7a0c133d2b4c8e05eef6f4ebe (HEAD -> master, origin/master, origin/HEAD)
Author: Russ Cox <rsc@golang.org>
Date:   Wed Jun 20 15:45:11 2018 -0400

    cmd/go/internal/modcmd: add mod -graph

What did you do?

I have a test project with multiple submodules which works just fine - https://github.com/mwf/vgotest

$ cd example
$ vgo run main.go
It's stderr: foo bar 1
It's stdout: 1 2 3 4 5

vgo understands the submodules just fine if hosted on github.com
The problem appears when you host the same code (import paths are modified, of course) with Gitlab (doesn't matter, private server or gitlab.com).

Please check https://gitlab.com/mwf/vgotest

$ cd example
$ vgo run main.go
vgo: resolving import "gitlab.com/mwf/vgotest/types"
vgo: finding gitlab.com/mwf/vgotest latest
vgo: finding gitlab.com/mwf/vgotest (latest)
vgo: adding gitlab.com/mwf/vgotest v0.0.0-20180622201315-83467624a739
vgo: import "gitlab.com/mwf/vgotest/types" [/Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types]: open /Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types: no such file or directory
vgo: import "gitlab.com/mwf/vgotest/types/printers/stderr" [/Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types/printers/stderr]: open /Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types/printers/stderr: no such file or directory
vgo: import "gitlab.com/mwf/vgotest/types/printers/stdout" [/Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types/printers/stdout]: open /Users/ikorolev/.gvm/pkgsets/go1.10.1/global/src/mod/gitlab.com/mwf/vgotest@v0.0.0-20180622201315-83467624a739/types/printers/stdout: no such file or directory

What did you expect to see?

I expect vgo to find the submodules in project, no matter which .git-repo hosting is used.

What did you see instead?

vgo just can't determine the correct module root.

$ vgo get gitlab.com/mwf/vgotest/types@latest
vgo get gitlab.com/mwf/vgotest/types: module root is "gitlab.com/mwf/vgotest"
vgo: resolving import "gitlab.com/mwf/vgotest/types"
vgo: finding gitlab.com/mwf/vgotest latest
vgo: finding gitlab.com/mwf/vgotest (latest)
vgo: adding gitlab.com/mwf/vgotest v0.0.0-20180622201315-83467624a739

First I tried to follow the Download protocol described in https://research.swtch.com/vgo-module, but then I checked it with github.com - it seems it doesn't follow it.
So there must be some rules to determine the root in your vgo code, which work OK for github but fail for gitlab.

I also tried all potential solutions like adding go.mod to the project root, tagging the repo in different ways - nothing helps :)

Could we do anything here?

I did some issue search - #24044 is fixed, nothing else connected to Gitlab.

@gopherbot gopherbot added this to the vgo milestone Jun 22, 2018
@myitcv
Copy link
Member

myitcv commented Jun 22, 2018

Could well be related to #24687. In which case this is addressed by https://go-review.googlesource.com/c/vgo/+/120042.

/cc @rsc

@myitcv myitcv added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 22, 2018
@mwf
Copy link
Author

mwf commented Jul 6, 2018

@myitcv #24687 is fixed and the issue has gone, thank you!

Closing.

@mwf mwf closed this as completed Jul 6, 2018
@golang golang locked and limited conversation to collaborators Jul 6, 2019
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

3 participants