Skip to contentSkip to conversation

ndctl, contrib: Add helper scripts for new release

PATCH Superseded Vishal Verma 2 participants 3 messages Jun 15, 2018 libnvdimm: non-volatile memory device

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl, contrib: Add helper scripts for new release

Add a couple of helper scripts to codify the release process. First is do_abidiff: This builds RPMs for two different versions of ndctl (specified as a git revision range, for example vXX.Y..HEAD). It then uses abipkgdiff to determine whether the commits in that range (collectively) introduced any compatibility breaking ABI changes. Changing or removing a publicly exported function is considered a breakage, where as adding new functions is acceptable.

Second is prepare-release.sh: Its primary purpose is to codify the libtool version update. It does a variety of sanity checks to ensure we didn't involuntarily bump the soname, or update the libtool version in an unexpected way.

prepare-release.sh also calls do_abidiff to perform an abi check between the last bug-fix update and the new version about to be released.

---
 contrib/do_abidiff         |  73 ++++++++++++++
 contrib/prepare-release.sh | 201 +++++++++++++++++++++++++++++++++++++
 2 files changed, 274 insertions(+)
 create mode 100755 contrib/do_abidiff
 create mode 100755 contrib/prepare-release.sh
contrib/do_abidiff new file +73 -0
new file mode 100755
index 0000000..9adc93a
@@ -0,0 +1,73 @@
+#!/bin/bash -e
+
+# WARNING: This will wipe ~/rpmbuild
+
+range="$*"
+old="${range%%..*}"
+new="${range##*..}"
+
+err()
+{
+	echo "$1"
+	exit 1
+}
+
+build_rpm()
+{
+	local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+	local ref="$1"
+
+	# setup rpmbuild env
+	rpmdev-wipetree && rpmdev-setuptree
+
+	# prepare ndctl tree
+	git checkout -b rel_${ref} $ref
+	./autogen.sh
+	./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
+	make clean
+	make rhel/ndctl.spec
+	mkdir -p ~/git/
+	[ -d ~/git/ndctl/ ] && err "~/git/ndctl already exists, please remove it" || true
+	cp -r $(readlink -f .) ~/git/
+
+	# build and copy RPMs
+	./rpmbuild.sh
+	mkdir -p release/rel_${ref}/
+	cp ~/rpmbuild/RPMS/x86_64/*.rpm release/rel_${ref}/
+
+	# restore ndctl branch
+	git checkout $cur
+	git branch -D rel_${ref}
+	rm -rf ~/git/ndctl
+}
+
+do_diff()
+{
+	local pkg="$1"
+	local old_base="$(find . -regex "./release/rel_${old}/${pkg}-[0-9]+.*" | head -1)"
+	local new_base="$(find . -regex "./release/rel_${new}/${pkg}-[0-9]+.*" | head -1)"
+	local old_dev="$(find . -regex "./release/rel_${old}/${pkg}-devel-[0-9]+.*" | head -1)"
+	local new_dev="$(find . -regex "./release/rel_${new}/${pkg}-devel-[0-9]+.*" | head -1)"
+	local old_lib="$(find . -regex "./release/rel_${old}/${pkg}-libs-[0-9]+.*" | head -1)"
+	local new_lib="$(find . -regex "./release/rel_${new}/${pkg}-libs-[0-9]+.*" | head -1)"
+
+	[ -n "$pkg" ] || err "specify a package for diff (ndctl, daxctl)"
+
+	abipkgdiff --dso-only --no-added-syms --harmless --drop-private-types \
+		--devel1 "$old_dev" --devel2 "$new_dev" \
+		"$old_base" "$new_base"
+	abipkgdiff  --no-added-syms --harmless --drop-private-types \
+		--devel1 "$old_dev" --devel2 "$new_dev" \
+		"$old_lib" "$new_lib"
+}
+
+[ -e "COPYING" ] || err "Run from the top level of an ndctl tree"
+if ! command -v "abipkgdiff" >/dev/null; then
+	err "missing abipkgdiff. Please install libabigail"
+fi
+rm -rf release/rel*
+
+build_rpm $old > /dev/null 2>&1
+build_rpm $new > /dev/null 2>&1
+do_diff ndctl
+do_diff daxctl
contrib/prepare-release.sh new file +201 -0

201 lines not on this page · raw message

Signature · 6 lines
2.17.0

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw
Quoted 8 lines · Vishal Verma

Add a couple of helper scripts to codify the release process. First is do_abidiff: This builds RPMs for two different versions of ndctl (specified as a git revision range, for example vXX.Y..HEAD). It then uses abipkgdiff to determine whether the commits in that range (collectively) introduced any compatibility breaking ABI changes. Changing or removing a publicly exported function is considered a breakage, where as adding new functions is acceptable.

Quoted 7 lines

Second is prepare-release.sh: Its primary purpose is to codify the libtool version update. It does a variety of sanity checks to ensure we didn't involuntarily bump the soname, or update the libtool version in an unexpected way.

prepare-release.sh also calls do_abidiff to perform an abi check between the last bug-fix update and the new version about to be released.

Nice! Good idea.

Quoted 27 lines
---
 contrib/do_abidiff         |  73 ++++++++++++++
 contrib/prepare-release.sh | 201 +++++++++++++++++++++++++++++++++++++
 2 files changed, 274 insertions(+)
 create mode 100755 contrib/do_abidiff
 create mode 100755 contrib/prepare-release.sh
contrib/do_abidiff new file +11 -0
new file mode 100755
index 0000000..9adc93a
@@ -0,0 +1,73 @@
+#!/bin/bash -e
+
+# WARNING: This will wipe ~/rpmbuild
+
+range="$*"
+old="${range%%..*}"
+new="${range##*..}"
+
+err()
+{
+       echo "$1"

contrib/do_abidiff line 21

Quoted 10 lines
contrib/do_abidiff new file +10 -0
+       exit 1
+}
+
+build_rpm()
+{
+       local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+       local ref="$1"
+
+       # setup rpmbuild env
+       rpmdev-wipetree && rpmdev-setuptree

Perhaps let's use mock here instead. In addition to including the ability clean the build tree it can also target rawhide rather than the current developer's Fedora version.

You would use "rpmbuild -bs" to create a source rpm and then hand that off to mock.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

author maintainer
#2 lore raw
Quoted 63 lines · Dan Williams
Quoted 8 lines · Vishal Verma

Add a couple of helper scripts to codify the release process. First is do_abidiff: This builds RPMs for two different versions of ndctl (specified as a git revision range, for example vXX.Y..HEAD). It then uses abipkgdiff to determine whether the commits in that range (collectively) introduced any compatibility breaking ABI changes. Changing or removing a publicly exported function is considered a breakage, where as adding new functions is acceptable.

Quoted 8 lines

Second is prepare-release.sh: Its primary purpose is to codify the libtool version update. It does a variety of sanity checks to ensure we didn't involuntarily bump the soname, or update the libtool version in an unexpected way.

prepare-release.sh also calls do_abidiff to perform an abi check between
the last bug-fix update and the new version about to be released.

Nice! Good idea.

Quoted 27 lines
---
 contrib/do_abidiff         |  73 ++++++++++++++
 contrib/prepare-release.sh | 201 +++++++++++++++++++++++++++++++++++++
 2 files changed, 274 insertions(+)
 create mode 100755 contrib/do_abidiff
 create mode 100755 contrib/prepare-release.sh
contrib/do_abidiff new file +11 -0
new file mode 100755
index 0000000..9adc93a
@@ -0,0 +1,73 @@
+#!/bin/bash -e
+
+# WARNING: This will wipe ~/rpmbuild
+
+range="$*"
+old="${range%%..*}"
+new="${range##*..}"
+
+err()
+{
+       echo "$1"

contrib/do_abidiff line 21

Quoted 10 lines
contrib/do_abidiff new file +10 -0
+       exit 1
+}
+
+build_rpm()
+{
+       local cur=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
+       local ref="$1"
+
+       # setup rpmbuild env
+       rpmdev-wipetree && rpmdev-setuptree

Perhaps let's use mock here instead. In addition to including the ability clean the build tree it can also target rawhide rather than the current developer's Fedora version.

Quoted 2 lines

You would use "rpmbuild -bs" to create a source rpm and then hand that off to mock.

Agreed, I'm changing this to use fedpkg to perform the mock build. That would be even more low impact/dependence on the developer environment, and gets us as close as possible to Fedora's build environment.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm