-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: unable to resolve submodules for custom import paths #24687
Comments
cc @rsc (just in case) |
vgo is correctly fetching the meta-data from your website. It then ends up in this code from domain.go:
At this point, your meta-data has VCS set to "git". This is correct, according to "go help importpath". However, vgo is looking for a VCS of "mod". I don't know why, that's not documented in the importpath help message. Could you try changing your VCS type to "mod" and we'll see if we can get vgo to go into that "newProxyRepo" call? |
One time, inexplicably, I got this:
I cannot reproduce it. |
Thanks for helping to look into this @jeffallen
Apologies, you caught me mid-test of a change to the
I can't do that if I want to retain backwards compatibility with regular In any case, my understanding was that the |
It appears there is actually a test for this exact case (but
which appears to be identical in form to my meta tags. The expected output from the test is:
so I can only assume this behaviour is intentional for now, i.e. support for submodules is a TODO? |
The If you wrote an import "myitcv.io/generate" then during a subsequent build modfetch.Import would try that path and then back down to "myitcv.io" which would succeed. But "vgo get" assumes it is being given module paths, not arbitrary import paths, and so it doesn't try prefixes. This is another thing to fix as part of the overall vgo get rethink (see also #24105). |
Edit: also see https://go-review.googlesource.com/c/vgo/+/114819#message-98130f3c63189bdee0a22a3509e56192134fdd8d Thanks @rsc
Noted; I'll look at adding such a meta tag once I've got the regular
Ah, ok. So if I now try:
Then I get an error
If I list the contents of
So it seems the The
I'll do some digging to see if I can work out what's going on.
Got it. This is going to require a bit of a mental shift (potentially only for me?) because I'm used to |
@rsc I'm going to park my investigation for now because I'm not entirely clear whether you are expecting this scenario (i.e. submodules within a repo) to work or whether it's simply a TODO. As you said, I can see the fallback logic taking effect. So this first call to var p string
if err, ok := err.(*ModuleSubdirError); ok {
p = err.ModulePath
} else {
p = pathpkg.Dir(path)
} But even then we lose the original submodule in the subsequent call to At this point however I'm honestly guessing as to what's intended, hence the pause! |
As a further update to this issue, just to note the I've therefore setup |
Change https://golang.org/cl/114819 mentions this issue: |
Change https://golang.org/cl/120042 mentions this issue: |
What version of Go are you using (
go version
)?Specifically
vgo
is at 890b798475a0fc2108fa88d9b2810d5f768f5752.Does this issue reproduce with the latest release?
Yes, per above.
What operating system and processor architecture are you using (
go env
)?What did you do?
See updated details in #24687 (comment)
I am in the process of trying to migratemyitcv.io/...
packages to bevgo
-compatible. In the process I want to move away from each having its own repository to use a single repo: https://github.com/myitcv/x.I have started withmyitcv.io/gogenerate
. I believe I have the variousgo-import
meta tags set correctly; indeed oldgo get
continues to work:gives:Butvgo get
does not:Thisvgo get
:works as expected:But if I now do:I get an error:What did you expect to see?
See updated details in #24687 (comment)
vgo
successfully downloadingmyitcv.io/gogenerate
which is a module within the mono-repo at https://github.com/myitcv/x.Or am I misunderstanding something here within respect to multiple modules in a single repo?What did you see instead?
Per above.
The text was updated successfully, but these errors were encountered: