Skip to content

Commit

Permalink
Update go min version to v1.17.9 (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Apr 13, 2022
1 parent 397b886 commit f597169
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ============= Compilation Stage ================
FROM golang:1.17.8-buster AS builder
FROM golang:1.17.9-buster AS builder

RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64

ARG AVALANCHE_VERSION
Expand Down
23 changes: 23 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ set -o errexit
set -o nounset
set -o pipefail

go_version_minimum="1.17.9"

go_version() {
go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p'
}

version_lt() {
# Return true if $1 is a lower version than than $2,
local ver1=$1
local ver2=$2
# Reverse sort the versions, if the 1st item != ver1 then ver1 < ver2
if [[ $(echo -e -n "$ver1\n$ver2\n" | sort -rV | head -n1) != "$ver1" ]]; then
return 0
else
return 1
fi
}

if version_lt "$(go_version)" "$go_version_minimum"; then
echo "Coreth requires Go >= $go_version_minimum, Go $(go_version) found." >&2
exit 1
fi

# Avalanche root directory
CORETH_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )

Expand Down

0 comments on commit f597169

Please sign in to comment.