Skip to content

Commit 2bcbbfe

Browse files
authored
Upgrade the Go toolchain, packages and Please plugin (#359)
Mostly a `go get -u ./...` (after a `plz clean -f`), followed by `go mod tidy` and `plz puku sync -w`, and then fixing stuff.
1 parent 1935be1 commit 2bcbbfe

24 files changed

Lines changed: 1047 additions & 1423 deletions

File tree

.plzconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[please]
2-
version = >=17.0.0
2+
version = >=17.21.0
33

44
[build]
55
path = /usr/local/go/bin:/usr/local/bin:/usr/bin:/bin
@@ -27,8 +27,8 @@ moduledir = third_party/python
2727

2828
[plugin "cc"]
2929
target = //plugins:cc
30-
defaultoptcflags = --std=c99 -O3 -pipe -DNDEBUG -Wall -Werror -Wno-error=stringop-overflow -Wno-error=misleading-indentation -Wno-error=unknown-warning-option
31-
defaultdbgcflags = --std=c99 -g3 -pipe -DDEBUG -Wall -Werror -Wno-error=stringop-overflow -Wno-error=misleading-indentation -Wno-error=unknown-warning-option
30+
defaultoptcflags = --std=c99 -O3 -pipe -DNDEBUG -Wall -Werror -Wno-error=stringop-overflow -Wno-error=misleading-indentation
31+
defaultdbgcflags = --std=c99 -g3 -pipe -DDEBUG -Wall -Werror -Wno-error=stringop-overflow -Wno-error=misleading-indentation
3232

3333
[plugin "shell"]
3434
target = //plugins:shell

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 11.17.0
2+
---------------
3+
* Upgrade Go toolchain, packages and Please plugin
4+
15
Version 11.16.9
26
---------------
37
* Apply defaultstatic = true to fix Mettle broken deployment

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.16.9
1+
11.17.0

elan/rpc/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ go_test(
6060
genrule(
6161
name = "test_data",
6262
cmd = [
63-
'for i in `seq 1 10000`; do echo "$i ----------------------------------------- $i" >> "tmp.txt"; done',
63+
'for i in `seq 1 100000`; do echo "$i ----------------------------------------- $i" >> "tmp.txt"; done',
6464
'HASH="`(command -v sha256sum >/dev/null 2>&1 && sha256sum tmp.txt || shasum -a 256 tmp.txt) | cut -c -64`"',
6565
'PREFIX="${HASH:0:2}"',
6666
'mkdir -p "data/cas/${PREFIX}" "data/zstd_cas/${PREFIX}"',

elan/rpc/compression_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"context"
66
"io"
7-
"io/ioutil"
87
"os"
98
"path"
109
"testing"
@@ -20,9 +19,9 @@ var bsClient bs.ByteStreamClient
2019

2120
const (
2221
// These are determined empirically from the generated test files.
23-
hash = "5201263d9a7365629360c09a9ab780a1c15f94aaf3b38874d41500df3e0be87f"
24-
size = 517788
25-
ssize = "517788"
22+
hash = "2e2595aaffe0987a183d3ba9a3c5d81c79d29f3f6e2b2dd47e628d6bf9b12725"
23+
size = 5377790
24+
ssize = "5377790"
2625
name = "blobs/" + hash + "/" + ssize
2726
cname = "compressed-blobs/zstd/" + hash + "/" + ssize
2827
)
@@ -152,11 +151,11 @@ func testMain(m *testing.M) int {
152151
bsClient = bs.NewByteStreamClient(conn)
153152
defer conn.Close()
154153

155-
expectedData, err = ioutil.ReadFile(path.Join("elan/rpc/cas", hash[:2], hash))
154+
expectedData, err = os.ReadFile(path.Join("elan/rpc/cas", hash[:2], hash))
156155
if err != nil {
157156
log.Fatalf("%s", err)
158157
}
159-
compressedData, err = ioutil.ReadFile(path.Join("elan/rpc/zstd_cas", hash[:2], hash))
158+
compressedData, err = os.ReadFile(path.Join("elan/rpc/zstd_cas", hash[:2], hash))
160159
if err != nil {
161160
log.Fatalf("%s", err)
162161
}

elan/rpc/rpc.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"os"
1717
"path"
1818
"regexp"
19+
"slices"
1920
"strconv"
2021
"strings"
2122
"sync"
@@ -39,7 +40,6 @@ import (
3940
"github.com/sirupsen/logrus"
4041
"gocloud.dev/blob"
4142
"gocloud.dev/gcerrors"
42-
"golang.org/x/exp/slices"
4343
"google.golang.org/api/googleapi"
4444
bs "google.golang.org/genproto/googleapis/bytestream"
4545
rpcstatus "google.golang.org/genproto/googleapis/rpc/status"
@@ -557,7 +557,7 @@ func (s *server) readCompressed(ctx context.Context, prefix string, digest *pb.D
557557
return r, false, err
558558
}
559559
if s.isEmpty(digest) {
560-
return ioutil.NopCloser(bytes.NewReader(nil)), compressed, nil
560+
return io.NopCloser(bytes.NewReader(nil)), compressed, nil
561561
}
562562
if s.readRedis != nil && prefix == CASPrefix && digest.SizeBytes < s.largeBlobSize {
563563
// NOTE: we could use GETRANGE here, but given it's a bit more expensive on the redis
@@ -566,7 +566,7 @@ func (s *server) readCompressed(ctx context.Context, prefix string, digest *pb.D
566566
if err != nil && err != redis.Nil {
567567
log.Warningf("Failed to get blob in Redis: %v", err)
568568
} else if err != redis.Nil && blob != nil && limit == 0 {
569-
return ioutil.NopCloser(bytes.NewReader(nil)), false, nil
569+
return io.NopCloser(bytes.NewReader(nil)), false, nil
570570
} else if err != redis.Nil && blob != nil && limit > 0 {
571571
return io.NopCloser(bytes.NewReader(blob[offset : offset+limit])), false, nil
572572
} else if err != redis.Nil && blob != nil && limit < 0 {
@@ -630,10 +630,18 @@ func (s *server) QueryWriteStatus(ctx context.Context, req *bs.QueryWriteStatusR
630630
return nil, status.Errorf(codes.NotFound, "write %s not found", req.ResourceName)
631631
}
632632

633+
func (s *server) SpliceBlob(ctx context.Context, req *pb.SpliceBlobRequest) (*pb.SpliceBlobResponse, error) {
634+
return nil, status.Errorf(codes.Unimplemented, "not implemented")
635+
}
636+
637+
func (s *server) SplitBlob(ctx context.Context, req *pb.SplitBlobRequest) (*pb.SplitBlobResponse, error) {
638+
return nil, status.Errorf(codes.Unimplemented, "not implemented")
639+
}
640+
633641
func (s *server) readBlob(ctx context.Context, key string, offset, length int64) (io.ReadCloser, error) {
634642
if length == 0 || strings.Contains(key, digest.Empty.Hash) {
635643
// Special case any empty read request
636-
return ioutil.NopCloser(bytes.NewReader(nil)), nil
644+
return io.NopCloser(bytes.NewReader(nil)), nil
637645
}
638646
start := time.Now()
639647
defer func() { readLatencies.Observe(time.Since(start).Seconds()) }()

flair/rpc/rpc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ func (s *server) GetTree(req *pb.GetTreeRequest, srv pb.ContentAddressableStorag
406406
return srv.Send(r)
407407
}
408408

409+
func (s *server) SpliceBlob(ctx context.Context, req *pb.SpliceBlobRequest) (*pb.SpliceBlobResponse, error) {
410+
return nil, status.Errorf(codes.Unimplemented, "not implemented")
411+
}
412+
413+
func (s *server) SplitBlob(ctx context.Context, req *pb.SplitBlobRequest) (*pb.SplitBlobResponse, error) {
414+
return nil, status.Errorf(codes.Unimplemented, "not implemented")
415+
}
416+
409417
func (s *server) Read(req *bs.ReadRequest, srv bs.ByteStream_ReadServer) error {
410418
hash, err := s.bytestreamBlobName(req.ResourceName)
411419
if err != nil {

go.mod

Lines changed: 78 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,113 @@
11
module github.com/thought-machine/please-servers
22

3-
go 1.24.0
3+
go 1.26
4+
5+
ignore plz-out
46

57
require (
6-
cloud.google.com/go/profiler v0.4.0
7-
cloud.google.com/go/pubsub v1.33.0
8-
cloud.google.com/go/storage v1.36.0
9-
github.com/bazelbuild/remote-apis v0.0.0-20230411132548-35aee1c4a425
10-
github.com/bazelbuild/remote-apis-sdks v0.0.0-20230419185642-269815af5db1
11-
github.com/dgraph-io/ristretto v0.1.1
8+
cloud.google.com/go/profiler v0.6.0
9+
cloud.google.com/go/pubsub v1.50.4
10+
cloud.google.com/go/storage v1.63.0
11+
github.com/bazelbuild/remote-apis v0.0.0-20260331222004-becdd8f9ff81
12+
github.com/bazelbuild/remote-apis-sdks v0.0.0-20260610142741-7ffd493e6686
13+
github.com/dgraph-io/ristretto v0.2.0
1214
github.com/dustin/go-humanize v1.0.1
1315
github.com/go-redis/redis/v8 v8.11.5
1416
github.com/golang/protobuf v1.5.4
15-
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0
16-
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1
17+
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0
18+
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3
1719
github.com/hashicorp/go-multierror v1.1.1
18-
github.com/hashicorp/go-retryablehttp v0.7.7
19-
github.com/klauspost/compress v1.17.4
20-
github.com/mostynb/go-grpc-compression v1.2.2
20+
github.com/hashicorp/go-retryablehttp v0.7.8
21+
github.com/klauspost/compress v1.19.0
22+
github.com/mostynb/go-grpc-compression v1.2.3
2123
github.com/peterebden/go-cli-init/v4 v4.0.2
2224
github.com/peterebden/go-copyfile v0.0.0-20200424115000-bc0baf74909c
2325
github.com/peterebden/go-sri v1.1.1
24-
github.com/prometheus/client_golang v1.18.0
25-
github.com/prometheus/common v0.45.0
26+
github.com/prometheus/client_golang v1.23.2
27+
github.com/prometheus/common v0.70.0
2628
github.com/shirou/gopsutil v3.21.11+incompatible
27-
github.com/sirupsen/logrus v1.9.3
29+
github.com/sirupsen/logrus v1.9.4
2830
github.com/stretchr/testify v1.11.1
2931
github.com/thought-machine/http-admin v1.1.1
30-
go.uber.org/automaxprocs v1.5.3
31-
gocloud.dev v0.36.0
32-
golang.org/x/crypto v0.46.0
33-
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
34-
golang.org/x/sync v0.19.0
35-
golang.org/x/time v0.5.0
36-
google.golang.org/api v0.155.0
37-
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917
38-
google.golang.org/genproto/googleapis/bytestream v0.0.0-20240102182953-50ed04b92917
39-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217
40-
google.golang.org/grpc v1.79.3
41-
google.golang.org/protobuf v1.36.10
32+
go.uber.org/automaxprocs v1.6.0
33+
gocloud.dev v0.46.0
34+
golang.org/x/crypto v0.54.0
35+
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597
36+
golang.org/x/sync v0.22.0
37+
golang.org/x/time v0.15.0
38+
google.golang.org/api v0.288.0
39+
google.golang.org/genproto v0.0.0-20260706201446-f0a921348800
40+
google.golang.org/genproto/googleapis/bytestream v0.0.0-20260706201446-f0a921348800
41+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800
42+
google.golang.org/grpc v1.82.0
43+
google.golang.org/protobuf v1.36.11
4244
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
4345
)
4446

4547
require (
46-
cloud.google.com/go v0.111.0 // indirect
48+
cel.dev/expr v0.25.2 // indirect
49+
cloud.google.com/go v0.123.0 // indirect
50+
cloud.google.com/go/auth v0.21.0 // indirect
51+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
4752
cloud.google.com/go/compute/metadata v0.9.0 // indirect
48-
cloud.google.com/go/iam v1.1.5 // indirect
49-
cloud.google.com/go/longrunning v0.5.4 // indirect
53+
cloud.google.com/go/iam v1.11.0 // indirect
54+
cloud.google.com/go/longrunning v1.2.0 // indirect
55+
cloud.google.com/go/monitoring v1.29.0 // indirect
56+
cloud.google.com/go/pubsub/v2 v2.6.1 // indirect
57+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 // indirect
58+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.58.0 // indirect
59+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.58.0 // indirect
5060
github.com/beorn7/perks v1.0.1 // indirect
5161
github.com/cespare/xxhash/v2 v2.3.0 // indirect
52-
github.com/davecgh/go-spew v1.1.1 // indirect
62+
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
63+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5364
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
54-
github.com/felixge/httpsnoop v1.0.4 // indirect
65+
github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect
66+
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
67+
github.com/felixge/httpsnoop v1.1.0 // indirect
68+
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
5569
github.com/go-logr/logr v1.4.3 // indirect
5670
github.com/go-logr/stdr v1.2.2 // indirect
5771
github.com/go-ole/go-ole v1.3.0 // indirect
5872
github.com/golang/glog v1.2.5 // indirect
59-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
60-
github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 // indirect
61-
github.com/google/s2a-go v0.1.7 // indirect
73+
github.com/google/pprof v0.0.0-20260709232956-b9395ee17fa0 // indirect
74+
github.com/google/s2a-go v0.1.9 // indirect
6275
github.com/google/uuid v1.6.0 // indirect
63-
github.com/google/wire v0.5.0 // indirect
64-
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
65-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
76+
github.com/google/wire v0.7.0 // indirect
77+
github.com/googleapis/enterprise-certificate-proxy v0.3.18 // indirect
78+
github.com/googleapis/gax-go/v2 v2.23.0 // indirect
6679
github.com/gorilla/mux v1.8.1 // indirect
6780
github.com/hashicorp/errwrap v1.1.0 // indirect
6881
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
69-
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
70-
github.com/mostynb/zstdpool-syncpool v0.0.13 // indirect
71-
github.com/pborman/uuid v1.2.1 // indirect
82+
github.com/mostynb/zstdpool-syncpool v0.0.7 // indirect
83+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
84+
github.com/pborman/uuid v1.2.0 // indirect
7285
github.com/pkg/errors v0.9.1 // indirect
73-
github.com/pkg/xattr v0.4.9 // indirect
74-
github.com/pmezard/go-difflib v1.0.0 // indirect
75-
github.com/prometheus/client_model v0.5.0 // indirect
76-
github.com/prometheus/procfs v0.12.0 // indirect
77-
github.com/thought-machine/go-flags v1.6.3 // indirect
78-
github.com/yusufpapurcu/wmi v1.2.3 // indirect
79-
go.opencensus.io v0.24.0 // indirect
86+
github.com/pkg/xattr v0.4.12 // indirect
87+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
88+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
89+
github.com/prometheus/client_model v0.6.2 // indirect
90+
github.com/prometheus/procfs v0.21.1 // indirect
91+
github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect
92+
github.com/thought-machine/go-flags v1.7.0 // indirect
93+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
8094
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
81-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
82-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
83-
go.opentelemetry.io/otel v1.39.0 // indirect
84-
go.opentelemetry.io/otel/metric v1.39.0 // indirect
85-
go.opentelemetry.io/otel/trace v1.39.0 // indirect
86-
golang.org/x/net v0.48.0 // indirect
87-
golang.org/x/oauth2 v0.34.0 // indirect
88-
golang.org/x/sys v0.39.0 // indirect
89-
golang.org/x/term v0.38.0 // indirect
90-
golang.org/x/text v0.32.0 // indirect
91-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
92-
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
95+
go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect
96+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 // indirect
97+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
98+
go.opentelemetry.io/otel v1.44.0 // indirect
99+
go.opentelemetry.io/otel/metric v1.44.0 // indirect
100+
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
101+
go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect
102+
go.opentelemetry.io/otel/trace v1.44.0 // indirect
103+
golang.org/x/net v0.57.0 // indirect
104+
golang.org/x/oauth2 v0.36.0 // indirect
105+
golang.org/x/sys v0.47.0 // indirect
106+
golang.org/x/term v0.45.0 // indirect
107+
golang.org/x/text v0.40.0 // indirect
108+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
109+
google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800 // indirect
93110
gopkg.in/yaml.v3 v3.0.1 // indirect
94111
)
95112

96-
replace github.com/bazelbuild/remote-apis-sdks v0.0.0-20230419185642-269815af5db1 => github.com/peterebden/remote-apis-sdks v0.0.0-20230519151942-2a9420921957
113+
replace github.com/bazelbuild/remote-apis-sdks => github.com/peterebden/remote-apis-sdks v0.0.0-20230519151942-2a9420921957

0 commit comments

Comments
 (0)