[MacPorts] #61192: Lots of golang ports are downloading dependencies at build time
MacPorts
noreply at macports.org
Sat Sep 19 06:13:06 UTC 2020
#61192: Lots of golang ports are downloading dependencies at build time
-------------------------------------------------+-------------------------
Reporter: amake | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: annie aws-vault certigo chezmoi |
cloudmonkey copilot croc elvish evans fzf |
gitqlite glow go-migrate golangci-lint gore |
gotop grpcurl hugo ipfs istioctl jenkins-cli |
k9s krew kubergrunt kustomize micro mole |
newreleases pulumi rclone scw staticcheck |
syncthing tektoncd-cli terragrunt trivy uni |
up webify wtfutil yq |
-------------------------------------------------+-------------------------
Comment (by herbygillot):
I feel like instead of having `go2port` reinvent the wheel, we should
download deps _exactly_ as Go would... and so perhaps the `go mod
download` command could be of some use here. The only downside is that Go
seems to prefer using .zip files, which won't match MacPort's preferred
.tar.gz suffix used in most places.
Within a Go project's source tree, `go mod download -json` will print the
manifest that Go would use to download the project's dependencies if that
project is using Go modules. This can lead to a much more robust way for
MacPorts to vendor the Go deps.
Sample output:
{{{
{
"Path": "cloud.google.com/go",
"Version": "v0.26.0",
"Info":
"/Users/herby/go/pkg/mod/cache/download/cloud.google.com/go/@v/v0.26.0.info",
"GoMod":
"/Users/herby/go/pkg/mod/cache/download/cloud.google.com/go/@v/v0.26.0.mod",
"Zip":
"/Users/herby/go/pkg/mod/cache/download/cloud.google.com/go/@v/v0.26.0.zip",
"Dir": "/Users/herby/go/pkg/mod/cloud.google.com/go at v0.26.0",
"Sum": "h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=",
"GoModSum": "h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw="
}
{
"Path": "github.com/BurntSushi/toml",
"Version": "v0.3.1",
"Info":
"/Users/herby/go/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.3.1.info",
"GoMod":
"/Users/herby/go/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.3.1.mod",
"Zip":
"/Users/herby/go/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.3.1.zip",
"Dir":
"/Users/herby/go/pkg/mod/github.com/!burnt!sushi/toml at v0.3.1",
"Sum": "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=",
"GoModSum": "h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU="
}
...
}}}
--
Ticket URL: <https://trac.macports.org/ticket/61192#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list