diff --git a/abi-diff.sh b/abi-diff.sh new file mode 100755 index 0000000..80080a6 --- /dev/null +++ b/abi-diff.sh @@ -0,0 +1,63 @@ +#!/bin/sh +set -e -x + +# need abi-dumper vtable-dumper abi-compliance-checker ctags-universal +# circa >= Debian 11 + +die() { + echo "$1" >&1 + exit 1 +} + +OLD="$1" +NEW="${2:-HEAD}" + +# default to tag before $NEW +[ "$OLD" ] || OLD="$(git describe --abbrev=0 "$NEW")" + +[ "$OLD" -a "$NEW" ] || die "usage: $0 " + +echo "Diff $OLD -> $NEW" + +TDIR=`mktemp -d` +trap 'rm -rf "$TDIR"' EXIT INT QUIT TERM + +# abi-dumper is very particular about ctags variant +install -d "$TDIR/bin" +ln -s "$(which ctags-universal)" "$TDIR/bin/ctags" +PATH="$TDIR/bin:$PATH" + +which ctags +ctags --version + +# $1 rev +# $2 dir +setupsrc() { + mkdir "$2" + + git archive "$1" | tar -C "$2" -xv + # would be nice to use clone, and get sub-modules. + # but no such luck... + #git clone --branch "$1" --depth 1 --recurse-submodules --shallow-submodules --reference file://$PWD file://$PWD "$2" + + [ -f configure/RELEASE.local ] && cp configure/RELEASE.local "$2/configure/" + [ -f configure/CONFIG_SITE.local ] && cp configure/CONFIG_SITE.local "$2/configure/" + + sed -i -e "s|\$(TOP)|$(pwd)|g" -e 's|-Werror||g' "$2/configure"/*.local + + # assume host libevent_core is available + #make -C "$2/bundle" libevent -j8 + make -C "$2" CROSS_COMPILER_TARGET_ARCHS= OPT_CFLAGS='-g -Og' OPT_CXXFLAGS='-g -Og' src -j8 + + nm -g "$2"/lib/linux-*/libpvxs.so.* |sed -e 's|^[0-9a-f]*\s*||' > "$TDIR/$1.nm" + + abi-dumper "$2"/lib/linux-*/libpvxs.so.* -o "$TDIR/$1.dump" -public-headers "$2/include" -lver "$1" +} + +setupsrc "$OLD" "$TDIR/old" +setupsrc "$NEW" "$TDIR/new" + +# I don't totally trust abicc, so let's have a second opinion... +diff -u "$TDIR/$OLD.nm" "$TDIR/$NEW.nm" || true + +abi-compliance-checker -l libpvxs -old "$TDIR/$OLD.dump" -new "$TDIR/$NEW.dump" diff --git a/coverage.sh b/coverage.sh new file mode 100755 index 0000000..5a28cfe --- /dev/null +++ b/coverage.sh @@ -0,0 +1,38 @@ +#!/bin/sh +set -e -u -x + +# needs 'gcov' executable and gcovr script installed +# as well https://github.com/gcovr/gcovr + +gcovr --version + +REV="${1:-HEAD}" + +TDIR=`mktemp -d` +trap 'rm -rf "$TDIR"' EXIT INT QUIT TERM + +git archive "$REV" | tar -C "$TDIR" -xv + +[ -f configure/RELEASE.local ] && cp configure/RELEASE.local "$TDIR/configure/" +[ -f configure/CONFIG_SITE.local ] && cp configure/CONFIG_SITE.local "$TDIR/configure/" + +sed -i -e "s|\$(TOP)|$(pwd)|g" -e 's|-Werror||g' "$TDIR/configure"/*.local + +make -C "$TDIR" -j8 \ + CROSS_COMPILER_TARGET_ARCHS= \ + CMD_CXXFLAGS='-fprofile-arcs -ftest-coverage -O0' \ + CMD_LDFLAGS='-fprofile-arcs -ftest-coverage' \ + test + +make -C "$TDIR" -j8 \ + CROSS_COMPILER_TARGET_ARCHS= \ + CMD_CXXFLAGS='-fprofile-arcs -ftest-coverage -O0' \ + CMD_LDFLAGS='-fprofile-arcs -ftest-coverage' \ + runtests + +OUTDIR="$PWD" +cd "$TDIR"/src/O.linux-* + +gcovr -v -r .. --html --html-details -o coverage.html + +tar -cavf "$OUTDIR"/coverage.tar.bz2 coverage*.html diff --git a/release.md b/release.md new file mode 100644 index 0000000..d42e998 --- /dev/null +++ b/release.md @@ -0,0 +1,17 @@ +# Release Process + +1. Check version number in configure/CONFIG_PVXS_VERSION +2. Remove pre-release suffix in setup.py +3. Finalize section in documentation/releasenotes.rst +4. Search/replace `UNRELEASED` tags in doxygen comments + + git grep -l UNRELEASED */pvxs/*.h documentation/*.rst | xargs sed -i -e 's|UNRELEASED|0.0.0|g' + +Don't change in details.rst and releasenotes.rst + +## Post Release + +1. Update configure/CONFIG_PVXS_VERSION + Increment PVXS_MAINTENANCE_VERSION and add new PVXS_#_#_# +2. Add pre-release suffix in setup.py +3. New section in documentation/releasenotes.rst