From 457e2e414ffcade713d491b8ab96496801fb5bf7 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 12:58:54 -0500 Subject: [PATCH 01/13] Update to use Golang 1.22 and drop Golang 1.19 support --- .github/workflows/buf-binary-size.yaml | 2 +- .github/workflows/buf-shadow-sync.yaml | 2 +- .../workflows/build-and-draft-release.yaml | 2 +- .github/workflows/ci.yaml | 4 +- .github/workflows/codeql.yaml | 2 +- .github/workflows/previous.yaml | 2 +- .github/workflows/windows.yaml | 2 +- Dockerfile.buf | 2 +- Dockerfile.workspace | 2 +- go.mod | 36 ++++----- go.sum | 76 +++++++++---------- make/buf/all.mk | 11 +-- make/go/go.mk | 2 +- 13 files changed, 73 insertions(+), 72 deletions(-) diff --git a/.github/workflows/buf-binary-size.yaml b/.github/workflows/buf-binary-size.yaml index 74cfc68df1..61b7f0f487 100644 --- a/.github/workflows/buf-binary-size.yaml +++ b/.github/workflows/buf-binary-size.yaml @@ -14,7 +14,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' - name: cache uses: actions/cache@v4 with: diff --git a/.github/workflows/buf-shadow-sync.yaml b/.github/workflows/buf-shadow-sync.yaml index 4c408f616d..f98b039235 100644 --- a/.github/workflows/buf-shadow-sync.yaml +++ b/.github/workflows/buf-shadow-sync.yaml @@ -16,7 +16,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' - name: Install Local Buf run: GOBIN="$HOME/go/bin" go install ./cmd/buf # use CLI version from the checked out code - run: buf --version diff --git a/.github/workflows/build-and-draft-release.yaml b/.github/workflows/build-and-draft-release.yaml index 1c02dce4cc..b9bbf79ef2 100644 --- a/.github/workflows/build-and-draft-release.yaml +++ b/.github/workflows/build-and-draft-release.yaml @@ -32,7 +32,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: '1.22.x' - name: Set up Git name and email run: | git config user.name "${{ github.actor }}" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41bd563cb2..de5506d999 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' - name: cache uses: actions/cache@v4 with: @@ -50,7 +50,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' - name: cache uses: actions/cache@v4 with: diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index b9553bc107..012c81ca00 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -21,7 +21,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' - name: initialize uses: github/codeql-action/init@v3 with: diff --git a/.github/workflows/previous.yaml b/.github/workflows/previous.yaml index 64b4275671..524d0eb426 100644 --- a/.github/workflows/previous.yaml +++ b/.github/workflows/previous.yaml @@ -14,7 +14,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.20.x' + go-version: '1.21.x' - name: cache uses: actions/cache@v4 with: diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 5c0fb2ca4e..7ba1cf80ca 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -19,7 +19,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' cache: true - name: windows-cache uses: actions/cache@v4 diff --git a/Dockerfile.buf b/Dockerfile.buf index 8559990a07..f9418bdb14 100644 --- a/Dockerfile.buf +++ b/Dockerfile.buf @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} golang:1.21-alpine3.19 as builder +FROM --platform=${BUILDPLATFORM} golang:1.22-alpine3.19 as builder WORKDIR /workspace diff --git a/Dockerfile.workspace b/Dockerfile.workspace index 16db0daa8b..2e55768a1b 100644 --- a/Dockerfile.workspace +++ b/Dockerfile.workspace @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine3.19 +FROM golang:1.22-alpine3.19 ARG PROJECT ARG GO_MODULE diff --git a/go.mod b/go.mod index 59b1df6529..720f57d303 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/bufbuild/buf -go 1.19 +go 1.20 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.32.0-20231115204500-e097f827e652.1 connectrpc.com/connect v1.14.0 connectrpc.com/otelconnect v0.7.0 github.com/bufbuild/protocompile v0.8.0 - github.com/bufbuild/protovalidate-go v0.5.0 - github.com/bufbuild/protoyaml-go v0.1.7 - github.com/docker/docker v25.0.2+incompatible + github.com/bufbuild/protovalidate-go v0.5.1 + github.com/bufbuild/protoyaml-go v0.1.8 + github.com/docker/docker v25.0.3+incompatible github.com/go-chi/chi/v5 v5.0.11 github.com/gofrs/flock v0.8.1 github.com/gofrs/uuid/v5 v5.0.0 @@ -18,7 +18,7 @@ require ( github.com/google/go-containerregistry v0.19.0 github.com/jdx/go-netrc v1.0.0 github.com/jhump/protoreflect v1.15.6 - github.com/klauspost/compress v1.17.5 + github.com/klauspost/compress v1.17.6 github.com/klauspost/pgzip v1.2.6 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/pkg/profile v1.7.0 @@ -27,15 +27,15 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 github.com/tetratelabs/wazero v1.6.0 - go.opentelemetry.io/otel v1.22.0 - go.opentelemetry.io/otel/sdk v1.22.0 - go.opentelemetry.io/otel/trace v1.22.0 + go.opentelemetry.io/otel v1.23.0 + go.opentelemetry.io/otel/sdk v1.23.0 + go.opentelemetry.io/otel/trace v1.23.0 go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.18.0 - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a - golang.org/x/mod v0.14.0 + golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 + golang.org/x/mod v0.15.0 golang.org/x/net v0.20.0 golang.org/x/sync v0.6.0 golang.org/x/term v0.16.0 @@ -53,7 +53,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/cli v25.0.2+incompatible // indirect + github.com/docker/cli v25.0.3+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.1 // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -64,7 +64,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e // indirect + github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/moby/term v0.5.0 // indirect @@ -77,11 +77,11 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/vbatts/tar-split v0.11.5 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - golang.org/x/sys v0.16.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 // indirect + go.opentelemetry.io/otel/metric v1.23.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect ) diff --git a/go.sum b/go.sum index 9c62139aea..08a806fcc6 100644 --- a/go.sum +++ b/go.sum @@ -12,10 +12,10 @@ github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8 github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/bufbuild/protocompile v0.8.0 h1:9Kp1q6OkS9L4nM3FYbr8vlJnEwtbpDPQlQOVXfR+78s= github.com/bufbuild/protocompile v0.8.0/go.mod h1:+Etjg4guZoAqzVk2czwEQP12yaxLJ8DxuqCJ9qHdH94= -github.com/bufbuild/protovalidate-go v0.5.0 h1:xFery2RlLh07FQTvB7hlasKqPrDK2ug+uw6DUiuadjo= -github.com/bufbuild/protovalidate-go v0.5.0/go.mod h1:3XAwFeJ2x9sXyPLgkxufH9sts1tQRk8fdt1AW93NiUU= -github.com/bufbuild/protoyaml-go v0.1.7 h1:3uKIoNb/l5zrZ93u+Xzsg6cdAO06lveZE/K7UUbUQLw= -github.com/bufbuild/protoyaml-go v0.1.7/go.mod h1:R8vE2+l49bSiIExP4VJpxOXleHE+FDzZ6HVxr3cYunw= +github.com/bufbuild/protovalidate-go v0.5.1 h1:pUUNnrxkUpt2yEX0gMiPTibTTFpGmzQkYxYLbL3lDVg= +github.com/bufbuild/protovalidate-go v0.5.1/go.mod h1:3XAwFeJ2x9sXyPLgkxufH9sts1tQRk8fdt1AW93NiUU= +github.com/bufbuild/protoyaml-go v0.1.8 h1:X9QDLfl9uEllh4gsXUGqPanZYCOKzd92uniRtW2OnAQ= +github.com/bufbuild/protoyaml-go v0.1.8/go.mod h1:R8vE2+l49bSiIExP4VJpxOXleHE+FDzZ6HVxr3cYunw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -32,12 +32,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v25.0.2+incompatible h1:6GEdvxwEA451/+Y3GtqIGn/MNjujQazUlxC6uGu8Tog= -github.com/docker/cli v25.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6/EsX/6284= +github.com/docker/cli v25.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v25.0.2+incompatible h1:/OaKeauroa10K4Nqavw4zlhcDq/WBcPMc5DbjOGgozY= -github.com/docker/docker v25.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= +github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -73,9 +73,9 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-containerregistry v0.19.0 h1:uIsMRBV7m/HDkDxE/nXMnv1q+lOOSPlQ/ywc5JbB8Ic= github.com/google/go-containerregistry v0.19.0/go.mod h1:u0qB2l7mvtWVR5kNcbFIhFY1hLbf8eeGapA+vbFDCtQ= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e h1:E+3PBMCXn0ma79O7iCrne0iUpKtZ7rIcZvoz+jNtNtw= -github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -85,8 +85,8 @@ github.com/jhump/protoreflect v1.15.6 h1:WMYJbw2Wo+KOWwZFvgY0jMoVHM6i4XIvRs2RcBj github.com/jhump/protoreflect v1.15.6/go.mod h1:jCHoyYQIJnaabEYnbGwyo9hUqfyUMTbJw/tAut5t97E= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= -github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= +github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -136,21 +136,21 @@ github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinC github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= +go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.0 h1:D/cXD+03/UOphyyT87NX6h+DlU+BnplN6/P6KJwsgGc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0 h1:cZXHUQvCx7YMdjGu0AlmoArUz7NZ7K6WWsT4cjSkzc0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.0/go.mod h1:OHlshrAeSV9uiVQs1n+c0FVCyo8L0NrYzVf5GuLllRo= +go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= +go.opentelemetry.io/otel/sdk v1.23.0 h1:0KM9Zl2esnl+WSukEmlaAEjVY5HDZANOHferLq36BPc= +go.opentelemetry.io/otel/sdk v1.23.0/go.mod h1:wUscup7byToqyKJSilEtMf34FgdCAsFpFOjXnAwFfO0= go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= @@ -163,12 +163,12 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= +golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -187,8 +187,8 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -206,11 +206,11 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/make/buf/all.mk b/make/buf/all.mk index 81865fb9f3..ab39c55948 100644 --- a/make/buf/all.mk +++ b/make/buf/all.mk @@ -15,6 +15,7 @@ GO_BINS := $(GO_BINS) \ GO_TEST_BINS := $(GO_TEST_BINS) \ private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver \ private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer +GO_MOD_VERSION := 1.20 DOCKER_BINS := $(DOCKER_BINS) buf FILE_IGNORES := $(FILE_IGNORES) \ .build/ \ @@ -130,7 +131,7 @@ bufgeneratesteps:: \ .PHONY: bufrelease bufrelease: $(MINISIGN) - DOCKER_IMAGE=golang:1.21-bullseye bash make/buf/scripts/release.bash + DOCKER_IMAGE=golang:1.22-bookworm bash make/buf/scripts/release.bash .PHONY: bufbinarysize bufbinarysize: @@ -159,11 +160,11 @@ ifndef GOVERSION endif # make sure both of these docker images exist # the release of these images will lag the actual release - docker pull golang:$(GOVERSION)-bullseye + docker pull golang:$(GOVERSION)-bookworm docker pull golang:$(GOVERSION)-alpine3.19 - $(SED_I) "s/golang:1\.[0-9][0-9]*\.[0-9][0-9]*/golang:$(GOVERSION)/g" $(shell git-ls-files-unstaged | grep Dockerfile) - $(SED_I) "s/golang:1\.[0-9][0-9]*\.[0-9][0-9]*/golang:$(GOVERSION)/g" $(shell git-ls-files-unstaged | grep \.mk$) - $(SED_I) "s/go-version: 1\.[0-9][0-9]*\.[0-9][0-9]*/go-version: $(GOVERSION)/g" $(shell git-ls-files-unstaged | grep \.github\/workflows | grep -v previous.yaml) + $(SED_I) "s/golang:1\.[0-9][0-9]*/golang:$(GOVERSION)/g" $(shell git-ls-files-unstaged | grep Dockerfile) + $(SED_I) "s/golang:1\.[0-9][0-9]*/golang:$(GOVERSION)/g" $(shell git-ls-files-unstaged | grep \.mk$) + $(SED_I) "s/go-version: '1\.[0-9][0-9].x'/go-version: '$(GOVERSION).x'/g" $(shell git-ls-files-unstaged | grep \.github\/workflows | grep -v previous.yaml) .PHONY: gofuzz gofuzz: $(GO_FUZZ) diff --git a/make/go/go.mk b/make/go/go.mk index 813cc32b79..64ebd49036 100644 --- a/make/go/go.mk +++ b/make/go/go.mk @@ -17,7 +17,7 @@ GO_TEST_BINS ?= # Settable GO_GET_PKGS ?= # Settable -GO_MOD_VERSION ?= 1.19 +GO_MOD_VERSION ?= 1.20 # Settable GO_ALL_REPO_PKGS ?= ./cmd/... ./internal/... # Settable From 4535a2d595fbab544830a2a2d9705aa857478258 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 13:44:10 -0500 Subject: [PATCH 02/13] Cleanup --- private/buf/bufcli/errors.go | 9 +++++++ private/buf/bufcli/errors_tls_go119.go | 36 -------------------------- private/buf/bufcli/errors_tls_go120.go | 30 --------------------- windows/test.bash | 4 +-- 4 files changed, 11 insertions(+), 68 deletions(-) delete mode 100644 private/buf/bufcli/errors_tls_go119.go delete mode 100644 private/buf/bufcli/errors_tls_go120.go diff --git a/private/buf/bufcli/errors.go b/private/buf/bufcli/errors.go index bef99df9cd..59f8816c4f 100644 --- a/private/buf/bufcli/errors.go +++ b/private/buf/bufcli/errors.go @@ -16,6 +16,7 @@ package bufcli import ( "context" + "crypto/tls" "errors" "fmt" "net" @@ -211,3 +212,11 @@ func isEmptyUnknownError(err error) bool { } return err.Error() == "" && connect.CodeOf(err) == connect.CodeUnknown } + +// wrappedTLSError returns an unwrapped TLS error or nil if the error is another type of error. +func wrappedTLSError(err error) error { + if tlsErr := (&tls.CertificateVerificationError{}); errors.As(err, &tlsErr) { + return tlsErr + } + return nil +} diff --git a/private/buf/bufcli/errors_tls_go119.go b/private/buf/bufcli/errors_tls_go119.go deleted file mode 100644 index 0ee4f9cf47..0000000000 --- a/private/buf/bufcli/errors_tls_go119.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.20 - -package bufcli - -import ( - "errors" - "strings" -) - -// wrappedTLSError returns an unwrapped TLS error or nil if the error is another type of error. -// This method is a workaround until we can switch to use errors.As(err, *tls.CertificateVerificationError), -// which is a new error type introduced in Go 1.20. This can be removed when we upgrade to support Go 1.20/1.21+. -func wrappedTLSError(err error) error { - wrapped := errors.Unwrap(err) - if wrapped == nil { - return nil - } - if strings.HasPrefix(wrapped.Error(), "x509:") && strings.HasSuffix(wrapped.Error(), "certificate is not trusted") { - return wrapped - } - return nil -} diff --git a/private/buf/bufcli/errors_tls_go120.go b/private/buf/bufcli/errors_tls_go120.go deleted file mode 100644 index 5bae63bf38..0000000000 --- a/private/buf/bufcli/errors_tls_go120.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build go1.20 - -package bufcli - -import ( - "crypto/tls" - "errors" -) - -// wrappedTLSError returns an unwrapped TLS error or nil if the error is another type of error. -func wrappedTLSError(err error) error { - if tlsErr := (&tls.CertificateVerificationError{}); errors.As(err, &tlsErr) { - return tlsErr - } - return nil -} diff --git a/windows/test.bash b/windows/test.bash index dabc9cdaa7..ad0721c987 100644 --- a/windows/test.bash +++ b/windows/test.bash @@ -3,8 +3,8 @@ set -eo pipefail PROTOC_VERSION="25.0" -PROTOC_GEN_GO_VERSION="v1.31.0" -CONNECT_VERSION="v1.12.0" +PROTOC_GEN_GO_VERSION="v1.32.0" +CONNECT_VERSION="v1.14.0" # Convert DOWNLOAD_CACHE from d:\path to /d/path DOWNLOAD_CACHE="$(echo "/${DOWNLOAD_CACHE}" | sed 's|\\|/|g' | sed 's/://')" From e5ae8cbe00ea942f7d4436986728867935ab2628 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 13:48:28 -0500 Subject: [PATCH 03/13] See what happens on windows if we downgrade to Golang 1.21 --- .github/workflows/windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 7ba1cf80ca..5c0fb2ca4e 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -19,7 +19,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.22.x' + go-version: '1.21.x' cache: true - name: windows-cache uses: actions/cache@v4 From def837b2b565b3a46e00843c2bae58cd05fee697 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 13:57:35 -0500 Subject: [PATCH 04/13] It is a 1.22-specific windows problem - put back to 1.22 to demonstrate --- .github/workflows/windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 5c0fb2ca4e..7ba1cf80ca 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -19,7 +19,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' cache: true - name: windows-cache uses: actions/cache@v4 From 9602f8603bf65a7578c3c825496ee9b5dc65d5af Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:01:32 -0500 Subject: [PATCH 05/13] Probable fix --- private/pkg/git/git_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index 18cf36412e..b63937398f 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -217,15 +217,16 @@ func createGitDirs( runCommand(ctx, t, container, runner, "git", "-C", submodulePath, "add", "test.proto") runCommand(ctx, t, container, runner, "git", "-C", submodulePath, "commit", "-m", "commit 0") - gitExecPath, err := command.RunStdout(ctx, container, runner, "git", "--exec-path") + gitExecPathBytes, err := command.RunStdout(ctx, container, runner, "git", "--exec-path") require.NoError(t, err) - t.Log(filepath.Join(string(gitExecPath), "git-http-backend")) + gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) + t.Log(filepath.Join(gitExecPath, "git-http-backend")) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) require.NoError(t, err) require.NoError(t, f.Close()) server := httptest.NewServer(&cgi.Handler{ - Path: filepath.Join(strings.TrimSpace(string(gitExecPath)), "git-http-backend"), + Path: filepath.Join(gitExecPath, "git-http-backend"), Dir: submodulePath, Env: []string{"GIT_PROJECT_ROOT=" + submodulePath}, }) From 28e50e58ced45ef3d9052cfeaefa2fc4e7cf46a5 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:11:30 -0500 Subject: [PATCH 06/13] Some more attempted fixes --- make/buf/scripts/release.bash | 26 +++++++++++++++----------- private/pkg/git/git_test.go | 20 ++++++++++++++------ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/make/buf/scripts/release.bash b/make/buf/scripts/release.bash index 3fe9d9c3e3..595c9ab691 100644 --- a/make/buf/scripts/release.bash +++ b/make/buf/scripts/release.bash @@ -43,8 +43,10 @@ sha256() { } if [ -z "${INSIDE_DOCKER}" ]; then - if [ -z "${RELEASE_MINISIGN_PRIVATE_KEY}" -o -z "${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}" ]; then - fail "RELEASE_MINISIGN_PRIVATE_KEY and RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD must be set." + if [ -z "${SKIP_MINISIGN}" ]; then + if [ -z "${RELEASE_MINISIGN_PRIVATE_KEY}" -o -z "${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}" ]; then + fail "RELEASE_MINISIGN_PRIVATE_KEY and RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD must be set." + fi fi if [ -z "${DOCKER_IMAGE}" ]; then fail "DOCKER_IMAGE must be set" @@ -59,15 +61,17 @@ if [ -z "${INSIDE_DOCKER}" ]; then if [ "$(uname -s)" == "Linux" ]; then sudo chown -R "$(id -u):$(id -g)" .build fi - # Produce the signature outside the docker image where we have - # minisign installed. - secret_key_file="$(mktemp)" - trap "rm ${secret_key_file}" EXIT - # Prevent printing of private key and password - set +x - echo "${RELEASE_MINISIGN_PRIVATE_KEY}" > "${secret_key_file}" - echo "${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}" | minisign -S -s "${secret_key_file}" -m .build/release/buf/assets/sha256.txt - set -x + if [ -z "${SKIP_MINISIGN}" ]; then + # Produce the signature outside the docker image where we have + # minisign installed. + secret_key_file="$(mktemp)" + trap "rm ${secret_key_file}" EXIT + # Prevent printing of private key and password + set +x + echo "${RELEASE_MINISIGN_PRIVATE_KEY}" > "${secret_key_file}" + echo "${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}" | minisign -S -s "${secret_key_file}" -m .build/release/buf/assets/sha256.txt + set -x + fi exit 0 fi diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index b63937398f..cfa1b6c4cd 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -17,6 +17,7 @@ package git import ( "context" "errors" + "fmt" "io/fs" "net/http/cgi" "net/http/httptest" @@ -220,16 +221,23 @@ func createGitDirs( gitExecPathBytes, err := command.RunStdout(ctx, container, runner, "git", "--exec-path") require.NoError(t, err) gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) - t.Log(filepath.Join(gitExecPath, "git-http-backend")) + gitHttpBackendPath := filepath.Join(gitExecPath, "git-http-backend") + t.Log(gitHttpBackendPath) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) require.NoError(t, err) require.NoError(t, f.Close()) - server := httptest.NewServer(&cgi.Handler{ - Path: filepath.Join(gitExecPath, "git-http-backend"), - Dir: submodulePath, - Env: []string{"GIT_PROJECT_ROOT=" + submodulePath}, - }) + server := httptest.NewServer( + &cgi.Handler{ + Path: gitHttpBackendPath, + Dir: submodulePath, + Env: append( + app.Environ(container), + fmt.Sprintf("GIT_PROJECT_ROOT=%s", submodulePath), + ), + Stderr: container.Stderr(), + }, + ) t.Cleanup(server.Close) submodulePath = server.URL From 1eecc473e4f0dcd1a0329162e4203b6fa0367427 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:20:20 -0500 Subject: [PATCH 07/13] More logging --- private/pkg/git/git_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index cfa1b6c4cd..83ceeff726 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -222,7 +222,7 @@ func createGitDirs( require.NoError(t, err) gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) gitHttpBackendPath := filepath.Join(gitExecPath, "git-http-backend") - t.Log(gitHttpBackendPath) + t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHttpBackendPath, submodulePath) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) require.NoError(t, err) From a28531151e7c38a9a8aec2e0306c100f1ba6e245 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:23:14 -0500 Subject: [PATCH 08/13] More logging --- private/pkg/git/git_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index 83ceeff726..b779ad81e2 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -223,6 +223,8 @@ func createGitDirs( gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) gitHttpBackendPath := filepath.Join(gitExecPath, "git-http-backend") t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHttpBackendPath, submodulePath) + fileInfo, err := os.Stat(gitHttpBackendPath) + t.Logf("gitHttpBackendPath fileInfo=%v err=%v", fileInfo, err) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) require.NoError(t, err) From a80be2224ef6c25b58f73d1dee68ddb6298c0c45 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:23:59 -0500 Subject: [PATCH 09/13] lint --- private/pkg/git/git_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index b779ad81e2..de7f55e0e6 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -221,9 +221,9 @@ func createGitDirs( gitExecPathBytes, err := command.RunStdout(ctx, container, runner, "git", "--exec-path") require.NoError(t, err) gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) - gitHttpBackendPath := filepath.Join(gitExecPath, "git-http-backend") - t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHttpBackendPath, submodulePath) - fileInfo, err := os.Stat(gitHttpBackendPath) + gitHTTPBackendPath := filepath.Join(gitExecPath, "git-http-backend") + t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHTTPBackendPath, submodulePath) + fileInfo, err := os.Stat(gitHTTPBackendPath) t.Logf("gitHttpBackendPath fileInfo=%v err=%v", fileInfo, err) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) @@ -231,7 +231,7 @@ func createGitDirs( require.NoError(t, f.Close()) server := httptest.NewServer( &cgi.Handler{ - Path: gitHttpBackendPath, + Path: gitHTTPBackendPath, Dir: submodulePath, Env: append( app.Environ(container), From ff3ed4cca0963da9ccdca6aaec9ebfde016df027 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:25:18 -0500 Subject: [PATCH 10/13] Windows back to 1.21 to make sure we didnt mess anything up --- .github/workflows/windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 7ba1cf80ca..5c0fb2ca4e 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -19,7 +19,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.22.x' + go-version: '1.21.x' cache: true - name: windows-cache uses: actions/cache@v4 From 8a71b69cf2313f292d0f4904614663f8a6d4f3e0 Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:29:20 -0500 Subject: [PATCH 11/13] Windows back to 1.22 to show the problem --- .github/workflows/windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 5c0fb2ca4e..7ba1cf80ca 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -19,7 +19,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22.x' cache: true - name: windows-cache uses: actions/cache@v4 From c491a2ffe2cda1418a129b67066c30ef612e07dc Mon Sep 17 00:00:00 2001 From: bufdev Date: Wed, 7 Feb 2024 14:38:33 -0500 Subject: [PATCH 12/13] Probable fix --- private/pkg/command/runner.go | 8 ++++++++ private/pkg/git/git_test.go | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/private/pkg/command/runner.go b/private/pkg/command/runner.go index 740456a615..db62008b6b 100644 --- a/private/pkg/command/runner.go +++ b/private/pkg/command/runner.go @@ -65,6 +65,14 @@ func (r *runner) Start(name string, options ...StartOption) (Process, error) { for _, option := range options { option(execOptions) } + // In Golang 1.22, the behavior of exec.Command was changed so that LookPath is no longer called. + // This preserves the behavior. + // https://cs.opensource.google/go/go/+/f7f266c88598398dcf32b448bcea2100e1702630:src/os/exec/exec.go;dlc=07d4de9312aef72d1bd7427316a2ac21b83e4a20 + // https://tip.golang.org/doc/go1.22 (search for "LookPath") + name, err := exec.LookPath(name) + if err != nil { + return nil, err + } cmd := exec.Command(name, execOptions.args...) execOptions.ApplyToCmd(cmd) r.increment() diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index de7f55e0e6..ebdfcf0cad 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -223,8 +223,6 @@ func createGitDirs( gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) gitHTTPBackendPath := filepath.Join(gitExecPath, "git-http-backend") t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHTTPBackendPath, submodulePath) - fileInfo, err := os.Stat(gitHTTPBackendPath) - t.Logf("gitHttpBackendPath fileInfo=%v err=%v", fileInfo, err) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok")) require.NoError(t, err) From f24d2a4a92a4edd37b4808f9ebcf6b86179e499d Mon Sep 17 00:00:00 2001 From: John Chadwick Date: Wed, 7 Feb 2024 15:25:38 -0500 Subject: [PATCH 13/13] Apply LookPath fix to the right place --- private/pkg/command/runner.go | 8 -------- private/pkg/git/git_test.go | 7 ++++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/private/pkg/command/runner.go b/private/pkg/command/runner.go index db62008b6b..740456a615 100644 --- a/private/pkg/command/runner.go +++ b/private/pkg/command/runner.go @@ -65,14 +65,6 @@ func (r *runner) Start(name string, options ...StartOption) (Process, error) { for _, option := range options { option(execOptions) } - // In Golang 1.22, the behavior of exec.Command was changed so that LookPath is no longer called. - // This preserves the behavior. - // https://cs.opensource.google/go/go/+/f7f266c88598398dcf32b448bcea2100e1702630:src/os/exec/exec.go;dlc=07d4de9312aef72d1bd7427316a2ac21b83e4a20 - // https://tip.golang.org/doc/go1.22 (search for "LookPath") - name, err := exec.LookPath(name) - if err != nil { - return nil, err - } cmd := exec.Command(name, execOptions.args...) execOptions.ApplyToCmd(cmd) r.increment() diff --git a/private/pkg/git/git_test.go b/private/pkg/git/git_test.go index ebdfcf0cad..0cb711fed5 100644 --- a/private/pkg/git/git_test.go +++ b/private/pkg/git/git_test.go @@ -221,7 +221,12 @@ func createGitDirs( gitExecPathBytes, err := command.RunStdout(ctx, container, runner, "git", "--exec-path") require.NoError(t, err) gitExecPath := strings.TrimSpace(string(gitExecPathBytes)) - gitHTTPBackendPath := filepath.Join(gitExecPath, "git-http-backend") + // In Golang 1.22, the behavior of "os/exec" was changed so that LookPath is no longer called + // in some cases. This preserves the behavior. + // https://cs.opensource.google/go/go/+/f7f266c88598398dcf32b448bcea2100e1702630:src/os/exec/exec.go;dlc=07d4de9312aef72d1bd7427316a2ac21b83e4a20 + // https://tip.golang.org/doc/go1.22 (search for "LookPath") + gitHTTPBackendPath, err := exec.LookPath(filepath.Join(gitExecPath, "git-http-backend")) + require.NoError(t, err) t.Logf("gitHttpBackendPath=%q submodulePath=%q", gitHTTPBackendPath, submodulePath) // https://git-scm.com/docs/git-http-backend#_description f, err := os.Create(filepath.Join(submodulePath, ".git", "git-daemon-export-ok"))