-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/internal/get: VCS path regexp omits characters accepted by CheckImportPath #31376
Comments
Duplicate of #26134 |
The regular expression that looks for the go/src/cmd/go/internal/get/vcs.go Line 1028 in ccd9d9d
Testing against that (playground) reveals that the problem here is that the go/src/cmd/go/internal/get/path.go Lines 125 to 136 in 3cb92fc
|
This needs a fix, but it's not obvious to me whether the VCS path should be made more permissive, or |
I'm confused by whether the |
When Launchpad code hosting added git support it was necessary to add +git as a path component to avoid namespace clashes with Bazaar branches. Launchpad code hosting is pretty much stuck with it, but yes, + will be very uncommon, unlike other special characters such as ~. The trailing .git is optional, and only in my example because I wanted to skip the https: VCS detection (probably necessary for private repositories, when I get that far). |
I checked the new module index for other existing packages that use the (That's not to say that they don't exist, but if they do they're rare.) Perhaps we should disallow |
If this is not a breakage introduced after Go 1.12, I'm inclined to leave deciding what to do until after Go 1.13 is out. |
@bcmills This issue is just rolling forward through release milestones. Should we just move it to the Backlog milestone? That's what Backlog is for. Thanks. |
Unicode characters is #29101. Assuming we exclude that from this discussion, this discussion is only about whether to start using + in paths. Technically the looser module restrictions mean someone could set up a non-VCS-backed module with + today, but all the VCS-backed stuff can't use it. There's nothing with + in the module index (index.golang.org). |
It seems like we should reject + and wait for complaints. |
The original complaint is that Launchpad git hosting URLs such as https://git.launchpad.net/~stub/+git/go-eggs do not work with 'go get', and now Go modules. It is not used anywhere, because it doesn't work (and never has). |
This issue is currently labeled as early-in-cycle for Go 1.16. |
Change https://golang.org/cl/250919 mentions this issue: |
"+" was allowed in some vcs regular expressions, but doesn't seem to be used in practice anymore. Stop accepting it in import paths. This is being submitted early in the Go 1.16 cycle so that if a usage is detected it can be reverted. See the discussion in golang.org/issue/31376 for more details. For golang/go#31376 Change-Id: I392fcdcf829886bd0a28450ba5e399e64dd01559 Reviewed-on: https://go-review.googlesource.com/c/mod/+/250919 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This has affected me, but it's not a significant issue. I have a module containing a main package with the name |
Change https://golang.org/cl/282512 mentions this issue: |
Go 1.16 will no longer accept "+" as a character in a module or import path. Amend the module docs to reflect that change. Fixes golang/go#31376 For golang/go#43052 Change-Id: Ie0b58888cf5023c69f112dcc32137fc69af6c659 Reviewed-on: https://go-review.googlesource.com/c/website/+/282512 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Attempted to fetch the git repo containing a go package, publicly available at:
Per
go help importpath
, the following should attempt a git download using https://, falling back to git+ssh://Attempting to force ssh per
git help environment
does not helpWhat did you expect to see?
go get
attempt to clone the git repo at https://git.launchpad.net/~stub/+git/go-eggs, and if that failed, fall back to cloning the git repo at git+ssh://git.launchpad.net/~stub/+git/go-eggs.Per
go help importpath
, because the import path has a version control qualifier (.git
) then no attempt should be made to attempt to get the import over https: to look for a tag.What did you see instead?
Go get attempts to parse meta tags from https://, which fails. No attempt is made to clone the git repo.
The text was updated successfully, but these errors were encountered: