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 specify custom port or .git suffix to self-hosted module repo #34436
Comments
the |
@seankhliao thx for the response. If I do not use |
|
Again, the argument to If you want to use a VCS with a specific port, you still need to serve the |
@bradleygore, please try an HTTPS server using the (There are several open-source implementations of that protocol, such as |
@bcmills - thx for the responses.
If the URL from which to pull down the package/module (if not found locally) is derived from the import path, then we have to consider both uses of the path. If the
There have already been new conventions made for the module support in general, such as the
and
This is a system I'm not in control of, so I cannot just set up an https server. Otherwise, I'd have taken the easy path already. I believe my detailed description of the issue shows I already understood how it works with the meta tag served from https and all that... I'm simply pointing out a pain point in this situation. I was able to get the owner to move the repo in question over to github and using ssh for auth, so I'm moving forward. For whatever reason, serving self-hosted bitbucket on a standard port wasn't an option for them, and it just seemed to me that may not be a unique situation so I wrote up the issue. |
This issue is almost completely orthogonal to module support. The And we do have a convention for exactly this use-case: this is exactly what the |
In general we expect your import path to begin with a DNS hostname that you control, for some value of “you”. (If you are part of an organization, and someone else within that organization controls the server at the name you want to use, then you may need to talk to that someone to get things configured appropriately.) |
As described and implied, that would be how I came to understand that exposing it on the standard port isn't an option. Given that the import mechanism allows paths and URLs, having a convention to denote a custom port to use when it's a URL instead of assuming the standard port seems like an easy/useful thing to do. I'm having trouble thinking of many things that deal with remote addresses (ssh, databases, etc..) that do not have both a) have a default port and b) provide a means of specifying a port in cases where the default isn't used. But hey, I'm just a person trying to communicate a pain point. If the answer is won't address that's fine 😄 |
Yeah, we're not planning to do this in the See previously #26912 (comment). |
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?
I'm using a private bitbucket host. I've read through a lot of articles and such, and have 2 primary issues that I don't seem to be able to find a good solution for in those:
.git
suffix should be ignored on module nameMy complete setup is outlined below. However, the real bitbucket URL is behind a VPN so I'm going to use a URL of
acme.bitbucket.com
in this example.First, I updated my
~/.gitconfig
to map the URL as needed:Verified it resolves by doing a simple
git ls-remote https://acme.bitbucket.com/repo
.Next, I set my
GOPRIVATE
toacme.bitbucket.com
a lgo env -w GOPRIVATE=acme.bitbucket.com
.Finally, in my project I tried to get a private module by using
module.git
syntax to force it to usegit
directly isntead the module resolution via http request and html document with a specialmeta
tag, as that won't work here due to a custom port being in play.So, I can understand that we'll have to just make the module named as
acme.bitbucket.com/foo
- that's fine. What I don't get is why the.git
suffix is expected to be part of the module name. If the suffix is there as a convention to tellgo get
how to retrieve the module, could it not just ignore that suffix when comparing to the actual declared module?In truth, if I could just tell it to use a specific url/port for that one dependency, then we could just use the normal way where an https request is made and an html doc comes back having this
meta
tag:<meta name="go-import" content="acme.bitbucket.com:1234/blah/blah git https://acme.bitbucket.com:1234/blah/blah/blah.foo.git">
What did you expect to see?
.git
suffix on ago get
URL, that.git
should not be required to be part of the module name.go get
to use a specific URL:port for getting the meta tag back would be fantastic.What did you see instead?
go get
to use a specific port for self-hosted repos on non-standard port.git
suffix seems to require same suffix on module name as shown in above output fromgo get -v acme.bitbucket.com/foo.git
The text was updated successfully, but these errors were encountered: