by dingdingdang · 6y ago · 0 comments
>> pkg.go.dev fetches the list of modules from proxy.golang.org: a closed-source proxy through which all of your go module fetches are being routed and tracked
>> pkg.go.dev hard-codes a list of centralized git hosting services [that are the only allowed ones]
So how in the world did git.lukeshu.com get to be on that list?
Also: hi Luke! And thank you!
Actually, pkg.go.dev needs to have some way of figuring out where to link to, so it's not necessarily easy to automatically make links that work for 100% of the sites. That's not "a blatant failure to comprehend the fundamentally decentralized nature of git hosting", that's having to deal with a large ecosystem spread out over thousands of domains. Go's model is a lot more decentralized than most other package systems (which also makes stuff like this harder).
One problem is that the import path doesn't really give you enough information to totally figure out how to fetch the package. It's treated like a URL, and then the go-source tag comes in to relate it to something VCS-controlled. If we encoded the VCS into the import, we could e.g. have "git+https://git.sr.ht/~sircmpwn/getopt" as the import path, or we could move the import details into a separate file (like go.mod).
But if we assume that the import path and go.mod formats are fixed, then we still have more things we could do. For example, why this:
<meta name="go-import" content="git.sr.ht/~sircmpwn/getopt git https://git.sr.ht/~sircmpwn/getopt" />
When we could have this: <link rel="alternate" type="application/x-git-http" "https://git.sr.ht/~sircmpwn/getopt" />
<link rel="alternate" type="application/x-git-ssh" "git@git.sr.ht:~sircmpwn/getopt" />
And why this: <meta name="go-source" content="git.sr.ht/~sircmpwn/getopt https://git.sr.ht/~sircmpwn/getopt
https://git.sr.ht/~sircmpwn/getopt/tree/master{/dir}
https://git.sr.ht/~sircmpwn/getopt/tree/master{/dir}/{file}#L{line}">
When the same tag could be "source-browser" or something similar? I'm sure many projects other than Go would be very happy to have features like this standardized and available for all of them to use, but the Go team sees no further than its own nose when designing this sort of thing.And furthermore, with the specific case of hardcoded software hosts on pkg.go.dev, why isn't it using the go-source meta tags to look up how to create links to files & line numbers? You guys forced this upon us and then don't even use it? There's no reason to hard-code regexes for various git domains when you could just fetch it like godoc.org does.
https://godoc.org/git.lukeshu.com/go/libfastimport
So that's not against pkg.dev. Did somebody look into why?
Anyway it seems that the repo was not added to pkg.dev automatically:
https://github.com/golang/go/issues/38326
and the automatic fetching should work now:
The way this works (or rather, worked) is that you first need to "go get" a module and then it gets picked up by the pkg.go.dev system. This works like that for every site, and was kind weird and confusing, although as you mentioned this was improved on recently. Either way: not related to that module being on sr.ht; that's just coincidental.
https://news.ycombinator.com/item?id=24024130
It doesn't work on godoc.org not because they don't recognize your domain, but because cgit doesn't have go-source meta tags.
[1] https://golang.org/cmd/go/#hdr-Module_configuration_for_non_...
https://console.cloud.google.com/bigquery?project=the-psf&p=...
Whereas AFAIK godoc.org only supported git. IMHO support for a variety of SCMs makes pkg.go.dev a huge improvement.
Support for "go get" and pkg.go.dev via fossil-scm does require some golang-specific meta tags, as TFA exclaims. But why is that a big deal, it's a golang repository after all?