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/tools/go/vcs: adding a go-import "mod" meta tag makes RepoRootForImportPath return "unrecognized import path" error #31845

Closed
dmitshur opened this issue May 5, 2019 · 1 comment
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented May 5, 2019

x/tools/go/vcs is significantly behind the upstream cmd/go/internal/get code,
and has no support for modules. It continues to implement mechanics for GOPATH mode only.

However, it currently breaks when a "mod" VCS type is added. That type is meant to be backwards compatible and should apply in module mode only. This package should ignore it.

This is similar to issue #24751 (that one applied to older versions of cmd/go).

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label May 5, 2019
@dmitshur dmitshur added this to the Unreleased milestone May 5, 2019
@dmitshur dmitshur self-assigned this May 5, 2019
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/175219 mentions this issue: go/vcs: ignore "mod" VCS type

@golang golang locked and limited conversation to collaborators May 5, 2020
grouville pushed a commit to grouville/go-vcs that referenced this issue May 7, 2024
golang.org/x/tools/go/vcs is significantly behind the upstream
cmd/go/internal/get code, and has no support for modules. It continues
to implement mechanics for GOPATH mode only.

This change is a minimal fix to get it to continue to work
in the presence of the module mode-only "mod" VCS type
(documented at https://golang.org/cmd/go/#hdr-Remote_import_paths)
by effectively implementing IgnoreMod ModuleMode behavior.

It is similar to issue golang/go#24751 and a small subset of CL 109340
that fixed it.

This helps with module adoption by reducing the harm of adding the
"mod" VCS type for vanity import paths, something that was meant to
be backwards compatible.

While here, also backport CL 14482 (the Token to RawToken change).

Fixes golang/go#31845
Updates golang/go#24751

Change-Id: I0852f52cb9bda56879f923337c7f361df8412845
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175219
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants