[MacPorts] #61192: Lots of golang ports are downloading dependencies at build time

MacPorts noreply at macports.org
Tue Mar 23 20:01:27 UTC 2021


#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 nebula qri                |
-------------------------------------------------+-------------------------

Comment (by gpanders):

 I was looking at upgrading the caddy port, which is now quite old.
 Unfortunately, it is no longer possible to generate the caddy binary with
 version information without using go modules.

 However, it looks like it is possible to both 1) download module
 dependencies before the build step (the issue which this ticket addresses)
 and 2) still use go's new module system. This can be done using the
 {{{-mod vendor}}} flag to {{{go build}}}.

 The only thing this requires is to create a {{{vendor}}} directory that
 contains all of the vendored dependencies. Basically, instead of moving
 downloaded dependencies to {{{gopath/src/}}}, simply move them to
 {{{vendor/}}}. This also requires a file called {{{vendor/modules.txt}}}
 that contains all of the module dependencies; however, this can be
 generated once when the port is updated and kept as a patch alongside the
 Portfile.

-- 
Ticket URL: <https://trac.macports.org/ticket/61192#comment:97>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list