Skip to contentSkip to conversation

ABI consistency check

PATCH New Nicolas Morey-Chaisemartin 1 participant 6 messages Nov 16, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ABI consistency check

Add scripts to generate an ABI dump and compare against a ref. Travis will automatically do that if a ref is present. Ref should be added at stable-* branch creation (see doc update)

Changes since v1:
- Import tools as submodules instead of sources.
  Less clutter and no licensing issue.
- Only run gen-abi in travis-checkbuild IF the reference ABI is present (avoid useless ABI builds on the master branch)

Nicolas Morey-Chaisemartin (5):
buidlib: import abi checking tools
buildlib: add script to dump ABI
buildlib: add script to check ABI
buildlib: run ABI check in travis-build
Documentation: update stable doc about ABI reference generation

.gitmodules | 6 ++++++
Documentation/stable.md | 19 ++++++++++++++++++- buildlib/abi-compliance-checker | 1 + buildlib/abi-dumper | 1 +
buildlib/gen-abi | 21 +++++++++++++++++++++ buildlib/travis-build | 4 ++++ buildlib/travis-checkabi | 29 +++++++++++++++++++++++++++++

7 files changed, 80 insertions(+), 1 deletion(-)

create mode 100644 .gitmodules
create mode 160000 buildlib/abi-compliance-checker create mode 160000 buildlib/abi-dumper create mode 100755 buildlib/gen-abi
create mode 100755 buildlib/travis-checkabi

Signature · 6 lines
2.15.0.168.g9a51f1b30.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 551ccda1-bb8d-45bf-1c7c-22a82fc64efc-IBi9RG/[email protected]

#2 lore raw

PATCH v2 1/5 buidlib: import abi checking tools

Add submodules for abi-dumper v1.1 and abi-compliance-checker v2.2

---
 .gitmodules                     | 6 ++++++
 buildlib/abi-compliance-checker | 1 +
 buildlib/abi-dumper             | 1 +
 3 files changed, 8 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 buildlib/abi-compliance-checker
 create mode 160000 buildlib/abi-dumper
.gitmodules new file +6 -0
new file mode 100644
index 00000000..b195afc3
@@ -0,0 +1,6 @@
+[submodule "buildlib/abi-dumper"]
+	path = buildlib/abi-dumper
+	url = https://github.com/lvc/abi-dumper.git
+[submodule "buildlib/abi-compliance-checker"]
+	path = buildlib/abi-compliance-checker
+	url = https://github.com/lvc/abi-compliance-checker.git
buildlib/abi-compliance-checker new file +1 -0
new file mode 160000
index 00000000..e3db9ec3
@@ -0,0 +1 @@
+Subproject commit e3db9ec34127d0a4f109cc4923e191b0822a0e51
buildlib/abi-dumper new file +1 -0
new file mode 160000
index 00000000..000c4cf9
@@ -0,0 +1 @@
+Subproject commit 000c4cf9d20f4f671c4099bcba8ebe3052fe3e1a
Signature · 7 lines
2.15.0.168.g9a51f1b30.dirty


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH v2 2/5 buildlib: add script to dump ABI

In reply to a message not in the archive

Builds rdma-core in -Og/Debug mode and use abi-dumper to generate 1 xml
per .so.*.* file.
Do not use .so file directly. Providers have no symbol exported
and cause abi-dumer to exit with an error.

---
 buildlib/gen-abi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 buildlib/gen-abi
buildlib/gen-abi new file +21 -0
new file mode 100755
index 00000000..f551aa96
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Stop on error
+set -e
+# Echo all commands to Travis log
+set -x
+
+# Force submodule checkout of the needed tools
+git submodule update --init --force
+
+mkdir build-abi
+cd build-abi
+CFLAGS="-g -Og" cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..
+ninja
+
+mkdir ABI
+for FILE in $(find lib -name "*.so.*.*"); do
+	LIB=$(basename $FILE)
+	MODULE_VER=$(echo $LIB | sed -e 's/.*.so\.\(.*\)/\1/')
+	../buildlib/abi-dumper/abi-dumper.pl  -lver $MODULE_VER $FILE -o ABI/$LIB.dump
+done
Signature · 7 lines
2.15.0.168.g9a51f1b30.dirty


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH v2 3/5 buildlib: add script to check ABI

