Skip to content

Commit

Permalink
Use abidiff to verify ABI compatibility
Browse files Browse the repository at this point in the history
This should be both more reliable and more correct. 👍
  • Loading branch information
tianon committed May 8, 2024
1 parent 6d49ef0 commit b1e7fc6
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 42 deletions.
18 changes: 12 additions & 6 deletions 10/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions 11/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions 12/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions 13/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions 14/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM buildpack-deps:{{ .debian.version }}

RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# install abigail-tools so we can use abidiff later to verify that we don't break Debian packages
abigail-tools \
; \
rm -rf /var/lib/apt/lists/*

# https://gcc.gnu.org/mirrors.html
ENV GPG_KEYS \
# 1024D/745C015A 1999-11-09 Gerald Pfeifer <[email protected]>
Expand Down Expand Up @@ -133,16 +141,10 @@ RUN set -ex; \
ldconfig -v; \
# the libc created by gcc might be too old for a newer Debian
# check that the Debian libstdc++ doesn't have newer requirements than the gcc one
bash -Eeuo pipefail -xc ' \
deb="$(strings /usr/lib/*/libstdc++.so* | grep "^GLIBC" | sort -u)"; \
gcc="$(strings /usr/local/lib*/libstdc++.so | grep "^GLIBC" | sort -u)"; \
{{ if .debian.version == "bookworm" and (env.version | tonumber) >= 14 then ( -}}
# https://github.com/docker-library/gcc/pull/103#issuecomment-2099134740 (using "comm" to avoid accidental partial matches / hairy "grep" regex)
deb="$(comm -23 <(cat <<<"$deb") <(echo "GLIBC_2.16"))"; \
{{ ) else "" end -}}
diff="$(comm -23 <(cat <<<"$deb") <(cat <<<"$gcc"))"; \
test -z "$diff"; \
'
deb="$(readlink -ve /usr/lib/*/libstdc++.so* | head -1)"; \
gcc="$(readlink -ve /usr/local/lib*/libstdc++.so | head -1)"; \
# using LD_PRELOAD to make sure "abidiff" itself doesn't fail with the exact error we're trying to test for 😂😭
LD_PRELOAD="$deb" abidiff --no-added-syms "$deb" "$gcc"

# ensure that alternatives are pointing to the new compiler and that old one is no longer used
RUN set -ex; \
Expand Down

0 comments on commit b1e7fc6

Please sign in to comment.