Skip to content

Commit baef8c0

Browse files
Stebalienvyzo
authored andcommitted
chore: update golang and go-ipfs
1. go 1.16.4 is not supported. 2. go-ipfs 0.4.22 is NOT SUPPORTED! 3. switch go cimg/go 4. Remove unnecessary CI dependencies.
1 parent 17e1fcb commit baef8c0

File tree

12 files changed

+555
-73
lines changed

12 files changed

+555
-73
lines changed

.circleci/config.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
version: 2.1
22
orbs:
3-
go: gotest/tools@0.0.13
43
aws-cli: circleci/aws-cli@1.3.2
54

65
executors:
76
golang:
87
docker:
9-
- image: circleci/golang:1.16.4
8+
- image: cimg/go:1.17.9
109
resource_class: 2xlarge
1110
ubuntu:
1211
docker:
@@ -25,8 +24,9 @@ executors:
2524
commands:
2625
install-deps:
2726
steps:
28-
- go/install-ssh
29-
- go/install: {package: git}
27+
- run: |
28+
sudo apt update
29+
sudo apt install python-is-python3
3030
prepare:
3131
parameters:
3232
linux:
@@ -68,14 +68,14 @@ commands:
6868
- run: |
6969
apt update
7070
apt install -y wget
71-
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
72-
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
73-
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
71+
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
72+
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
73+
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
7474
then
7575
echo "ipfs failed checksum check"
7676
exit 1
7777
fi
78-
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
78+
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
7979
mv go-ipfs/ipfs /usr/local/bin/ipfs
8080
chmod +x /usr/local/bin/ipfs
8181
git_fetch_all_tags:
@@ -116,8 +116,12 @@ jobs:
116116
steps:
117117
- install-deps
118118
- prepare
119-
- go/mod-tidy-check
120-
119+
- run: go mod tidy -v
120+
- run:
121+
name: Check git diff
122+
command: |
123+
git --no-pager diff go.mod go.sum
124+
git --no-pager diff --quiet go.mod go.sum
121125
build-all:
122126
executor: golang
123127
steps:
@@ -194,9 +198,6 @@ jobs:
194198
command: make deps lotus
195199
no_output_timeout: 30m
196200
- download-params
197-
- go/install-gotestsum:
198-
gobin: $HOME/.local/bin
199-
version: 0.5.2
200201
- run:
201202
name: go test
202203
environment:
@@ -222,8 +223,6 @@ jobs:
222223
- when:
223224
condition: << parameters.codecov-upload >>
224225
steps:
225-
- go/install: {package: bash}
226-
- go/install: {package: curl}
227226
- run:
228227
shell: /bin/bash -eo pipefail
229228
command: |
@@ -262,9 +261,6 @@ jobs:
262261
cd extern/test-vectors
263262
git fetch
264263
git checkout origin/<< parameters.vectors-branch >>
265-
- go/install-gotestsum:
266-
gobin: $HOME/.local/bin
267-
version: 0.5.2
268264
- run:
269265
name: install statediff globally
270266
command: |
@@ -377,8 +373,8 @@ jobs:
377373
- run:
378374
name: Install go
379375
command: |
380-
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
381-
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
376+
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
377+
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
382378
- run:
383379
name: Install pkg-config
384380
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
@@ -519,9 +515,6 @@ jobs:
519515
executor:
520516
type: executor
521517
default: golang
522-
golangci-lint-version:
523-
type: string
524-
default: 1.27.0
525518
concurrency:
526519
type: string
527520
default: '2'
@@ -540,13 +533,10 @@ jobs:
540533
- run:
541534
command: make deps
542535
no_output_timeout: 30m
543-
- go/install-golangci-lint:
544-
gobin: $HOME/.local/bin
545-
version: << parameters.golangci-lint-version >>
546536
- run:
547537
name: Lint
548538
command: |
549-
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
539+
golangci-lint run -v --timeout 2m \
550540
--concurrency << parameters.concurrency >> << parameters.args >>
551541
lint-all:
552542
<<: *lint

.circleci/template.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
version: 2.1
22
orbs:
3-
go: gotest/tools@0.0.13
43
aws-cli: circleci/aws-cli@1.3.2
54

65
executors:
76
golang:
87
docker:
9-
- image: circleci/golang:1.16.4
8+
- image: cimg/go:1.17.9
109
resource_class: 2xlarge
1110
ubuntu:
1211
docker:
@@ -25,8 +24,9 @@ executors:
2524
commands:
2625
install-deps:
2726
steps:
28-
- go/install-ssh
29-
- go/install: {package: git}
27+
- run: |
28+
sudo apt update
29+
sudo apt install python-is-python3
3030
prepare:
3131
parameters:
3232
linux:
@@ -68,14 +68,14 @@ commands:
6868
- run: |
6969
apt update
7070
apt install -y wget
71-
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
72-
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
73-
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
71+
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
72+
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
73+
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
7474
then
7575
echo "ipfs failed checksum check"
7676
exit 1
7777
fi
78-
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
78+
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
7979
mv go-ipfs/ipfs /usr/local/bin/ipfs
8080
chmod +x /usr/local/bin/ipfs
8181
git_fetch_all_tags:
@@ -116,8 +116,12 @@ jobs:
116116
steps:
117117
- install-deps
118118
- prepare
119-
- go/mod-tidy-check
120-
119+
- run: go mod tidy -v
120+
- run:
121+
name: Check git diff
122+
command: |
123+
git --no-pager diff go.mod go.sum
124+
git --no-pager diff --quiet go.mod go.sum
121125
build-all:
122126
executor: golang
123127
steps:
@@ -194,9 +198,6 @@ jobs:
194198
command: make deps lotus
195199
no_output_timeout: 30m
196200
- download-params
197-
- go/install-gotestsum:
198-
gobin: $HOME/.local/bin
199-
version: 0.5.2
200201
- run:
201202
name: go test
202203
environment:
@@ -222,8 +223,6 @@ jobs:
222223
- when:
223224
condition: << parameters.codecov-upload >>
224225
steps:
225-
- go/install: {package: bash}
226-
- go/install: {package: curl}
227226
- run:
228227
shell: /bin/bash -eo pipefail
229228
command: |
@@ -262,9 +261,6 @@ jobs:
262261
cd extern/test-vectors
263262
git fetch
264263
git checkout origin/<< parameters.vectors-branch >>
265-
- go/install-gotestsum:
266-
gobin: $HOME/.local/bin
267-
version: 0.5.2
268264
- run:
269265
name: install statediff globally
270266
command: |
@@ -377,8 +373,8 @@ jobs:
377373
- run:
378374
name: Install go
379375
command: |
380-
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
381-
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
376+
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
377+
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
382378
- run:
383379
name: Install pkg-config
384380
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
@@ -519,9 +515,6 @@ jobs:
519515
executor:
520516
type: executor
521517
default: golang
522-
golangci-lint-version:
523-
type: string
524-
default: 1.27.0
525518
concurrency:
526519
type: string
527520
default: '2'
@@ -540,13 +533,10 @@ jobs:
540533
- run:
541534
command: make deps
542535
no_output_timeout: 30m
543-
- go/install-golangci-lint:
544-
gobin: $HOME/.local/bin
545-
version: << parameters.golangci-lint-version >>
546536
- run:
547537
name: Lint
548538
command: |
549-
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
539+
golangci-lint run -v --timeout 2m \
550540
--concurrency << parameters.concurrency >> << parameters.args >>
551541
lint-all:
552542
<<: *lint

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- uses: actions/setup-go@v1
3939
with:
40-
go-version: '1.16.4'
40+
go-version: '1.17.9'
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL

Dockerfile.lotus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.16.4 AS builder-deps
1+
FROM golang:1.17.9-buster AS builder-deps
22
MAINTAINER Lotus Development Team
33

44
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GOCC?=go
1010
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
1111
ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
1212
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
13-
$(error Update Golang to version to at least 1.16.0)
13+
$(error Update Golang to version to at least 1.17.9)
1414
endif
1515

1616
# git modules that need to be loaded

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="https://circleci.com/gh/filecoin-project/lotus"><img src="https://circleci.com/gh/filecoin-project/lotus.svg?style=svg"></a>
1111
<a href="https://codecov.io/gh/filecoin-project/lotus"><img src="https://codecov.io/gh/filecoin-project/lotus/branch/master/graph/badge.svg"></a>
1212
<a href="https://goreportcard.com/report/github.com/filecoin-project/lotus"><img src="https://goreportcard.com/badge/github.com/filecoin-project/lotus" /></a>
13-
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
13+
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.17-blue.svg" /></a>
1414
<br>
1515
</p>
1616

@@ -71,10 +71,10 @@ For other distributions you can find the required dependencies [here.](https://d
7171

7272
#### Go
7373

74-
To build Lotus, you need a working installation of [Go 1.16.4 or higher](https://golang.org/dl/):
74+
To build Lotus, you need a working installation of [Go 1.17.9 or higher](https://golang.org/dl/):
7575

7676
```bash
77-
wget -c https://golang.org/dl/go1.16.4.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
77+
wget -c https://golang.org/dl/go1.17.9.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
7878
```
7979

8080
**TIP:**

0 commit comments

Comments
 (0)