Merge pull request #9496 from filecoin-project/appimage-go1.18.1-fix
_ci_ Appimage go1.18.1 fix
This commit is contained in:
commit
a955a6308a
@ -5,6 +5,7 @@ orbs:
|
|||||||
executors:
|
executors:
|
||||||
golang:
|
golang:
|
||||||
docker:
|
docker:
|
||||||
|
# Must match GO_VERSION_MIN in project root
|
||||||
- image: cimg/go:1.18.1
|
- image: cimg/go:1.18.1
|
||||||
resource_class: 2xlarge
|
resource_class: 2xlarge
|
||||||
ubuntu:
|
ubuntu:
|
||||||
@ -44,6 +45,15 @@ commands:
|
|||||||
- when:
|
- when:
|
||||||
condition: << parameters.linux >>
|
condition: << parameters.linux >>
|
||||||
steps:
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Check Go Version
|
||||||
|
command: |
|
||||||
|
v=`go version | { read _ _ v _; echo ${v#go}; }`
|
||||||
|
if [[ $v != `cat GO_VERSION_MIN` ]]; then
|
||||||
|
echo "GO_VERSION_MIN file does not match the go version being used."
|
||||||
|
echo "Please update image to cimg/go:`cat GO_VERSION_MIN` or update GO_VERSION_MIN to $v."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- run: sudo apt-get update
|
- run: sudo apt-get update
|
||||||
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
|
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
|
||||||
- when:
|
- when:
|
||||||
@ -52,7 +62,7 @@ commands:
|
|||||||
- run:
|
- run:
|
||||||
name: Install Go
|
name: Install Go
|
||||||
command: |
|
command: |
|
||||||
curl https://dl.google.com/go/go1.18.1.darwin-amd64.pkg -o /tmp/go.pkg && \
|
curl https://dl.google.com/go/go`cat GO_VERSION_MIN`.darwin-amd64.pkg -o /tmp/go.pkg && \
|
||||||
sudo installer -pkg /tmp/go.pkg -target /
|
sudo installer -pkg /tmp/go.pkg -target /
|
||||||
- run:
|
- run:
|
||||||
name: Export Go
|
name: Export Go
|
||||||
@ -427,7 +437,8 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Update Go
|
name: Update Go
|
||||||
command: |
|
command: |
|
||||||
curl -L https://golang.org/dl/go1.18.1.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
|
sudo rm -rf /usr/local/go && \
|
||||||
|
curl -L https://golang.org/dl/go`cat GO_VERSION_MIN`.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
|
||||||
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
|
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
|
||||||
- run: go version
|
- run: go version
|
||||||
- run:
|
- run:
|
||||||
|
@ -5,6 +5,7 @@ orbs:
|
|||||||
executors:
|
executors:
|
||||||
golang:
|
golang:
|
||||||
docker:
|
docker:
|
||||||
|
# Must match GO_VERSION_MIN in project root
|
||||||
- image: cimg/go:1.18.1
|
- image: cimg/go:1.18.1
|
||||||
resource_class: 2xlarge
|
resource_class: 2xlarge
|
||||||
ubuntu:
|
ubuntu:
|
||||||
@ -44,6 +45,15 @@ commands:
|
|||||||
- when:
|
- when:
|
||||||
condition: << parameters.linux >>
|
condition: << parameters.linux >>
|
||||||
steps:
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Check Go Version
|
||||||
|
command: |
|
||||||
|
v=`go version | { read _ _ v _; echo ${v#go}; }`
|
||||||
|
if [["[[ $v != `cat GO_VERSION_MIN` ]]"]]; then
|
||||||
|
echo "GO_VERSION_MIN file does not match the go version being used."
|
||||||
|
echo "Please update image to cimg/go:`cat GO_VERSION_MIN` or update GO_VERSION_MIN to $v."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- run: sudo apt-get update
|
- run: sudo apt-get update
|
||||||
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
|
- run: sudo apt-get install ocl-icd-opencl-dev libhwloc-dev
|
||||||
- when:
|
- when:
|
||||||
@ -52,7 +62,7 @@ commands:
|
|||||||
- run:
|
- run:
|
||||||
name: Install Go
|
name: Install Go
|
||||||
command: |
|
command: |
|
||||||
curl https://dl.google.com/go/go1.18.1.darwin-amd64.pkg -o /tmp/go.pkg && \
|
curl https://dl.google.com/go/go`cat GO_VERSION_MIN`.darwin-amd64.pkg -o /tmp/go.pkg && \
|
||||||
sudo installer -pkg /tmp/go.pkg -target /
|
sudo installer -pkg /tmp/go.pkg -target /
|
||||||
- run:
|
- run:
|
||||||
name: Export Go
|
name: Export Go
|
||||||
@ -427,7 +437,8 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Update Go
|
name: Update Go
|
||||||
command: |
|
command: |
|
||||||
curl -L https://golang.org/dl/go1.18.1.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
|
sudo rm -rf /usr/local/go && \
|
||||||
|
curl -L https://golang.org/dl/go`cat GO_VERSION_MIN`.linux-amd64.tar.gz -o /tmp/go.tar.gz && \
|
||||||
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
|
sudo tar -C /usr/local -xvf /tmp/go.tar.gz
|
||||||
- run: go version
|
- run: go version
|
||||||
- run:
|
- run:
|
||||||
|
1
GO_VERSION_MIN
Normal file
1
GO_VERSION_MIN
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.18.1
|
6
Makefile
6
Makefile
@ -8,9 +8,11 @@ unexport GOFLAGS
|
|||||||
GOCC?=go
|
GOCC?=go
|
||||||
|
|
||||||
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
|
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
|
||||||
ifeq ($(shell expr $(GOVERSION) \< 1018001), 1)
|
GOVERSIONMIN:=$(shell cat GO_VERSION_MIN | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
|
||||||
|
|
||||||
|
ifeq ($(shell expr $(GOVERSION) \< $(GOVERSIONMIN)), 1)
|
||||||
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
|
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
|
||||||
$(error Update Golang to version to at least 1.18.1)
|
$(error Update Golang to version to at least $(shell cat GO_VERSION_MIN))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# git modules that need to be loaded
|
# git modules that need to be loaded
|
||||||
|
Loading…
Reference in New Issue
Block a user