In reply to a message not in the archive

Add travis-checkabi which generates a dump of all rdma-core libraries ABI and checks them against a ref if they exists.

---
 buildlib/travis-checkabi | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100755 buildlib/travis-checkabi
buildlib/travis-checkabi new file +29 -0
new file mode 100755
index 00000000..bbd12b64
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Stop on error
+set -e
+# Echo all commands to Travis log
+set -x
+
+REF_DIR=buildlib/ABI
+NEW_DIR=build-abi/ABI
+
+# No reference ABI to match against.
+if [ ! -d $REF_DIR ]; then
+	echo "INFO: Skipping ABI check. No reference available"
+	exit 0
+fi
+
+./buildlib/gen-abi
+
+# Current ABI not available !
+if [ ! -d $NEW_DIR ]; then
+	echo "ERROR: Missing ABI description files" >&2
+	exit 1
+fi
+
+for FILE in $(find $NEW_DIR -name "*.dump"); do
+	DUMP=$(basename $FILE)
+	LIBNAME=$(echo $DUMP | sed -e 's/\(.*\).so.*/\1/')
+	./buildlib/abi-compliance-checker/abi-compliance-checker.pl -l $LIBNAME -old $REF_DIR/$DUMP -new $NEW_DIR/$DUMP
+done
Signature · 7 lines
2.15.0.168.g9a51f1b30.dirty


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH v2 4/5 buildlib: run ABI check in travis-build

In reply to a message not in the archive

Run travis-checkabi during travis build

---
 buildlib/travis-build | 4 ++++
 1 file changed, 4 insertions(+)
buildlib/travis-build +4 -0
index bf86baa7..f8e5ee05 100755
@@ -5,6 +5,10 @@ set -e
 # Echo all commands to Travis log
 set -x
 
+
+# Build in debug mode and check the ABI against the ref
+./buildlib/travis-checkabi
+
 mkdir build-clang build32 build-sparse build-aarch64
 
 # Build with latest clang first
Signature · 7 lines
2.15.0.168.g9a51f1b30.dirty


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH v2 5/5 Documentation: update stable doc about ABI reference generation

In reply to a message not in the archive
---
 Documentation/stable.md | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
Documentation/stable.md +18 -1
index d7ea9822..d3eb90f5 100644
@@ -56,10 +56,27 @@ You must note the upstream commit ID in the changelog of your submission,
 
 Option 1 is strongly preferred, is the easiest and most common.
 Option 2 and Option 3 are more useful if the patch isn’t deemed worthy at the time it is applied to a public git tree (for instance, because it deserves more regression testing first).
-Option 3 is especially useful if the patch needs some special handling to apply to an older version.
+Option 3 is especially usefu if the patch needs some special handling to apply to an older version.
 
 Note that for Option 3, if the patch deviates from the original upstream patch (for example because it had to be backported) this must be very clearly documented and justified in the patch description.
 
 ## Versioning
 
 See versioning.md for setting package version on a stable branch.
+
+
+## Creating a stable branch
+
+Stable branch should be created from a release tag of the master branch.
+The first thing to do on a master branch is to commit the mainstream release ABI infos
+so that latters patches/fixes can be checked against this reference.
+
+To do that, the creator of the branch should run
+```
+./buildlib/gen-abi
+mv build-abi/ABI buildlib/ABI
+git add buildlib/ABI
+git commit
+```
+
+Note that the ABI must NOT be committed at any point in the master branch.
Signature · 6 lines
2.15.0.168.g9a51f1b30.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html