abi_check.sh (1647B)
1 #!/usr/bin/env bash 2 3 # Requirements: 4 # - wdiff 5 # - rfcdiff 6 # - universal-ctags 7 # - abi-tracker 8 # - abi-monitor 9 # - git 10 # 11 # All of this are included in: 12 # docker.pkg.github.com/azat/docker-images/lvc-debian:latest 13 # 14 # TODO: 15 # - move image into libevent namespace 16 17 # verify backward compatibility of API/ABI changes 18 19 set -e 20 21 LIMIT=${1:-2} 22 EVENT_SOURCE_DIR=${EVENT_SOURCE_DIR:-"$(cd "$(dirname "$0")"/../.. && pwd)"} 23 ABI_CHECK_ROOT=${ABI_CHECK_ROOT:-$EVENT_SOURCE_DIR/.abi-check} 24 ABI_CHECK_WORKSPACE=${ABI_CHECK_WORKSPACE:-"work/abi-check"} 25 26 mkdir -p "$ABI_CHECK_ROOT/$ABI_CHECK_WORKSPACE" 27 cd "$ABI_CHECK_ROOT/$ABI_CHECK_WORKSPACE" 28 29 # copy current source code and profile into workspace 30 mkdir -p src/libevent/current 31 mkdir -p installed/libevent/current 32 ( # to avoid cd back 33 cd "$EVENT_SOURCE_DIR" 34 # XXX: not `git archive` since it will not copy changes that are not in index, 35 # and maybe some issues on CI (since it does not contain full clone) 36 find . -maxdepth 1 -mindepth 1 | { 37 git check-ignore --no-index --verbose --non-matching --stdin 38 } | fgrep :: | cut -f2 | grep -v /.git/ | tee /dev/stderr | { 39 xargs cp -r -t "$ABI_CHECK_ROOT/$ABI_CHECK_WORKSPACE/src/libevent/current/" 40 } 41 cp extra/abi-check/libevent.json "$ABI_CHECK_ROOT/$ABI_CHECK_WORKSPACE/" 42 ) 43 44 # run LVC tools 45 abi-monitor -get -limit "$LIMIT" libevent.json 46 # XXX: abi-monitor 1.12 supports "-make -j8", but 1.10 does not 47 # (we can detect which version we have, and add this options) 48 abi-monitor -v current -build libevent.json 49 abi-monitor -build libevent.json 50 abi-tracker -build libevent.json 51 52 # remove useless files 53 rm -rf src installed build_logs libevent.json