Skip to content

Commit

Permalink
Upgrade golang to 1.23.6
Browse files Browse the repository at this point in the history
Also upgrade various codegen tools
  • Loading branch information
ulope committed Feb 19, 2025
1 parent a8f8282 commit 7a78550
Show file tree
Hide file tree
Showing 35 changed files with 462 additions and 770 deletions.
7 changes: 1 addition & 6 deletions .asdf-plugins
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@
# To automatically install these run `make install-asdf-plugins` inside
# the 'rolling-shutter' directory.

babashka
binaryen https://github.com/birros/asdf-binaryen.git
circleci https://github.com/ulope/asdf-circleci.git
clojure
direnv
golang
golangci-lint
java
nodejs
postgres
pre-commit
protoc
python
shfmt
solidity
sqlc https://github.com/schmir/asdf-sqlc.git
tinygo https://github.com/schmir/asdf-tinygo
sqlc https://github.com/ulope/asdf-sqlc.git
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ executors:

go:
docker:
- image: cimg/go:1.21.1
- image: cimg/go:1.23.6
environment:
GO111MODULE: "on"
PIP_DISABLE_PIP_VERSION_CHECK: "1"

go-integration:
docker:
- image: cimg/go:1.21.1
- image: cimg/go:1.23.6
environment:
GO111MODULE: "on"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:

rs-lint:
executor: go
resource_class: medium+
resource_class: xlarge
working_directory: ~/src/rolling-shutter
steps:
- checkout:
Expand All @@ -194,7 +194,7 @@ jobs:
asdf plugin add golangci-lint || true
asdf install golangci-lint
- run: |
make lint-changes
GOLINT_CONCURRENCY=3 make lint-changes
- save_cache:
key: rs-lint-v14-{{ checksum "go.sum" }}-{{ checksum "go.mod" }}
paths:
Expand Down
19 changes: 7 additions & 12 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
babashka 1.3.182
binaryen 114
circleci 0.1.28811
clojure 1.11.1.1386
golang 1.21.4
golangci-lint 1.55.2
java temurin-17.0.5+8
circleci 0.1.31425
golang 1.23.6
golangci-lint 1.64.5
nodejs 18.17.0
postgres 14.2
pre-commit 3.6.0
protoc 22.3
shfmt 3.7.0
pre-commit 4.1.0
protoc 29.3
shfmt 3.10.0
solidity 0.8.9
sqlc 1.22.0
tinygo 0.29.0
sqlc 1.27.0
20 changes: 11 additions & 9 deletions rolling-shutter/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,39 +113,41 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
# `staticcheck` and `gosimple` are disabled because of https://github.com/golangci/golangci-lint/issues/5449
# - depguard
# - unused
- bodyclose
- copyloopvar
- dogsled
- errcheck
- exhaustive
- forbidigo
- funlen
- gci
- goconst
- gocritic
- gocyclo
- godot
- gofumpt
- revive
- goprintffuncname
- gosec
- gosimple
# - gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- nilnesserr
- noctx
- nolintlint
- exportloopref
- staticcheck
- revive
# - staticcheck
- stylecheck
- thelper
- typecheck
- unconvert
- unparam
# - unused
- whitespace
- thelper
- godot
- forbidigo

# don't enable:
# - asciicheck
Expand Down
45 changes: 20 additions & 25 deletions rolling-shutter/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
.POSIX:

GO ?= go
GOFLAGS ?=
TINYGO ?= tinygo
WASMOPT ?= wasm-opt
BINDIR ?= ./bin
WASMDIR ?= ../js/shutter-crypto
EXECUTABLE ?= ${BINDIR}/rolling-shutter
GOPATH ?= $(${GO} env GOPATH)
GO ?= go
GOFLAGS ?=
TINYGO ?= tinygo
WASMOPT ?= wasm-opt
BINDIR ?= ./bin
WASMDIR ?= ../js/shutter-crypto
EXECUTABLE ?= ${BINDIR}/rolling-shutter
GOPATH ?= $(${GO} env GOPATH)
GOLINT_CONCURRENCY ?= 0

TOOL_VERSTION_GOENUM ?= 0.6.0
TOOL_VERSION_PROTOCGENGO ?= 1.36.5
TOOL_VERSION_OAPICODEGEN ?= 1.16.1


build:
${GO} build ${GOFLAGS} -ldflags="-X github.com/shutter-network/rolling-shutter/rolling-shutter/cmd/shversion.version=$(shell git describe --always --dirty)" -o ${EXECUTABLE}
Expand Down Expand Up @@ -55,44 +61,33 @@ coverage:
clean:
rm -f ${EXECUTABLE}

install-tools: install-codegen-tools install-golangci-lint install-cobra install-gofumpt install-gci install-gotestsum
install-tools: install-codegen-tools install-gofumpt install-gci install-gotestsum

# code generation tools: pin version
install-codegen-tools: install-npm install-abigen install-sqlc install-protoc-gen-go install-oapi-codegen install-go-enum
install-codegen-tools: install-npm install-protoc-gen-go install-oapi-codegen install-go-enum

../contracts/node_modules/.mark-npm-install: ../contracts/package.json ../contracts/package-lock.json
cd ../contracts && npm install
@touch ../contracts/node_modules/.mark-npm-install

install-npm: ../contracts/node_modules/.mark-npm-install

${GOPATH}/bin/sqlc:
${GO} install github.com/sqlc-dev/sqlc/cmd/[email protected]
install-sqlc: ${GOPATH}/bin/sqlc


${GOPATH}/bin/go-enum:
${GO} install github.com/abice/go-enum@v0.5.6
${GO} install github.com/abice/go-enum@v${TOOL_VERSTION_GOENUM}
install-go-enum: ${GOPATH}/bin/go-enum

${GOPATH}/bin/abigen:
${GO} install github.com/ethereum/go-ethereum/cmd/[email protected]
install-abigen: ${GOPATH}/bin/abigen


${GOPATH}/bin/protoc-gen-go:
${GO} install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30.0
${GO} install google.golang.org/protobuf/cmd/protoc-gen-go@v${TOOL_VERSION_PROTOCGENGO}
install-protoc-gen-go: ${GOPATH}/bin/protoc-gen-go


${GOPATH}/bin/oapi-codegen:
${GO} install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.1
${GO} install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v${TOOL_VERSION_OAPICODEGEN}
install-oapi-codegen: ${GOPATH}/bin/oapi-codegen

# non code generation tools
install-golangci-lint:
${GO} install github.com/golangci/golangci-lint/cmd/[email protected]

install-gofumpt:
${GO} install mvdan.cc/gofumpt@latest

Expand All @@ -116,7 +111,7 @@ lint:

lint-changes:
base=`git merge-base HEAD origin/main`; \
golangci-lint --verbose run --new-from-rev $${base}
golangci-lint --verbose run --concurrency ${GOLINT_CONCURRENCY} --print-resources-usage --new-from-rev $${base}

abigen:
go generate -x ./contract
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/chainobserver/db/collator/db.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions rolling-shutter/chainobserver/db/collator/models.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/chainobserver/db/keyper/db.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/chainobserver/db/keyper/keyper.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions rolling-shutter/chainobserver/db/keyper/models.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/chainobserver/db/sync/db.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions rolling-shutter/chainobserver/db/sync/models.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/chainobserver/db/sync/sync.sqlc.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rolling-shutter/contract/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package contract contains the abigen generated bindings for rolling shutter's smart contracts
package contract

//go:generate node ../../contracts/scripts/abigen.js
// disabled //go:generate node ../../contracts/scripts/abigen.js
10 changes: 8 additions & 2 deletions rolling-shutter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/shutter-network/rolling-shutter/rolling-shutter

go 1.21.4
go 1.23.6

//replace github.com/ethereum/go-ethereum v1.13.5 => ../../shop-geth/

Expand Down Expand Up @@ -61,6 +61,9 @@ require (
require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
Expand Down Expand Up @@ -144,7 +147,7 @@ require (
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/echo/v4 v4.10.2 // indirect
github.com/labstack/echo/v4 v4.11.4 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
Expand Down Expand Up @@ -181,6 +184,7 @@ require (
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
Expand Down Expand Up @@ -227,6 +231,7 @@ require (
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/yeya24/promlinter v0.3.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
Expand All @@ -244,6 +249,7 @@ require (
gonum.org/v1/gonum v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect
google.golang.org/grpc v1.64.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
Expand Down
Loading

0 comments on commit 7a78550

Please sign in to comment.