diff --git a/go.mod b/go.mod index 74912df..78fe491 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.21.1 toolchain go1.21.3 require ( - github.com/bazelbuild/rules_go v0.46.0 github.com/biogo/store v0.0.0-20201120204734-aad293a2328f github.com/blevesearch/snowballstem v0.9.0 github.com/cockroachdb/apd/v3 v3.1.0 @@ -16,8 +15,8 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/gogo/protobuf v1.3.2 github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 - github.com/google/go-cmp v0.5.8 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/google/go-cmp v0.6.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 github.com/lib/pq v1.10.6 github.com/pierrre/geohash v1.0.0 github.com/sasha-s/go-deadlock v0.3.1 @@ -34,17 +33,19 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/getsentry/sentry-go v0.12.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/kr/pretty v0.3.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/twpayne/go-kml v1.5.2 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/sys v0.15.0 // indirect - google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 // indirect - google.golang.org/grpc v1.40.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.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/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e6655cb..f9c4bb3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -18,16 +17,12 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb h1:wumPkzt4zaxO4rHPBrjDK8iZMR41C1qs7njNqlacwQg= github.com/TomiHiltunen/geohash-golang v0.0.0-20150112065804-b3e4e625abfb/go.mod h1:QiYsIBRQEO+Z4Rz7GoI+dsHVneZNONvhczuA+llOZNM= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/bazelbuild/rules_go v0.46.0 h1:CTefzjN/D3Cdn3rkrM6qMWuQj59OBcuOjyIp3m4hZ7s= -github.com/bazelbuild/rules_go v0.46.0/go.mod h1:Dhcz716Kqg1RHNWos+N6MlXNkjNP2EwZQ0LukRKJfMs= github.com/biogo/store v0.0.0-20201120204734-aad293a2328f h1:+6okTAeUsUrdQr/qN7fIODzowrjjCrnJDg/gkYqcSXY= github.com/biogo/store v0.0.0-20201120204734-aad293a2328f/go.mod h1:z52shMwD6SGwRg2iYFjjDwX5Ene4ENTw6HfXraUy/08= github.com/blevesearch/snowballstem v0.9.0 h1:lMQ189YspGP6sXvZQ4WZ+MLawfV8wOmPoD/iWeNXm8s= @@ -36,11 +31,9 @@ github.com/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042 h1:iEdmkrNMLXbM7e github.com/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042/go.mod h1:f1L9YvXvlt9JTa+A17trQjSMM6bV40f+tHjB+Pi+Fqk= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= github.com/cockroachdb/datadriven v1.0.1-0.20211007161720-b558070c3be0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= @@ -82,9 +75,7 @@ github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZi github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fanixk/geohash v0.0.0-20150324002647-c1f9b5fa157a h1:Fyfh/dsHFrC6nkX7H7+nFdTd1wROlX/FxEIWVpKYf1U= @@ -97,7 +88,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/getsentry/sentry-go v0.12.0 h1:era7g0re5iY13bHSdN/xMkyV+5zZppjRVQhZrXCaEIk= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= @@ -130,7 +120,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -142,8 +131,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -151,8 +140,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -195,8 +184,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -267,10 +257,10 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= @@ -286,7 +276,6 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -333,7 +322,6 @@ github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -360,7 +348,6 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -372,7 +359,6 @@ golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -380,10 +366,8 @@ golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -421,8 +405,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -459,21 +443,23 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= +google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= +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.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.1 h1:pnP7OclFFFgFi4VHQDQDaoXUVauOFyktqTsqqgzFKbc= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -485,12 +471,13 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -499,14 +486,14 @@ gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/patches/0002-fix-quote-names.sql b/patches/0002-fix-quote-names.patch similarity index 69% rename from patches/0002-fix-quote-names.sql rename to patches/0002-fix-quote-names.patch index d972768..b764fc7 100644 --- a/patches/0002-fix-quote-names.sql +++ b/patches/0002-fix-quote-names.patch @@ -1,29 +1,27 @@ diff --git a/pkg/sql/sem/tree/type_name.go b/pkg/sql/sem/tree/type_name.go -index 898009a..5d4423a 100644 +index a671b41..51e484b 100644 --- a/pkg/sql/sem/tree/type_name.go +++ b/pkg/sql/sem/tree/type_name.go -@@ -56,8 +56,7 @@ func (t *TypeName) String() string { - +@@ -48,7 +48,7 @@ func (t *TypeName) Format(ctx *FmtCtx) { // SQLString implements the ResolvableTypeReference interface. func (t *TypeName) SQLString() string { -- // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. + // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(t, FmtBareIdentifiers) + return AsStringWithFlags(t, FmtSimple) } - // FQString renders the type name in full, not omitting the prefix -@@ -250,14 +249,12 @@ func (node *ArrayTypeReference) Format(ctx *FmtCtx) { - + func (t *TypeName) objectName() {} +@@ -240,13 +240,13 @@ func (node *ArrayTypeReference) Format(ctx *FmtCtx) { // SQLString implements the ResolvableTypeReference interface. func (node *ArrayTypeReference) SQLString() string { -- // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. + // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(node, FmtBareIdentifiers) + return AsStringWithFlags(node, FmtSimple) } // SQLString implements the ResolvableTypeReference interface. func (name *UnresolvedObjectName) SQLString() string { -- // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. + // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(name, FmtBareIdentifiers) + return AsStringWithFlags(name, FmtSimple) } diff --git a/patches/0004-fix-bazel-compl.patch b/patches/0004-fix-bazel-compl.patch index 5e9b3dc..a3ef092 100644 --- a/patches/0004-fix-bazel-compl.patch +++ b/patches/0004-fix-bazel-compl.patch @@ -1,16 +1,16 @@ -From d300afb062569278ff9e770b4f7e0ed0d84f6f82 Mon Sep 17 00:00:00 2001 -From: Oliver Tan -Date: Mon, 15 May 2023 14:21:32 +1000 +From fd8c124e5968547a82fecc92e6081fdd71a4b49a Mon Sep 17 00:00:00 2001 +From: Jeremy Yang +Date: Tue, 13 Feb 2024 10:17:56 -0800 Subject: [PATCH] fix bazel compilation for grunning --- pkg/util/grunning/disabled.go | 5 ----- - pkg/util/grunning/enabled.go | 28 ---------------------------- - 2 files changed, 33 deletions(-) + pkg/util/grunning/enabled.go | 27 --------------------------- + 2 files changed, 32 deletions(-) delete mode 100644 pkg/util/grunning/enabled.go diff --git a/pkg/util/grunning/disabled.go b/pkg/util/grunning/disabled.go -index 7fdc2f0..89fcb2d 100644 +index f175eb2..89fcb2d 100644 --- a/pkg/util/grunning/disabled.go +++ b/pkg/util/grunning/disabled.go @@ -8,11 +8,6 @@ @@ -19,18 +19,18 @@ index 7fdc2f0..89fcb2d 100644 -// See grunning.Supported() for an explanation behind this build tag. -// --//go:build freebsd || (linux && s390x) || !bazel --// +build freebsd linux,s390x !bazel +-//go:build (linux && s390x) || !bazel +-// +build linux,s390x !bazel - package grunning func grunningnanos() int64 { return 0 } diff --git a/pkg/util/grunning/enabled.go b/pkg/util/grunning/enabled.go deleted file mode 100644 -index ab12aae..0000000 +index f8cd1b5..0000000 --- a/pkg/util/grunning/enabled.go +++ /dev/null -@@ -1,28 +0,0 @@ +@@ -1,27 +0,0 @@ -// Copyright 2022 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License @@ -43,8 +43,7 @@ index ab12aae..0000000 - -// See grunning.Supported() for an explanation behind this build tag. -// --//go:build !(freebsd || (linux && s390x) || !bazel) --// +build !freebsd +-//go:build !((linux && s390x) || !bazel) -// +build !linux !s390x -// +build bazel - @@ -60,5 +59,5 @@ index ab12aae..0000000 - -func supported() bool { return true } -- -2.39.2 (Apple Git-143) +2.38.1 diff --git a/patches/0006-upgrade-grpc-gateway.patch b/patches/0006-upgrade-grpc-gateway.patch new file mode 100644 index 0000000..2d0f384 --- /dev/null +++ b/patches/0006-upgrade-grpc-gateway.patch @@ -0,0 +1,58 @@ +From ec8f53eb035966d9545bf0250cba607028759f59 Mon Sep 17 00:00:00 2001 +From: Jeremy Yang +Date: Tue, 13 Feb 2024 09:41:51 -0800 +Subject: [PATCH] Update to grpc-gateway v2 + +This commit applies the changes from https://github.com/cockroachdb/cockroachdb-parser/pull/9 +on top of the 23.2 snapshot. +--- + pkg/util/protoutil/jsonpb_marshal.go | 4 +- + pkg/util/protoutil/marshaler.go | 4 +- + +diff --git a/pkg/util/protoutil/jsonpb_marshal.go b/pkg/util/protoutil/jsonpb_marshal.go +index cd02994..22aa5c2 100644 +--- a/pkg/util/protoutil/jsonpb_marshal.go ++++ b/pkg/util/protoutil/jsonpb_marshal.go +@@ -20,7 +20,7 @@ import ( + "github.com/cockroachdb/errors" + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" +- gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" ++ gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + ) + + var _ gwruntime.Marshaler = (*JSONPb)(nil) +@@ -31,7 +31,7 @@ var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem() + type JSONPb jsonpb.Marshaler + + // ContentType implements gwruntime.Marshaler. +-func (*JSONPb) ContentType() string { ++func (*JSONPb) ContentType(_ interface{}) string { + // NB: This is the same as httputil.JSONContentType which we can't use due to + // an import cycle. + const JSONContentType = "application/json" +diff --git a/pkg/util/protoutil/marshaler.go b/pkg/util/protoutil/marshaler.go +index 6d835ae..7dfae1e 100644 +--- a/pkg/util/protoutil/marshaler.go ++++ b/pkg/util/protoutil/marshaler.go +@@ -15,7 +15,7 @@ import ( + + "github.com/cockroachdb/errors" + "github.com/gogo/protobuf/proto" +- gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" ++ gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + ) + + var _ gwruntime.Marshaler = (*ProtoPb)(nil) +@@ -24,7 +24,7 @@ var _ gwruntime.Marshaler = (*ProtoPb)(nil) + type ProtoPb struct{} + + // ContentType implements gwruntime.Marshaler. +-func (*ProtoPb) ContentType() string { ++func (*ProtoPb) ContentType(_ interface{}) string { + // NB: This is the same as httputil.ProtoContentType which we can't use due + // to an import cycle. + const ProtoContentType = "application/x-protobuf" +-- +2.38.1 + diff --git a/patches/0007-remove-bazel-build-files.patch b/patches/0007-remove-bazel-build-files.patch new file mode 100644 index 0000000..c680f86 --- /dev/null +++ b/patches/0007-remove-bazel-build-files.patch @@ -0,0 +1,700 @@ +From 33963cf2f14c72a60817f7d732bff2015f70f125 Mon Sep 17 00:00:00 2001 +From: Jeremy Yang +Date: Tue, 13 Feb 2024 13:35:35 -0800 +Subject: [PATCH] remove bazel build files + +--- + pkg/build/bazel/bazel.go | 146 ------- + pkg/build/bazel/non_bazel.go | 67 ---- + pkg/build/bazel/util/tinystringer/main.go | 452 ---------------------- + 3 files changed, 665 deletions(-) + delete mode 100644 pkg/build/bazel/bazel.go + delete mode 100644 pkg/build/bazel/non_bazel.go + delete mode 100644 pkg/build/bazel/util/tinystringer/main.go + +diff --git a/pkg/build/bazel/bazel.go b/pkg/build/bazel/bazel.go +deleted file mode 100644 +index 2504468..0000000 +--- a/pkg/build/bazel/bazel.go ++++ /dev/null +@@ -1,146 +0,0 @@ +-// Copyright 2015 The Cockroach Authors. +-// +-// Use of this software is governed by the Business Source License +-// included in the file licenses/BSL.txt. +-// +-// As of the Change Date specified in that file, in accordance with +-// the Business Source License, use of this software will be governed +-// by the Apache License, Version 2.0, included in the file +-// licenses/APL.txt. +- +-//go:build bazel +-// +build bazel +- +-package bazel +- +-import ( +- "fmt" +- "os" +- "path" +- "path/filepath" +- "strconv" +- "strings" +- +- inner "github.com/bazelbuild/rules_go/go/tools/bazel" +-) +- +-// bazelTestEnvVar can be used to determine when running in the `bazel test` +-// environment. +-const bazelTestEnvVar = "BAZEL_TEST" +- +-// BuiltWithBazel returns true iff this library was built with Bazel. +-func BuiltWithBazel() bool { +- return true +-} +- +-// InBazelTest returns true iff called from a test run by Bazel. +-func InBazelTest() bool { +- if bazelTestEnv, ok := os.LookupEnv(bazelTestEnvVar); ok { +- if bazelTest, err := strconv.ParseBool(bazelTestEnv); err == nil { +- return bazelTest +- } +- } +- +- return false +-} +- +-// InTestWrapper returns true iff called from Bazel's generated test wrapper. +-// When enabled and running under `bazel test`, the entire test runs using a +-// Bazel-generated wrapper. This wrapper imports the test module, so any +-// import-time code will be run twice: once under the wrapper, and once by the +-// test process itself. Hence, checking can be helpful for any module +-// import-time code, such as init() or any global variable initialization. +-// For more info, see: +-// https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_test +-// +-// Duplicates logic from rules_go's bzltestutil.ShouldWrap(), but does not +-// import in order to avoid a dependency (and its global initialization code). +-func InTestWrapper() bool { +- if !InBazelTest() { +- return false +- } +- +- if wrapEnv, ok := os.LookupEnv("GO_TEST_WRAP"); ok { +- wrap, err := strconv.ParseBool(wrapEnv) +- if err != nil { +- return false +- } +- return wrap +- } +- _, ok := os.LookupEnv("XML_OUTPUT_FILE") +- return ok +-} +- +-// FindBinary is a convenience wrapper around the rules_go variant. +-func FindBinary(pkg, name string) (string, bool) { +- return inner.FindBinary(pkg, name) +-} +- +-// Runfile is a convenience wrapper around the rules_go variant. +-func Runfile(path string) (string, error) { +- return inner.Runfile(path) +-} +- +-// RunfilesPath is a convenience wrapper around the rules_go variant. +-func RunfilesPath() (string, error) { +- return inner.RunfilesPath() +-} +- +-// TestTmpDir is a convenience wrapper around the rules_go variant. +-func TestTmpDir() string { +- return inner.TestTmpDir() +-} +- +-// NewTmpDir is a convenience wrapper around the rules_go variant. +-// The caller is responsible for cleaning the directory up after use. +-func NewTmpDir(prefix string) (string, error) { +- return inner.NewTmpDir(prefix) +-} +- +-// Updates the current environment to use the Go toolchain that Bazel built this +-// binary/test with (updates the `PATH`/`GOROOT`/`GOCACHE` environment +-// variables). +-// If you want to use this function, your binary/test target MUST have +-// `@go_sdk//:files` in its `data` -- this will make sure the whole toolchain +-// gets pulled into the sandbox as well. Generally, this function should only +-// be called in init(). +-func SetGoEnv() { +- gobin, err := Runfile("bin/go") +- if err != nil { +- panic(err) +- } +- if err := os.Setenv("PATH", fmt.Sprintf("%s%c%s", filepath.Dir(gobin), os.PathListSeparator, os.Getenv("PATH"))); err != nil { +- panic(err) +- } +- // GOPATH has to be set to some value (not equal to GOROOT) in order for `go env` to work. +- // See https://github.com/golang/go/issues/43938 for the details. +- // Specify a name under the system TEMP/TMP directory in order to be platform agnostic. +- if err := os.Setenv("GOPATH", filepath.Join(os.TempDir(), "nonexist-gopath")); err != nil { +- panic(err) +- } +- if err := os.Setenv("GOROOT", filepath.Dir(filepath.Dir(gobin))); err != nil { +- panic(err) +- } +- if err := os.Setenv("GOCACHE", path.Join(inner.TestTmpDir(), ".gocache")); err != nil { +- panic(err) +- } +-} +- +-// Name of the environment variable containing the bazel target path +-// (//pkg/cmd/foo:bar). +-const testTargetEnv = "TEST_TARGET" +- +-// RelativeTestTargetPath returns relative path to the package +-// of the current test. +-func RelativeTestTargetPath() string { +- target := os.Getenv(testTargetEnv) +- if target == "" { +- return "" +- } +- +- // Drop target name. +- if last := strings.LastIndex(target, ":"); last > 0 { +- target = target[:last] +- } +- return strings.TrimPrefix(target, "//") +-} +diff --git a/pkg/build/bazel/non_bazel.go b/pkg/build/bazel/non_bazel.go +deleted file mode 100644 +index 17833fb..0000000 +--- a/pkg/build/bazel/non_bazel.go ++++ /dev/null +@@ -1,67 +0,0 @@ +-// Copyright 2015 The Cockroach Authors. +-// +-// Use of this software is governed by the Business Source License +-// included in the file licenses/BSL.txt. +-// +-// As of the Change Date specified in that file, in accordance with +-// the Business Source License, use of this software will be governed +-// by the Apache License, Version 2.0, included in the file +-// licenses/APL.txt. +- +-//go:build !bazel +-// +build !bazel +- +-package bazel +- +-// This file contains stub implementations for non-bazel builds. +-// See bazel.go for full documentation on the contracts of these functions. +- +-// BuiltWithBazel returns true iff this library was built with Bazel. +-func BuiltWithBazel() bool { +- return false +-} +- +-// InBazelTest returns true iff called from a test run by Bazel. +-func InBazelTest() bool { +- return false +-} +- +-// InTestWrapper returns true iff called from Bazel's generated test wrapper. +-func InTestWrapper() bool { +- return false +-} +- +-// FindBinary is not implemented. +-func FindBinary(pkg, name string) (string, bool) { +- panic("not build with Bazel") +-} +- +-// Runfile is not implemented. +-func Runfile(string) (string, error) { +- panic("not built with Bazel") +-} +- +-// RunfilesPath is not implemented. +-func RunfilesPath() (string, error) { +- panic("not built with Bazel") +-} +- +-// TestTmpDir is not implemented. +-func TestTmpDir() string { +- panic("not built with Bazel") +-} +- +-// NewTmpDir is not implemented. +-func NewTmpDir(prefix string) (string, error) { +- panic("not built with Bazel") +-} +- +-// RelativeTestTargetPath is not implemented. +-func RelativeTestTargetPath() string { +- panic("not built with Bazel") +-} +- +-// SetGoEnv is not implemented. +-func SetGoEnv() { +- panic("not built with Bazel") +-} +diff --git a/pkg/build/bazel/util/tinystringer/main.go b/pkg/build/bazel/util/tinystringer/main.go +deleted file mode 100644 +index b0b260a..0000000 +--- a/pkg/build/bazel/util/tinystringer/main.go ++++ /dev/null +@@ -1,452 +0,0 @@ +-// Copyright 2023 The Cockroach Authors. +-// +-// Use of this software is governed by the Business Source License +-// included in the file licenses/BSL.txt. +-// +-// As of the Change Date specified in that file, in accordance with +-// the Business Source License, use of this software will be governed +-// by the Apache License, Version 2.0, included in the file +-// licenses/APL.txt. +- +-package main +- +-import ( +- "errors" +- "flag" +- "fmt" +- "go/ast" +- "go/parser" +- "go/token" +- "os" +- "path/filepath" +- "sort" +- "strconv" +- "strings" +-) +- +-var ( +- lineComment bool +- output, typeName, trimPrefix, stringToValueMapName, enumValuesSliceName string +- allowedIntegerTypes = []string{ +- "byte", +- "int", +- "int8", +- "int16", +- "int32", +- "int64", +- "rune", +- "uint", +- "uint8", +- "uint16", +- "uint32", +- "uint64", +- } +-) +- +-type tinyStringer struct { +- files []string +- typeName, trimPrefix, output, stringToValueMapName, enumValuesSliceName string +- lineComment bool +-} +- +-func init() { +- flag.StringVar(&stringToValueMapName, "stringtovaluemapname", "", "if set, also create a map of enum name -> value of the given name") +- flag.StringVar(&enumValuesSliceName, "enumvaluesslicename", "", "if set, also create a slice of all enum values of the given name") +- flag.StringVar(&output, "output", "", "name of output file; default srcdir/_string.go") +- flag.StringVar(&typeName, "type", "", "the type for which to generate output") +- flag.StringVar(&trimPrefix, "trimprefix", "", "trim the given prefix from generated names") +- flag.BoolVar(&lineComment, "linecomment", false, "use line comment text as printed text when present") +-} +- +-func main() { +- flag.Parse() +- if err := doMain(); err != nil { +- panic(err) +- } +-} +- +-func doMain() error { +- if typeName == "" { +- return errors.New("must provide --type") +- } +- return tinyStringer{ +- enumValuesSliceName: enumValuesSliceName, +- files: flag.Args(), +- lineComment: lineComment, +- output: output, +- stringToValueMapName: stringToValueMapName, +- typeName: typeName, +- trimPrefix: trimPrefix, +- }.stringify() +-} +- +-func (s tinyStringer) stringify() error { +- if len(s.files) == 0 { +- return errors.New("must provide at least one file argument") +- } +- // Make sure all input files are in the same package. +- var srcDir, whichFile string +- for _, file := range s.files { +- dir := filepath.Dir(file) +- if srcDir == "" { +- srcDir = dir +- whichFile = file +- } else { +- if srcDir != dir { +- return fmt.Errorf("all input files must be in the same source directory; got input file %s in directory %s, but input file %s in directory %s", whichFile, srcDir, file, dir) +- } +- } +- } +- if s.output == "" { +- s.output = filepath.Join(srcDir, strings.ToLower(s.typeName)+"_string.go") +- } +- +- parsedFiles, pkgName, err := parseAllFiles(s.files) +- if err != nil { +- return err +- } +- if err := validateType(parsedFiles, s.typeName); err != nil { +- return err +- } +- +- inOrder, nameToInt, nameToPrinted, err := s.computeConstantValues(parsedFiles) +- if err != nil { +- return err +- } +- +- if len(nameToInt) == 0 || len(nameToPrinted) == 0 { +- return fmt.Errorf("did not find enough constant values for type %s", s.typeName) +- } +- +- // Produce s.output. +- outputFile, err := os.Create(s.output) +- if err != nil { +- return err +- } +- defer func() { +- _ = outputFile.Close() +- }() +- fmt.Fprintf(outputFile, `// Code generated by "stringer"; DO NOT EDIT. +- +-package %s +- +-import "strconv" +- +-func _() { +- // An "invalid array index" compiler error signifies that the constant values have changed. +- // Re-run the stringer command to generate them again. +- var x [1]struct{} +-`, pkgName) +- for _, constName := range inOrder { +- if constName == "_" { +- continue +- } +- minus := "-" +- if nameToInt[constName] < 0 { +- // Implement the behavior of gofmt, which wants no space +- // between the operands unless the number on the right +- // is negative (would probably trigger some parse error). +- minus = " - " +- } +- fmt.Fprintf(outputFile, " _ = x[%s%s%d]\n", constName, minus, nameToInt[constName]) +- } +- receiverVar := "i" +- if _, ok := nameToInt[receiverVar]; ok { +- receiverVar = "_i" +- if _, ok := nameToInt[receiverVar]; ok { +- return fmt.Errorf("don't know how to choose a receiver variable because %s is a constant name", receiverVar) +- } +- } +- fmt.Fprintf(outputFile, `} +- +-func (%s %s) String() string { +- switch %s { +-`, receiverVar, s.typeName, receiverVar) +- seen := make(map[int]struct{}) +- for _, constName := range inOrder { +- if constName == "_" { +- continue +- } +- if _, ok := seen[nameToInt[constName]]; ok { +- continue +- } +- fmt.Fprintf(outputFile, ` case %s: +- return "%s" +-`, constName, nameToPrinted[constName]) +- seen[nameToInt[constName]] = struct{}{} +- } +- fmt.Fprintf(outputFile, ` default: +- return "%s(" + strconv.FormatInt(int64(i), 10) + ")" +- } +-} +-`, s.typeName) +- if s.stringToValueMapName != "" { +- fmt.Fprintf(outputFile, ` +-var %s = map[string]%s{ +-`, s.stringToValueMapName, s.typeName) +- // Figure out the length of the longest const name to see how +- // much we need to pad it out. +- var maxLen int +- for _, constName := range inOrder { +- if len(nameToPrinted[constName]) > maxLen { +- maxLen = len(nameToPrinted[constName]) +- } +- } +- for _, constName := range inOrder { +- if constName == "_" { +- continue +- } +- padding := strings.Repeat(" ", 1+maxLen-len(nameToPrinted[constName])) +- fmt.Fprintf(outputFile, ` "%s":%s%d, +-`, nameToPrinted[constName], padding, nameToInt[constName]) +- } +- fmt.Fprintf(outputFile, `} +-`) +- } +- if s.enumValuesSliceName != "" { +- seen := make(map[int]struct{}) +- fmt.Fprintf(outputFile, ` +-var %s = []%s{ +-`, s.enumValuesSliceName, s.typeName) +- inLexicographicOrder := make([]string, len(inOrder)) +- copy(inLexicographicOrder, inOrder) +- // Clear duplicates, select the first one in order. +- i := 0 +- for i < len(inLexicographicOrder) { +- constName := inLexicographicOrder[i] +- if _, ok := seen[nameToInt[constName]]; ok { +- inLexicographicOrder = append(inLexicographicOrder[:i], inLexicographicOrder[i+1:]...) +- } else { +- i += 1 +- seen[nameToInt[constName]] = struct{}{} +- } +- } +- sort.Slice(inLexicographicOrder, func(i, j int) bool { +- return nameToPrinted[inLexicographicOrder[i]] < nameToPrinted[inLexicographicOrder[j]] +- }) +- seen = make(map[int]struct{}) +- for _, constName := range inLexicographicOrder { +- if constName == "_" { +- continue +- } +- if _, ok := seen[nameToInt[constName]]; ok { +- continue +- } +- fmt.Fprintf(outputFile, ` %s, +-`, constName) +- seen[nameToInt[constName]] = struct{}{} +- } +- fmt.Fprintf(outputFile, `} +-`) +- } +- +- return nil +-} +- +-// parseAllFiles returns a list of all the files parsed, the name of the package, and an error if one occurred. +-func parseAllFiles(files []string) ([]*ast.File, string, error) { +- // Parse all files. +- fset := token.NewFileSet() +- parsedFiles := make([]*ast.File, 0, len(files)) +- for _, file := range files { +- parsed, err := parser.ParseFile(fset, file, nil, parser.SkipObjectResolution|parser.ParseComments) +- if err != nil { +- return nil, "", err +- } +- parsedFiles = append(parsedFiles, parsed) +- } +- // All files should have the same package declaration. This will help us +- // determine what package the generated file should be in. +- var pkgName, whichFile string +- for i, file := range parsedFiles { +- if pkgName == "" { +- pkgName = file.Name.Name +- whichFile = files[i] +- } else { +- if pkgName != file.Name.Name { +- return nil, "", fmt.Errorf("all input files must have the same package name; got input file %s w/ 'package %s', but input file %s w/ 'package %s'", whichFile, pkgName, files[i], file.Name.Name) +- } +- } +- } +- return parsedFiles, pkgName, nil +-} +- +-func validateType(files []*ast.File, typeName string) error { +- // Find the definition of the type. Should be an alias for some +- // integer type. +- for _, file := range files { +- for _, decl := range file.Decls { +- var genDecl *ast.GenDecl +- genDecl, ok := decl.(*ast.GenDecl) +- if !ok { +- continue +- } +- if genDecl.Tok != token.TYPE { +- continue +- } +- for _, spec := range genDecl.Specs { +- typeSpec, ok := spec.(*ast.TypeSpec) +- if !ok { +- // Should never happen. +- return fmt.Errorf("unexpected error occurred while processing %+v", spec) +- } +- if typeSpec.Name.Name != typeName { +- continue +- } +- // Ensure the type is an alias for a built-in integer type. +- ident, ok := typeSpec.Type.(*ast.Ident) +- if !ok { +- return fmt.Errorf("expected identifier for definition of type %s", typeName) +- } +- var found bool +- for _, intType := range allowedIntegerTypes { +- if ident.Name == intType { +- found = true +- break +- } +- +- } +- if !found { +- return fmt.Errorf("expected an integer type for definition of type %s; got %s", typeName, ident.Name) +- } +- } +- } +- } +- return nil +-} +- +-func (s tinyStringer) computeConstantValues( +- files []*ast.File, +-) (inOrder []string, nameToInt map[string]int, nameToPrinted map[string]string, err error) { +- nameToInt = make(map[string]int) +- nameToPrinted = make(map[string]string) +- +- for _, file := range files { +- for _, decl := range file.Decls { +- var genDecl *ast.GenDecl +- genDecl, ok := decl.(*ast.GenDecl) +- if !ok { +- continue +- } +- if genDecl.Tok != token.CONST { +- continue +- } +- var inferAppropriateType, inIota bool +- var iotaVal int +- for _, spec := range genDecl.Specs { +- valueSpec, ok := spec.(*ast.ValueSpec) +- if !ok { +- // Should never happen. +- err = fmt.Errorf("unexpected error occurred while processing %+v", spec) +- return +- } +- if valueSpec.Type == nil && !inferAppropriateType { +- continue +- } +- ident, ok := valueSpec.Type.(*ast.Ident) +- if (ok && ident.Name != s.typeName) || (!ok && !inferAppropriateType) { +- inferAppropriateType = false +- continue +- } +- inferAppropriateType = true +- if len(valueSpec.Names) != 1 { +- err = fmt.Errorf("expected one name for constant of type %s; found %+v", s.typeName, valueSpec.Names) +- return +- } +- constName := valueSpec.Names[0].Name +- inOrder = append(inOrder, constName) +- // Check the value to see what value we'll assign to the constant. +- if valueSpec.Values == nil { +- if inIota { +- nameToInt[constName] = iotaVal +- iotaVal += 1 +- } else { +- nameToInt[constName] = 0 +- } +- } else if len(valueSpec.Values) != 1 { +- err = fmt.Errorf("expected one value for constant %s; found %+v", constName, valueSpec.Values) +- return +- } else if lit, ok := valueSpec.Values[0].(*ast.BasicLit); ok { +- if lit.Kind == token.INT { +- var intVal int64 +- intVal, err = strconv.ParseInt(lit.Value, 0, 0) +- if err != nil { +- return +- } +- nameToInt[constName] = int(intVal) +- inIota = false +- } else if lit.Kind == token.CHAR { +- if len(lit.Value) != 3 { +- err = fmt.Errorf("expected string of form 'X' for character: got %s", lit.Value) +- return +- } +- if lit.Value[0] != '\'' || lit.Value[2] != '\'' { +- err = fmt.Errorf("expected string of form 'X' for character: got %s", lit.Value) +- return +- } +- nameToInt[constName] = int(lit.Value[1]) +- inIota = false +- } else { +- err = fmt.Errorf("expected integer value for constant %s; found %s", constName, lit.Value) +- return +- } +- } else if ident, ok := valueSpec.Values[0].(*ast.Ident); ok { +- if ident.Name == "iota" { +- inIota = true +- nameToInt[constName] = iotaVal +- iotaVal += 1 +- } else if otherValue, ok := nameToInt[ident.Name]; ok { +- nameToInt[constName] = otherValue +- inIota = false +- } +- } else if binExpr, ok := valueSpec.Values[0].(*ast.BinaryExpr); ok { +- // Handle iota + N or iota - N. +- iotaIdent, ok := binExpr.X.(*ast.Ident) +- if !ok || iotaIdent.Name != "iota" { +- err = fmt.Errorf("expected 'iota' in binary expression %+v; found %+v", binExpr, binExpr.X) +- return +- } +- var otherNumParsed int64 +- if otherNum, ok := binExpr.Y.(*ast.BasicLit); ok && otherNum.Kind == token.INT { +- otherNumParsed, err = strconv.ParseInt(otherNum.Value, 0, 0) +- if err != nil { +- return +- } +- } else if otherRef, ok := binExpr.Y.(*ast.Ident); ok { +- otherNum, ok := nameToInt[otherRef.Name] +- if !ok { +- err = fmt.Errorf("could not find value of %s", otherRef.Name) +- return +- } +- otherNumParsed = int64(otherNum) +- } else { +- err = fmt.Errorf("couldn't parse second argument of binary expression %+v; found %+v", binExpr, binExpr.Y) +- return +- } +- if binExpr.Op == token.ADD { +- iotaVal = iotaVal + int(otherNumParsed) +- } else if binExpr.Op == token.SUB { +- iotaVal = iotaVal - int(otherNumParsed) +- } +- inIota = true +- nameToInt[constName] = iotaVal +- iotaVal += 1 +- } else { +- err = fmt.Errorf("don't know how to process %+v", valueSpec.Values[0]) +- return +- } +- +- // Determine the printed name of the constant. +- printedName := constName +- if s.lineComment && valueSpec.Comment != nil { +- printedName = strings.TrimSpace(valueSpec.Comment.Text()) +- } +- if s.trimPrefix != "" { +- printedName = strings.TrimPrefix(printedName, s.trimPrefix) +- } +- nameToPrinted[constName] = printedName +- } +- } +- } +- return +-} +-- +2.38.1 + diff --git a/patches/0008-delete-bazel-reference-in-constants.go.patch b/patches/0008-delete-bazel-reference-in-constants.go.patch new file mode 100644 index 0000000..1241220 --- /dev/null +++ b/patches/0008-delete-bazel-reference-in-constants.go.patch @@ -0,0 +1,36 @@ +From 0545dc256278ada86ce74cb5ea8c397ba434c64a Mon Sep 17 00:00:00 2001 +From: Jeremy Yang +Date: Tue, 13 Feb 2024 13:46:32 -0800 +Subject: [PATCH] delete bazel reference in constants.go + +--- + pkg/util/constants.go | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/pkg/util/constants.go b/pkg/util/constants.go +index 4e2e8b4..ede4b9d 100644 +--- a/pkg/util/constants.go ++++ b/pkg/util/constants.go +@@ -15,7 +15,6 @@ import ( + "math/rand" + "os" + +- "github.com/cockroachdb/cockroachdb-parser/pkg/build/bazel" + "github.com/cockroachdb/cockroachdb-parser/pkg/util/buildutil" + "github.com/cockroachdb/cockroachdb-parser/pkg/util/randutil" + "github.com/cockroachdb/cockroachdb-parser/pkg/util/syncutil" +@@ -98,11 +97,6 @@ func metamorphicEligible() bool { + if !buildutil.CrdbTestBuild { + return false + } +- +- if bazel.InTestWrapper() { +- return false +- } +- + return true + } + +-- +2.38.1 + diff --git a/pkg/build/bazel/bazel.go b/pkg/build/bazel/bazel.go deleted file mode 100644 index 2504468..0000000 --- a/pkg/build/bazel/bazel.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2015 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -//go:build bazel -// +build bazel - -package bazel - -import ( - "fmt" - "os" - "path" - "path/filepath" - "strconv" - "strings" - - inner "github.com/bazelbuild/rules_go/go/tools/bazel" -) - -// bazelTestEnvVar can be used to determine when running in the `bazel test` -// environment. -const bazelTestEnvVar = "BAZEL_TEST" - -// BuiltWithBazel returns true iff this library was built with Bazel. -func BuiltWithBazel() bool { - return true -} - -// InBazelTest returns true iff called from a test run by Bazel. -func InBazelTest() bool { - if bazelTestEnv, ok := os.LookupEnv(bazelTestEnvVar); ok { - if bazelTest, err := strconv.ParseBool(bazelTestEnv); err == nil { - return bazelTest - } - } - - return false -} - -// InTestWrapper returns true iff called from Bazel's generated test wrapper. -// When enabled and running under `bazel test`, the entire test runs using a -// Bazel-generated wrapper. This wrapper imports the test module, so any -// import-time code will be run twice: once under the wrapper, and once by the -// test process itself. Hence, checking can be helpful for any module -// import-time code, such as init() or any global variable initialization. -// For more info, see: -// https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_test -// -// Duplicates logic from rules_go's bzltestutil.ShouldWrap(), but does not -// import in order to avoid a dependency (and its global initialization code). -func InTestWrapper() bool { - if !InBazelTest() { - return false - } - - if wrapEnv, ok := os.LookupEnv("GO_TEST_WRAP"); ok { - wrap, err := strconv.ParseBool(wrapEnv) - if err != nil { - return false - } - return wrap - } - _, ok := os.LookupEnv("XML_OUTPUT_FILE") - return ok -} - -// FindBinary is a convenience wrapper around the rules_go variant. -func FindBinary(pkg, name string) (string, bool) { - return inner.FindBinary(pkg, name) -} - -// Runfile is a convenience wrapper around the rules_go variant. -func Runfile(path string) (string, error) { - return inner.Runfile(path) -} - -// RunfilesPath is a convenience wrapper around the rules_go variant. -func RunfilesPath() (string, error) { - return inner.RunfilesPath() -} - -// TestTmpDir is a convenience wrapper around the rules_go variant. -func TestTmpDir() string { - return inner.TestTmpDir() -} - -// NewTmpDir is a convenience wrapper around the rules_go variant. -// The caller is responsible for cleaning the directory up after use. -func NewTmpDir(prefix string) (string, error) { - return inner.NewTmpDir(prefix) -} - -// Updates the current environment to use the Go toolchain that Bazel built this -// binary/test with (updates the `PATH`/`GOROOT`/`GOCACHE` environment -// variables). -// If you want to use this function, your binary/test target MUST have -// `@go_sdk//:files` in its `data` -- this will make sure the whole toolchain -// gets pulled into the sandbox as well. Generally, this function should only -// be called in init(). -func SetGoEnv() { - gobin, err := Runfile("bin/go") - if err != nil { - panic(err) - } - if err := os.Setenv("PATH", fmt.Sprintf("%s%c%s", filepath.Dir(gobin), os.PathListSeparator, os.Getenv("PATH"))); err != nil { - panic(err) - } - // GOPATH has to be set to some value (not equal to GOROOT) in order for `go env` to work. - // See https://github.com/golang/go/issues/43938 for the details. - // Specify a name under the system TEMP/TMP directory in order to be platform agnostic. - if err := os.Setenv("GOPATH", filepath.Join(os.TempDir(), "nonexist-gopath")); err != nil { - panic(err) - } - if err := os.Setenv("GOROOT", filepath.Dir(filepath.Dir(gobin))); err != nil { - panic(err) - } - if err := os.Setenv("GOCACHE", path.Join(inner.TestTmpDir(), ".gocache")); err != nil { - panic(err) - } -} - -// Name of the environment variable containing the bazel target path -// (//pkg/cmd/foo:bar). -const testTargetEnv = "TEST_TARGET" - -// RelativeTestTargetPath returns relative path to the package -// of the current test. -func RelativeTestTargetPath() string { - target := os.Getenv(testTargetEnv) - if target == "" { - return "" - } - - // Drop target name. - if last := strings.LastIndex(target, ":"); last > 0 { - target = target[:last] - } - return strings.TrimPrefix(target, "//") -} diff --git a/pkg/build/bazel/non_bazel.go b/pkg/build/bazel/non_bazel.go deleted file mode 100644 index 17833fb..0000000 --- a/pkg/build/bazel/non_bazel.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2015 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -//go:build !bazel -// +build !bazel - -package bazel - -// This file contains stub implementations for non-bazel builds. -// See bazel.go for full documentation on the contracts of these functions. - -// BuiltWithBazel returns true iff this library was built with Bazel. -func BuiltWithBazel() bool { - return false -} - -// InBazelTest returns true iff called from a test run by Bazel. -func InBazelTest() bool { - return false -} - -// InTestWrapper returns true iff called from Bazel's generated test wrapper. -func InTestWrapper() bool { - return false -} - -// FindBinary is not implemented. -func FindBinary(pkg, name string) (string, bool) { - panic("not build with Bazel") -} - -// Runfile is not implemented. -func Runfile(string) (string, error) { - panic("not built with Bazel") -} - -// RunfilesPath is not implemented. -func RunfilesPath() (string, error) { - panic("not built with Bazel") -} - -// TestTmpDir is not implemented. -func TestTmpDir() string { - panic("not built with Bazel") -} - -// NewTmpDir is not implemented. -func NewTmpDir(prefix string) (string, error) { - panic("not built with Bazel") -} - -// RelativeTestTargetPath is not implemented. -func RelativeTestTargetPath() string { - panic("not built with Bazel") -} - -// SetGoEnv is not implemented. -func SetGoEnv() { - panic("not built with Bazel") -} diff --git a/pkg/build/bazel/util/tinystringer/main.go b/pkg/build/bazel/util/tinystringer/main.go deleted file mode 100644 index b0b260a..0000000 --- a/pkg/build/bazel/util/tinystringer/main.go +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright 2023 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package main - -import ( - "errors" - "flag" - "fmt" - "go/ast" - "go/parser" - "go/token" - "os" - "path/filepath" - "sort" - "strconv" - "strings" -) - -var ( - lineComment bool - output, typeName, trimPrefix, stringToValueMapName, enumValuesSliceName string - allowedIntegerTypes = []string{ - "byte", - "int", - "int8", - "int16", - "int32", - "int64", - "rune", - "uint", - "uint8", - "uint16", - "uint32", - "uint64", - } -) - -type tinyStringer struct { - files []string - typeName, trimPrefix, output, stringToValueMapName, enumValuesSliceName string - lineComment bool -} - -func init() { - flag.StringVar(&stringToValueMapName, "stringtovaluemapname", "", "if set, also create a map of enum name -> value of the given name") - flag.StringVar(&enumValuesSliceName, "enumvaluesslicename", "", "if set, also create a slice of all enum values of the given name") - flag.StringVar(&output, "output", "", "name of output file; default srcdir/_string.go") - flag.StringVar(&typeName, "type", "", "the type for which to generate output") - flag.StringVar(&trimPrefix, "trimprefix", "", "trim the given prefix from generated names") - flag.BoolVar(&lineComment, "linecomment", false, "use line comment text as printed text when present") -} - -func main() { - flag.Parse() - if err := doMain(); err != nil { - panic(err) - } -} - -func doMain() error { - if typeName == "" { - return errors.New("must provide --type") - } - return tinyStringer{ - enumValuesSliceName: enumValuesSliceName, - files: flag.Args(), - lineComment: lineComment, - output: output, - stringToValueMapName: stringToValueMapName, - typeName: typeName, - trimPrefix: trimPrefix, - }.stringify() -} - -func (s tinyStringer) stringify() error { - if len(s.files) == 0 { - return errors.New("must provide at least one file argument") - } - // Make sure all input files are in the same package. - var srcDir, whichFile string - for _, file := range s.files { - dir := filepath.Dir(file) - if srcDir == "" { - srcDir = dir - whichFile = file - } else { - if srcDir != dir { - return fmt.Errorf("all input files must be in the same source directory; got input file %s in directory %s, but input file %s in directory %s", whichFile, srcDir, file, dir) - } - } - } - if s.output == "" { - s.output = filepath.Join(srcDir, strings.ToLower(s.typeName)+"_string.go") - } - - parsedFiles, pkgName, err := parseAllFiles(s.files) - if err != nil { - return err - } - if err := validateType(parsedFiles, s.typeName); err != nil { - return err - } - - inOrder, nameToInt, nameToPrinted, err := s.computeConstantValues(parsedFiles) - if err != nil { - return err - } - - if len(nameToInt) == 0 || len(nameToPrinted) == 0 { - return fmt.Errorf("did not find enough constant values for type %s", s.typeName) - } - - // Produce s.output. - outputFile, err := os.Create(s.output) - if err != nil { - return err - } - defer func() { - _ = outputFile.Close() - }() - fmt.Fprintf(outputFile, `// Code generated by "stringer"; DO NOT EDIT. - -package %s - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} -`, pkgName) - for _, constName := range inOrder { - if constName == "_" { - continue - } - minus := "-" - if nameToInt[constName] < 0 { - // Implement the behavior of gofmt, which wants no space - // between the operands unless the number on the right - // is negative (would probably trigger some parse error). - minus = " - " - } - fmt.Fprintf(outputFile, " _ = x[%s%s%d]\n", constName, minus, nameToInt[constName]) - } - receiverVar := "i" - if _, ok := nameToInt[receiverVar]; ok { - receiverVar = "_i" - if _, ok := nameToInt[receiverVar]; ok { - return fmt.Errorf("don't know how to choose a receiver variable because %s is a constant name", receiverVar) - } - } - fmt.Fprintf(outputFile, `} - -func (%s %s) String() string { - switch %s { -`, receiverVar, s.typeName, receiverVar) - seen := make(map[int]struct{}) - for _, constName := range inOrder { - if constName == "_" { - continue - } - if _, ok := seen[nameToInt[constName]]; ok { - continue - } - fmt.Fprintf(outputFile, ` case %s: - return "%s" -`, constName, nameToPrinted[constName]) - seen[nameToInt[constName]] = struct{}{} - } - fmt.Fprintf(outputFile, ` default: - return "%s(" + strconv.FormatInt(int64(i), 10) + ")" - } -} -`, s.typeName) - if s.stringToValueMapName != "" { - fmt.Fprintf(outputFile, ` -var %s = map[string]%s{ -`, s.stringToValueMapName, s.typeName) - // Figure out the length of the longest const name to see how - // much we need to pad it out. - var maxLen int - for _, constName := range inOrder { - if len(nameToPrinted[constName]) > maxLen { - maxLen = len(nameToPrinted[constName]) - } - } - for _, constName := range inOrder { - if constName == "_" { - continue - } - padding := strings.Repeat(" ", 1+maxLen-len(nameToPrinted[constName])) - fmt.Fprintf(outputFile, ` "%s":%s%d, -`, nameToPrinted[constName], padding, nameToInt[constName]) - } - fmt.Fprintf(outputFile, `} -`) - } - if s.enumValuesSliceName != "" { - seen := make(map[int]struct{}) - fmt.Fprintf(outputFile, ` -var %s = []%s{ -`, s.enumValuesSliceName, s.typeName) - inLexicographicOrder := make([]string, len(inOrder)) - copy(inLexicographicOrder, inOrder) - // Clear duplicates, select the first one in order. - i := 0 - for i < len(inLexicographicOrder) { - constName := inLexicographicOrder[i] - if _, ok := seen[nameToInt[constName]]; ok { - inLexicographicOrder = append(inLexicographicOrder[:i], inLexicographicOrder[i+1:]...) - } else { - i += 1 - seen[nameToInt[constName]] = struct{}{} - } - } - sort.Slice(inLexicographicOrder, func(i, j int) bool { - return nameToPrinted[inLexicographicOrder[i]] < nameToPrinted[inLexicographicOrder[j]] - }) - seen = make(map[int]struct{}) - for _, constName := range inLexicographicOrder { - if constName == "_" { - continue - } - if _, ok := seen[nameToInt[constName]]; ok { - continue - } - fmt.Fprintf(outputFile, ` %s, -`, constName) - seen[nameToInt[constName]] = struct{}{} - } - fmt.Fprintf(outputFile, `} -`) - } - - return nil -} - -// parseAllFiles returns a list of all the files parsed, the name of the package, and an error if one occurred. -func parseAllFiles(files []string) ([]*ast.File, string, error) { - // Parse all files. - fset := token.NewFileSet() - parsedFiles := make([]*ast.File, 0, len(files)) - for _, file := range files { - parsed, err := parser.ParseFile(fset, file, nil, parser.SkipObjectResolution|parser.ParseComments) - if err != nil { - return nil, "", err - } - parsedFiles = append(parsedFiles, parsed) - } - // All files should have the same package declaration. This will help us - // determine what package the generated file should be in. - var pkgName, whichFile string - for i, file := range parsedFiles { - if pkgName == "" { - pkgName = file.Name.Name - whichFile = files[i] - } else { - if pkgName != file.Name.Name { - return nil, "", fmt.Errorf("all input files must have the same package name; got input file %s w/ 'package %s', but input file %s w/ 'package %s'", whichFile, pkgName, files[i], file.Name.Name) - } - } - } - return parsedFiles, pkgName, nil -} - -func validateType(files []*ast.File, typeName string) error { - // Find the definition of the type. Should be an alias for some - // integer type. - for _, file := range files { - for _, decl := range file.Decls { - var genDecl *ast.GenDecl - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - if genDecl.Tok != token.TYPE { - continue - } - for _, spec := range genDecl.Specs { - typeSpec, ok := spec.(*ast.TypeSpec) - if !ok { - // Should never happen. - return fmt.Errorf("unexpected error occurred while processing %+v", spec) - } - if typeSpec.Name.Name != typeName { - continue - } - // Ensure the type is an alias for a built-in integer type. - ident, ok := typeSpec.Type.(*ast.Ident) - if !ok { - return fmt.Errorf("expected identifier for definition of type %s", typeName) - } - var found bool - for _, intType := range allowedIntegerTypes { - if ident.Name == intType { - found = true - break - } - - } - if !found { - return fmt.Errorf("expected an integer type for definition of type %s; got %s", typeName, ident.Name) - } - } - } - } - return nil -} - -func (s tinyStringer) computeConstantValues( - files []*ast.File, -) (inOrder []string, nameToInt map[string]int, nameToPrinted map[string]string, err error) { - nameToInt = make(map[string]int) - nameToPrinted = make(map[string]string) - - for _, file := range files { - for _, decl := range file.Decls { - var genDecl *ast.GenDecl - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - if genDecl.Tok != token.CONST { - continue - } - var inferAppropriateType, inIota bool - var iotaVal int - for _, spec := range genDecl.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - // Should never happen. - err = fmt.Errorf("unexpected error occurred while processing %+v", spec) - return - } - if valueSpec.Type == nil && !inferAppropriateType { - continue - } - ident, ok := valueSpec.Type.(*ast.Ident) - if (ok && ident.Name != s.typeName) || (!ok && !inferAppropriateType) { - inferAppropriateType = false - continue - } - inferAppropriateType = true - if len(valueSpec.Names) != 1 { - err = fmt.Errorf("expected one name for constant of type %s; found %+v", s.typeName, valueSpec.Names) - return - } - constName := valueSpec.Names[0].Name - inOrder = append(inOrder, constName) - // Check the value to see what value we'll assign to the constant. - if valueSpec.Values == nil { - if inIota { - nameToInt[constName] = iotaVal - iotaVal += 1 - } else { - nameToInt[constName] = 0 - } - } else if len(valueSpec.Values) != 1 { - err = fmt.Errorf("expected one value for constant %s; found %+v", constName, valueSpec.Values) - return - } else if lit, ok := valueSpec.Values[0].(*ast.BasicLit); ok { - if lit.Kind == token.INT { - var intVal int64 - intVal, err = strconv.ParseInt(lit.Value, 0, 0) - if err != nil { - return - } - nameToInt[constName] = int(intVal) - inIota = false - } else if lit.Kind == token.CHAR { - if len(lit.Value) != 3 { - err = fmt.Errorf("expected string of form 'X' for character: got %s", lit.Value) - return - } - if lit.Value[0] != '\'' || lit.Value[2] != '\'' { - err = fmt.Errorf("expected string of form 'X' for character: got %s", lit.Value) - return - } - nameToInt[constName] = int(lit.Value[1]) - inIota = false - } else { - err = fmt.Errorf("expected integer value for constant %s; found %s", constName, lit.Value) - return - } - } else if ident, ok := valueSpec.Values[0].(*ast.Ident); ok { - if ident.Name == "iota" { - inIota = true - nameToInt[constName] = iotaVal - iotaVal += 1 - } else if otherValue, ok := nameToInt[ident.Name]; ok { - nameToInt[constName] = otherValue - inIota = false - } - } else if binExpr, ok := valueSpec.Values[0].(*ast.BinaryExpr); ok { - // Handle iota + N or iota - N. - iotaIdent, ok := binExpr.X.(*ast.Ident) - if !ok || iotaIdent.Name != "iota" { - err = fmt.Errorf("expected 'iota' in binary expression %+v; found %+v", binExpr, binExpr.X) - return - } - var otherNumParsed int64 - if otherNum, ok := binExpr.Y.(*ast.BasicLit); ok && otherNum.Kind == token.INT { - otherNumParsed, err = strconv.ParseInt(otherNum.Value, 0, 0) - if err != nil { - return - } - } else if otherRef, ok := binExpr.Y.(*ast.Ident); ok { - otherNum, ok := nameToInt[otherRef.Name] - if !ok { - err = fmt.Errorf("could not find value of %s", otherRef.Name) - return - } - otherNumParsed = int64(otherNum) - } else { - err = fmt.Errorf("couldn't parse second argument of binary expression %+v; found %+v", binExpr, binExpr.Y) - return - } - if binExpr.Op == token.ADD { - iotaVal = iotaVal + int(otherNumParsed) - } else if binExpr.Op == token.SUB { - iotaVal = iotaVal - int(otherNumParsed) - } - inIota = true - nameToInt[constName] = iotaVal - iotaVal += 1 - } else { - err = fmt.Errorf("don't know how to process %+v", valueSpec.Values[0]) - return - } - - // Determine the printed name of the constant. - printedName := constName - if s.lineComment && valueSpec.Comment != nil { - printedName = strings.TrimSpace(valueSpec.Comment.Text()) - } - if s.trimPrefix != "" { - printedName = strings.TrimPrefix(printedName, s.trimPrefix) - } - nameToPrinted[constName] = printedName - } - } - } - return -} diff --git a/pkg/sql/sem/tree/type_name.go b/pkg/sql/sem/tree/type_name.go index a671b41..51e484b 100644 --- a/pkg/sql/sem/tree/type_name.go +++ b/pkg/sql/sem/tree/type_name.go @@ -48,7 +48,7 @@ func (t *TypeName) Format(ctx *FmtCtx) { // SQLString implements the ResolvableTypeReference interface. func (t *TypeName) SQLString() string { // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(t, FmtBareIdentifiers) + return AsStringWithFlags(t, FmtSimple) } func (t *TypeName) objectName() {} @@ -240,13 +240,13 @@ func (node *ArrayTypeReference) Format(ctx *FmtCtx) { // SQLString implements the ResolvableTypeReference interface. func (node *ArrayTypeReference) SQLString() string { // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(node, FmtBareIdentifiers) + return AsStringWithFlags(node, FmtSimple) } // SQLString implements the ResolvableTypeReference interface. func (name *UnresolvedObjectName) SQLString() string { // FmtBareIdentifiers prevents the TypeName string from being wrapped in quotations. - return AsStringWithFlags(name, FmtBareIdentifiers) + return AsStringWithFlags(name, FmtSimple) } // IsReferenceSerialType returns whether the input reference is a known diff --git a/pkg/util/constants.go b/pkg/util/constants.go index 4e2e8b4..ede4b9d 100644 --- a/pkg/util/constants.go +++ b/pkg/util/constants.go @@ -15,7 +15,6 @@ import ( "math/rand" "os" - "github.com/cockroachdb/cockroachdb-parser/pkg/build/bazel" "github.com/cockroachdb/cockroachdb-parser/pkg/util/buildutil" "github.com/cockroachdb/cockroachdb-parser/pkg/util/randutil" "github.com/cockroachdb/cockroachdb-parser/pkg/util/syncutil" @@ -98,11 +97,6 @@ func metamorphicEligible() bool { if !buildutil.CrdbTestBuild { return false } - - if bazel.InTestWrapper() { - return false - } - return true } diff --git a/pkg/util/grunning/disabled.go b/pkg/util/grunning/disabled.go index f175eb2..89fcb2d 100644 --- a/pkg/util/grunning/disabled.go +++ b/pkg/util/grunning/disabled.go @@ -8,11 +8,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -// See grunning.Supported() for an explanation behind this build tag. -// -//go:build (linux && s390x) || !bazel -// +build linux,s390x !bazel - package grunning func grunningnanos() int64 { return 0 } diff --git a/pkg/util/grunning/enabled.go b/pkg/util/grunning/enabled.go deleted file mode 100644 index f8cd1b5..0000000 --- a/pkg/util/grunning/enabled.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -// See grunning.Supported() for an explanation behind this build tag. -// -//go:build !((linux && s390x) || !bazel) -// +build !linux !s390x -// +build bazel - -package grunning - -import _ "unsafe" // for go:linkname - -// grunningnanos returns the running time observed by the current goroutine by -// linking to a private symbol in the (patched) runtime package. -// -//go:linkname grunningnanos runtime.grunningnanos -func grunningnanos() int64 - -func supported() bool { return true } diff --git a/pkg/util/protoutil/jsonpb_marshal.go b/pkg/util/protoutil/jsonpb_marshal.go index cd02994..22aa5c2 100644 --- a/pkg/util/protoutil/jsonpb_marshal.go +++ b/pkg/util/protoutil/jsonpb_marshal.go @@ -20,7 +20,7 @@ import ( "github.com/cockroachdb/errors" "github.com/gogo/protobuf/jsonpb" "github.com/gogo/protobuf/proto" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" ) var _ gwruntime.Marshaler = (*JSONPb)(nil) @@ -31,7 +31,7 @@ var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem() type JSONPb jsonpb.Marshaler // ContentType implements gwruntime.Marshaler. -func (*JSONPb) ContentType() string { +func (*JSONPb) ContentType(_ interface{}) string { // NB: This is the same as httputil.JSONContentType which we can't use due to // an import cycle. const JSONContentType = "application/json" diff --git a/pkg/util/protoutil/marshaler.go b/pkg/util/protoutil/marshaler.go index 6d835ae..7dfae1e 100644 --- a/pkg/util/protoutil/marshaler.go +++ b/pkg/util/protoutil/marshaler.go @@ -15,7 +15,7 @@ import ( "github.com/cockroachdb/errors" "github.com/gogo/protobuf/proto" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" ) var _ gwruntime.Marshaler = (*ProtoPb)(nil) @@ -24,7 +24,7 @@ var _ gwruntime.Marshaler = (*ProtoPb)(nil) type ProtoPb struct{} // ContentType implements gwruntime.Marshaler. -func (*ProtoPb) ContentType() string { +func (*ProtoPb) ContentType(_ interface{}) string { // NB: This is the same as httputil.ProtoContentType which we can't use due // to an import cycle. const ProtoContentType = "application/x-protobuf"