-
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
cmd/go: cannot resolve subpackages of unfetched modules #26602
Comments
This was found while attempting to produce a module definition for |
I can reproduce this by moving a small block of go/src/cmd/go/testdata/script/mod_get_commit.txt Lines 11 to 18 in db810b6
(CC @rsc, but I'm going to see if I can fix it tomorrow.) |
This turned out to be a complex of compensating bugs and surprises.
As a result, a bunch of our existing tests end up compiling and installing empty packages in response to |
Change https://golang.org/cl/127936 mentions this issue: |
Change https://golang.org/cl/127935 mentions this issue: |
Change https://golang.org/cl/128136 mentions this issue: |
modload.Import contains a loop that looks for the module containing a package. Because we overload Import to locate both packages and modules, that loop contains a bunch of special-cases for modules with empty roots. In this change, we factor out the loop into a new function (QueryPackage) and use that directly in modget.getQuery. That restores the invariant that the paths passed to modload.Import must be importable packages, and fixes 'go get' lookups for packages that have moved between a module and submodules with the same path prefix. Updates #26602. Change-Id: I8bc8340c17f2df062d03ce720f4dc18b2ba406b2 Reviewed-on: https://go-review.googlesource.com/128136 Reviewed-by: Russ Cox <rsc@golang.org>
In the fix for #26238, @rsc introduced a new
+incompatible
convention for projects using legacy build tags.However, that mechanism does not seem to work for resolving packages that are not at the root of the module tree.
The text was updated successfully, but these errors were encountered: