[MacPorts] #68468: cloudflared @2023.8.2 @2023.10.0 build fails: does not build with Go 1.21

MacPorts noreply at macports.org
Sun Dec 3 13:02:58 UTC 2023


#68468: cloudflared @2023.8.2 @2023.10.0 build fails: does not build with Go 1.21
--------------------------+------------------------
  Reporter:  michiow      |      Owner:  i0ntempest
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:  2.8.1
Resolution:               |   Keywords:
      Port:  cloudflared  |
--------------------------+------------------------

Comment (by michiow):

 I've had a go at modifying the Portfile to install Go 1.20 in the working
 directory using a pre-build step, and got it to build and install locally
 with these additions:

 {{{
 --- Portfile.orig       2023-12-03 12:48:39
 +++ Portfile    2023-12-03 12:48:45
 @@ -590,6 +590,15 @@
 ${gopath}/src/github.com/cloudflare/cloudflared/config/configuration.go
  }

 +# Install Go 1.20 in the working directory
 +set goversion go1.20.11
 +pre-build {
 +    system "GOPATH=${gopath} go install
 golang.org/dl/${goversion}@latest"
 +    system "HOME=${workpath} ${gopath}/bin/${goversion} download"
 +}
 +# Override the Go binary used by the build
 +set go.bin "${workpath}/sdk/${goversion}/bin/go"
 +
  destroot {
      xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
  }
 }}}

 The first command fetches an installer for Go 1.20 and the second executes
 it, installing under `${workpath}/sdk/go1.20/`. The 'download' command
 seems to always install the SDK under $HOME, so override that to set the
 install location.

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


More information about the macports-tickets mailing list