From d024c3aaf29c0358b31b6d973cc363908f68db5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 23 Aug 2023 11:33:45 +0200 Subject: [PATCH] chore: upgrade to Go 1.21 (#195) --- .github/workflows/docker.yml | 2 +- .github/workflows/tests.yml | 9 ++++++--- Dockerfile | 4 +++- alpine.Dockerfile | 4 +++- caddy/go.mod | 14 +++++++------- caddy/go.sum | 20 ++++++++++---------- docker-bake.hcl | 2 +- 7 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 463b3ff..b20fe4f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -136,7 +136,7 @@ jobs: if: '!matrix.qemu' continue-on-error: ${{fromJson(needs.prepare.outputs.push)}} run: | - docker run --platform=${{matrix.platform}} --env GODEBUG=cgocheck=2 --rm \ + docker run --platform=${{matrix.platform}} --rm \ $(jq -r '."builder-${{matrix.variant}}"."containerimage.config.digest"' <<< $METADATA) \ "sh -c 'frankenphp version && go test ${{matrix.race}} -v ./... && cd caddy && go test ${{matrix.race}} -v ./...'" env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3f08a7b..c27afae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,8 +3,6 @@ on: [push, pull_request] jobs: tests: runs-on: ubuntu-latest - env: - GODEBUG: cgocheck=2 strategy: matrix: php-versions: ['8.2', '8.3'] @@ -13,7 +11,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' - uses: shivammathur/setup-php@v2 with: @@ -27,6 +25,11 @@ jobs: - name: Set include flags run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV" + - name: Build + run: go build + env: + GOEXPERIMENT: cgocheck2 + - name: Run library tests run: go test -race -v ./... diff --git a/Dockerfile b/Dockerfile index d94ba56..c0cb8e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,11 @@ FROM php-base AS builder ARG FRANKENPHP_VERSION='dev' -COPY --from=golang-base /usr/local/go/bin/go /usr/local/bin/go +COPY --from=golang-base /usr/local/go/bin/go /usr/local/go/bin/go COPY --from=golang-base /usr/local/go /usr/local/go +ENV PATH /usr/local/go/bin:$PATH + # This is required to link the FrankenPHP binary to the PHP binary RUN apt-get update && \ apt-get -y --no-install-recommends install \ diff --git a/alpine.Dockerfile b/alpine.Dockerfile index c78d67a..50a8ec1 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -3,9 +3,11 @@ FROM php-base AS builder ARG FRANKENPHP_VERSION='dev' -COPY --from=golang-base /usr/local/go/bin/go /usr/local/bin/go +COPY --from=golang-base /usr/local/go/bin/go /usr/local/go/bin/go COPY --from=golang-base /usr/local/go /usr/local/go +ENV PATH /usr/local/go/bin:$PATH + RUN apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ diff --git a/caddy/go.mod b/caddy/go.mod index 0d785e6..ca1d64e 100644 --- a/caddy/go.mod +++ b/caddy/go.mod @@ -12,7 +12,7 @@ replace ( require ( github.com/caddyserver/caddy/v2 v2.7.4 - github.com/dunglas/frankenphp v0.0.0-20230816155229-e0f2323bf6dd + github.com/dunglas/frankenphp v0.0.0-20230822195125-2c30d03e17e0 github.com/dunglas/mercure/caddy v0.14.10 github.com/dunglas/vulcain/caddy v0.4.3 go.uber.org/automaxprocs v1.5.3 @@ -69,12 +69,12 @@ require ( github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/cel-go v0.17.1 // indirect + github.com/google/cel-go v0.17.3 // indirect github.com/google/certificate-transparency-go v1.1.4 // indirect github.com/google/go-tpm v0.3.3 // indirect github.com/google/go-tspi v0.3.0 // indirect - github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f // indirect + github.com/google/uuid v1.3.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect @@ -124,7 +124,7 @@ require ( github.com/prometheus/procfs v0.11.1 // indirect github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/qtls-go1-20 v0.3.2 // indirect - github.com/quic-go/quic-go v0.37.5 // indirect + github.com/quic-go/quic-go v0.38.0 // indirect github.com/rs/xid v1.5.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect @@ -185,8 +185,8 @@ require ( golang.org/x/text v0.12.0 // indirect golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.57.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/caddy/go.sum b/caddy/go.sum index e374fc6..67fe44d 100644 --- a/caddy/go.sum +++ b/caddy/go.sum @@ -442,8 +442,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/cel-go v0.17.1 h1:s2151PDGy/eqpCI80/8dl4VL3xTkqI/YubXLXCFw0mw= -github.com/google/cel-go v0.17.1/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= +github.com/google/cel-go v0.17.3 h1:ZlOIurzzCpD3d68sIvTVqDnYAd170BPTui5kyMKpy7s= +github.com/google/cel-go v0.17.3/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= github.com/google/certificate-transparency-go v1.1.2-0.20210422104406-9f33727a7a18/go.mod h1:6CKh9dscIRoqc2kC6YUFICHZMT9NrClyPrRVFrdw1QQ= @@ -510,8 +510,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b h1:h9U78+dx9a4BKdQkBBos92HalKpaGKHrp+3Uo6yTodo= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f h1:pDhu5sgp8yJlEF/g6osliIIpF9K4F5jvkULXa4daRDQ= +github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg= github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= @@ -524,8 +524,8 @@ github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4Mgqvf github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= @@ -1721,10 +1721,10 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878 h1:WGq4lvB/mlicysM/dUT3SBvijH4D3sm/Ny1A4wmt2CI= -google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/docker-bake.hcl b/docker-bake.hcl index 15b06af..dc5d2a7 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -59,7 +59,7 @@ target "default" { } contexts = { php-base = "docker-image://php:${php-version}-zts-${os}" - golang-base = "docker-image://golang:1.20-${os}" + golang-base = "docker-image://golang:1.21-${os}" } dockerfile = os == "alpine" ? "alpine.Dockerfile" : "Dockerfile" context = "./"