abi-check target was updated to check against the previous release

As abi-dumper and abi-compliance-checker tools are not always reliable
when run across systems, we compare the previous tag ABI with the current
compiled library.

Resolves #42
parent 70fd156c
Pipeline #19092110 passed with stages
in 45 minutes and 50 seconds
......@@ -6,27 +6,45 @@ variables:
GET_SOURCES_ATTEMPTS: "3"
# In this build we combine
# * syntax-check
# * abi-check
# * fuzz/ building
# * distcheck
# * build/valgrind-check
Debian GNU/Linux:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap
- ./configure -C --disable-doc --enable-gcc-warnings --enable-valgrind-tests
- make syntax-check
- echo "nproc="$(nproc)" "$nproc
- make -j$(nproc) check
- make -j$(nproc) -C fuzz
tags:
- shared
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- tests/*.log
# In this build we combine
# * syntax-check
# * abi-check
# * distcheck
# It is not run on tags
abi/dist-check:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap
- CFLAGS="-g -Og" ./configure -C --disable-doc
- make syntax-check
- make -j$(nproc)
- make abi-check
- make -C fuzz
- make clean
- ./configure -C --enable-gtk-doc --enable-gtk-doc-pdf --disable-gcc-warnings --disable-valgrind-tests
- make
- CFLAGS="-g -Og" ./configure -C --enable-gtk-doc --enable-gtk-doc-pdf --disable-gcc-warnings --disable-valgrind-tests
- make -j$(nproc)
- DISTCHECK_CONFIGURE_FLAGS=--disable-gtk-doc make distcheck
tags:
- shared
except:
- tags
artifacts:
expire_in: 2 weeks
when: on_failure
......
......@@ -47,31 +47,45 @@ local-code-coverage-output: code-coverage-capture
@cat libidn2-$(VERSION)-coverage/index.html|grep headerCovTableEntryHi|head -1|sed 's/^.*>\([0-9]\+\.[0-9]\+\s*%\)<.*$$/ coverage lines: \1/' || true
ABI_TMPDIR="headers.abi.tmp"
ABI_TMPFILE="abi-temp.xml"
abi-check:
$(MAKE) -C gl
$(MAKE) -C lib
@rm -f $(ABI_TMPFILE)
ABI_TMPCLONEDIR="libidn2-prev-abi.tmp"
ABI_TMPFILE1="abi-temp-cur.xml"
ABI_TMPFILE2="abi-temp-prev.xml"
ABIREF := $(shell git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags|tail -1)
ABIVER := $(shell git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags|tail -1|cut -d '/' -f 3|sed -e 's/libidn2-//' -e 's/_/./g')
prev-tag-abi.stamp:
@rm -rf $(ABI_TMPCLONEDIR)
@git clone -l . $(ABI_TMPCLONEDIR)
@echo "Creating ABI for $(ABIVER)"
cd $(ABI_TMPCLONEDIR) && \
git checkout $(ABIREF) && git submodule update --init && \
sh bootstrap && CFLAGS="-g -Og" ./configure --disable-doc && \
$(MAKE) -j$$(nproc) -C unistring && $(MAKE) -j$$(nproc) -C gl && $(MAKE) -j$$(nproc) -C lib
touch $@
# Checks the ABI stability between current git version and the previous tagged release.
abi-check: prev-tag-abi.stamp
@rm -f $(ABI_TMPFILE1) $(ABI_TMPFILE2)
@echo "Checking libidn2 ABI"
@echo "<version>$(VERSION)</version>" >$(ABI_TMPFILE)
@echo "<headers>$(srcdir)/lib/idn2.h" >>$(ABI_TMPFILE)
@echo "$(builddir)/lib/idn2.h</headers>" >>$(ABI_TMPFILE)
@echo "<libs>$(builddir)/lib/.libs</libs>" >>$(ABI_TMPFILE)
set -e; export PATH="/sbin$(PATH_SEPARATOR)$$PATH"; \
for i in 2.0.2 2.0.3; do \
test ! -f "$(srcdir)/devel/ABI-$$i-$$(uname -m).dump" || \
abi-compliance-checker --v1=2.0.4 -abi -lib libidn2 -old "$(srcdir)/devel/ABI-$$i-$$(uname -m).dump" -new $(ABI_TMPFILE); \
done
@rm -f $(ABI_TMPFILE)
@echo "<version>$(VERSION)</version>" >$(ABI_TMPFILE1)
@echo "<headers>$(srcdir)/lib/idn2.h" >>$(ABI_TMPFILE1)
@echo "$(builddir)/lib/idn2.h</headers>" >>$(ABI_TMPFILE1)
@echo "<libs>$(builddir)/lib/.libs</libs>" >>$(ABI_TMPFILE1)
@echo "<version>$(ABIVER)</version>" >$(ABI_TMPFILE2)
@echo "<headers>$(builddir)/$(ABI_TMPCLONEDIR)/lib/idn2.h" >>$(ABI_TMPFILE2)
@echo "$(builddir)/$(ABI_TMPCLONEDIR)/lib/idn2.h</headers>" >>$(ABI_TMPFILE2)
@echo "<libs>$(builddir)/$(ABI_TMPCLONEDIR)/lib/.libs</libs>" >>$(ABI_TMPFILE2)
PATH="/sbin$(PATH_SEPARATOR)$$PATH" \
abi-compliance-checker -abi -lib libidn2 -old $(ABI_TMPFILE2) -new $(ABI_TMPFILE1)
@rm -f $(ABI_TMPFILE1) $(ABI_TMPFILE2)
# Dumps the current library ABI using abi-dump in the current directory
abi-dump:
$(MAKE) -C gl
$(MAKE) -C lib
@rm -rf $(ABI_TMPDIR)
@mkdir -p $(ABI_TMPDIR)
@mkdir -p devel
@cp lib/idn2.h $(ABI_TMPDIR)
@abi-dumper lib/.libs/libidn2.so -o "./devel/ABI-$(VERSION)-$$(uname -m).dump" -public-headers $(ABI_TMPDIR)
@abi-dumper lib/.libs/libidn2.so -o "./ABI-$(VERSION)-$$(uname -m).dump" -public-headers $(ABI_TMPDIR)
@rm -rf $(ABI_TMPDIR)
dist-hook:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment