Skip to content

Commit

Permalink
support go 1.20 (#3137)
Browse files Browse the repository at this point in the history
* support go 1.20

* support go 1.20

* fix circleci img

* support go 1.20

* fix circleci permission

* fix auto-install.sh

* fix ci-exchain-ut.yml

---------

Co-authored-by: KamiD <44460798+KamiD@users.noreply.github.com>
  • Loading branch information
chengzhinei and KamiD authored Jun 7, 2023
1 parent e499b24 commit 50ff03d
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 329 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ commands:
jobs:
build:
docker:
- image: circleci/golang:1.17
working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
- image: cimg/go:1.20
working_directory: /home/circleci/go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
steps:
- checkout
- restore_cache:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-exchain-ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Run Test exchain/app
id: first-attempt
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Run Test exchain/x
id: first-attempt
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Go Test exchain/libs/tm
id: first-attempt
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Go Test exchain/libs/ibc-go
id: first-attempt
Expand All @@ -149,7 +149,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Go Test exchain/libs/cosmos-sdk/x
id: first-attempt
Expand All @@ -175,7 +175,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: "1.20"

- name: Go Test exchain/libs/other
id: first-attempt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# > docker build -t exchain .
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.exchaind:/root/.exchaind -v ~/.exchaincli:/root/.exchaincli exchain exchaind init mynode
# > docker run -it -p 36657:36657 -p 36656:36656 -v ~/.exchaind:/root/.exchaind -v ~/.exchaincli:/root/.exchaincli exchain exchaind start
FROM golang:1.17.2-alpine AS build-env
FROM golang:1.20.2-alpine AS build-env

# Install minimum necessary dependencies, remove packages
RUN apk add --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export GO111MODULE=on

GithubTop=github.com

GO_VERSION=1.17
GO_VERSION=1.20
ROCKSDB_VERSION=6.27.3
IGNORE_CHECK_GO=false
install_rocksdb_version:=$(ROCKSDB_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Infrastructure of Decentralized Exchange

This repository hosts `OKTC`, the implementation of the OKTC based on the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk).

**Note**: Requires [Go 1.17](https://golang.org/dl/)
**Note**: Requires [Go 1.20](https://golang.org/dl/)

## Getting Started
Refer to the [documentation](https://okexchain-docs.readthedocs.io/en/latest/index.html).
Expand Down
10 changes: 5 additions & 5 deletions dev/auto-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GetArchitecture() {
echo "echo Arch Linux detected."
os="linux"
deptool="ldd"
goAchive="go1.17.linux-amd64.tar.gz"
goAchive="go1.20.2.linux-amd64.tar.gz"
libArray=("/usr/local/lib/librocksdb.so.6.27.3" "/usr/local/lib/librocksdb.so.6.27" "/usr/local/lib/librocksdb.so.6" "/usr/local/lib/librocksdb.so" "/usr/lib/librocksdb.so.6.27.3" "/usr/lib/librocksdb.so.6.27" "/usr/lib/librocksdb.so.6" "/usr/lib/librocksdb.so")
rocksdbdep=("/usr/local/lib/pkconfig/rocksdb.pc" "/usr/local/include/rocksdb" "/usr/local/lib/librocksdb.so*" "/usr//lib/pkconfig/rocksdb.pc" "/usr/include/rocksdb" "/usr/lib/librocksdb.so*")
case "$(getOSName)" in
Expand Down Expand Up @@ -108,9 +108,9 @@ GetArchitecture() {
echo "$_cputype"
if [ "$_cputype" == "arm64" ]
then
goAchive="go1.17.darwin-arm64.tar.gz"
goAchive="go1.20.2.darwin-arm64.tar.gz"
else
goAchive="go1.17.darwin-amd64.tar.gz"
goAchive="go1.20.2.darwin-amd64.tar.gz"
fi
brew install wget
else
Expand Down Expand Up @@ -222,12 +222,12 @@ Prepare() {

v=$(/usr/local/go/bin/go version | { read _ _ v _; echo ${v#go}; })
# shellcheck disable=SC2046
if [ $(checkgoversion "$v") -ge $(checkgoversion "1.17") ]
if [ $(checkgoversion "$v") -ge $(checkgoversion "1.20") ]
then
echo "$v"
echo "should not install go"
else
echo "should install go version above 1.17"
echo "should install go version above 1.20"
installgo
fi

Expand Down
2 changes: 1 addition & 1 deletion dev/client/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/okex/exchain/dev/client

go 1.17
go 1.20

require (
github.com/cosmos/cosmos-sdk v0.39.2
Expand Down
2 changes: 1 addition & 1 deletion dev/vmbridge/counter/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module vmbridge

go 1.17
go 1.20

require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/okex/exchain

go 1.17
go 1.20

require (
github.com/99designs/keyring v1.1.6
Expand Down
Loading

0 comments on commit 50ff03d

Please sign in to comment.