fix(build): relup for otp24 failed

The defination of `#application{}` record in systools.hrl is changed in OTP 24.
So we need a rebar3 binary compiled with OTP 24.
This commit is contained in:
Shawn 2022-01-24 18:04:20 +08:00
parent 3cf1fb2519
commit d422e6e700
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,5 @@
$(shell $(CURDIR)/scripts/git-hooks-init.sh)
REBAR_VERSION = 3.14.3-emqx-8
REBAR_VERSION = 3.18.0-emqx-1
REBAR = $(CURDIR)/rebar3
BUILD = $(CURDIR)/build
SCRIPTS = $(CURDIR)/scripts

View File

@ -3,6 +3,7 @@
set -euo pipefail
VERSION="$1"
REBAR3_FILENAME="${REBAR3_FILENAME:-rebar3}"
# ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
@ -10,7 +11,11 @@ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
DOWNLOAD_URL='https://github.com/emqx/rebar3/releases/download'
download() {
curl -f -L "${DOWNLOAD_URL}/${VERSION}/rebar3" -o ./rebar3
curl -f -L "${DOWNLOAD_URL}/${VERSION}/${REBAR3_FILENAME}" -o ./rebar3
}
version_gt() {
test "$(echo "$@" | tr " " "n" | sort -V | head -n 1)" != "$1";
}
# get the version number from the second line of the escript
@ -24,5 +29,10 @@ if [ -f 'rebar3' ] && [ "$(version)" = "$VERSION" ]; then
exit 0
fi
if version_gt "${OTP_VSN}" "24.0.0"; then
echo "$OTP_VSN is greater than 24.0.0"
REBAR3_FILENAME="rebar3_otp24.1.5"
fi
download
chmod +x ./rebar3