[MacPorts] #60802: gopls downloads things at build time
MacPorts
noreply at macports.org
Sun Aug 16 16:29:54 UTC 2020
#60802: gopls downloads things at build time
-------------------------+----------------------
Reporter: ryandesign | Owner: ra1nb0w
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.6.2
Resolution: | Keywords:
Port: gopls |
-------------------------+----------------------
Comment (by danieltrautmann):
I've went through all other Go based ports and found one hack which you
can see here:
https://github.com/macports/macports-
ports/blob/master/devel/shfmt/Portfile#L130
The dependency is fetched via `go.vendors` and then moved inside the
GOPATH.
Nearly no other port seems to care about downloading stuff in the build
phase.
Besides that I reverse engineered the way how Bazel (A build tool I use)
does fetch Go dependencies, which boils down to using plain `go mod
download`. I also checked hat `go mod download` actually does, which is
this:
{{{
$ go mod download -x mvdan.cc/xurls/v2
# get https://proxy.golang.org/honnef.co/go/tools/@v/v0.0.1-2020.1.4.mod
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.3.0.mod
# get https://proxy.golang.org/github.com/yuin/goldmark/@v/v1.1.32.mod
# get https://proxy.golang.org/github.com/sergi/go-diff/@v/v1.1.0.mod
# get
https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20200625203802-6e8e738ad208.mod
# get
https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20200625001655-4c5254603344.mod
# get
https://proxy.golang.org/mvdan.cc/gofumpt/@v/v0.0.0-20200709182408-4fd085cb6d5f.mod
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.mod
# get
https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20200625203802-6e8e738ad208.mod:
200 OK (1.217s)
# get https://proxy.golang.org/github.com/yuin/goldmark/@v/v1.1.32.mod:
200 OK (1.217s)
# get
https://proxy.golang.org/mvdan.cc/gofumpt/@v/v0.0.0-20200709182408-4fd085cb6d5f.mod:
200 OK (1.217s)
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.mod: 200 OK
(1.242s)
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.3.0.mod: 200 OK
(1.242s)
# get
https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20200625001655-4c5254603344.mod:
200 OK (1.242s)
# get
https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20200323222414-85ca7c5b95cd.mod
# get
https://proxy.golang.org/gopkg.in/check.v1/@v/v1.0.0-20190902080502-41f04d3bba15.mod
# get https://proxy.golang.org/github.com/rogpeppe/go-
internal/@v/v1.6.0.mod
# get https://proxy.golang.org/github.com/rogpeppe/go-
internal/@v/v1.5.2.mod
# get https://proxy.golang.org/honnef.co/go/tools/@v/v0.0.1-2020.1.4.mod:
200 OK (1.446s)
# get https://proxy.golang.org/github.com/sergi/go-diff/@v/v1.1.0.mod: 200
OK (1.445s)
# get
https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20200323222414-85ca7c5b95cd.mod:
200 OK (0.131s)
# get
https://proxy.golang.org/gopkg.in/check.v1/@v/v1.0.0-20190902080502-41f04d3bba15.mod:
200 OK (0.131s)
# get https://proxy.golang.org/github.com/rogpeppe/go-
internal/@v/v1.5.2.mod: 200 OK (0.134s)
# get https://proxy.golang.org/github.com/rogpeppe/go-
internal/@v/v1.6.0.mod: 200 OK (0.153s)
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.info
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.info: 200 OK
(0.026s)
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.zip
# get https://proxy.golang.org/mvdan.cc/xurls/v2/@v/v2.2.0.zip: 200 OK
(0.026s)
}}}
So in the end it downloads a Zip file which contains the files and fit the
structure required for GOPATH.
--
Ticket URL: <https://trac.macports.org/ticket/60802#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list