check-uapi: Introduce check-uapi.sh
authorJohn Moon <quic_johmoo@quicinc.com>
Tue, 12 Dec 2023 02:02:57 +0000 (18:02 -0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 29 Dec 2023 13:25:20 +0000 (22:25 +0900)
commit1f7f31bf7202adcab9616307bcb11a65fb565f63
treea0a26ad6d75e8d0b234aa66e6ca09c33b00f32d8
parent67f8f1e7aa31b6fe17aeee1c581f61fc3dfa331a
check-uapi: Introduce check-uapi.sh

While the kernel community has been good at maintaining backwards
compatibility with kernel UAPIs, it would be helpful to have a tool
to check if a commit introduces changes that break backwards
compatibility.

To that end, introduce check-uapi.sh: a simple shell script that
checks for changes to UAPI headers using libabigail.

libabigail is "a framework which aims at helping developers and
software distributors to spot some ABI-related issues like interface
incompatibility in ELF shared libraries by performing a static
analysis of the ELF binaries at hand."

The script uses one of libabigail's tools, "abidiff", to compile the
changed header before and after the commit to detect any changes.

abidiff "compares the ABI of two shared libraries in ELF format. It
emits a meaningful report describing the differences between the two
ABIs."

The script also includes the ability to check the compatibility of
all UAPI headers across commits. This allows developers to inspect
the stability of the UAPIs over time.

Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/check-uapi.sh [new file with mode: 0755]