]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
ci: print versions of depending packages on psycopg-binary build
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 31 Mar 2022 19:34:27 +0000 (21:34 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 31 Mar 2022 21:10:54 +0000 (23:10 +0200)
Only on manylinux and musllinux images for the moment.

See #262

tools/build/print_so_versions.sh [new file with mode: 0755]
tools/build/strip_wheel.sh
tools/build/wheel_linux_before_all.sh

diff --git a/tools/build/print_so_versions.sh b/tools/build/print_so_versions.sh
new file mode 100755 (executable)
index 0000000..316cb7d
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Take a .so file as input and print the Debian packages and versions of the
+# libraries it links.
+
+set -euo pipefail
+# set -x
+
+source /etc/os-release
+
+sofile="$1"
+
+case "$ID" in
+    alpine)
+        depfiles=$( (ldd "$sofile" 2>/dev/null || true) | grep '=>' | sed 's/.*=> \(.*\) (.*)/\1/')
+        (for depfile in $depfiles; do
+             echo "$(basename "$depfile") => $(apk info --who-owns "${depfile}" | awk '{print $(NF)}')"
+        done) | sort | uniq
+        ;;
+
+    debian)
+        depfiles=$(ldd "$sofile" | grep '=>' | sed 's/.*=> \(.*\) (.*)/\1/')
+        (for depfile in $depfiles; do
+            pkgname=$(dpkg -S "${depfile}" | sed 's/\(\): .*/\1/')
+            dpkg -l "${pkgname}" | grep '^ii' | awk '{print $2 " => " $3}'
+        done) | sort | uniq
+        ;;
+
+    *)
+        echo "$0: unexpected Linux distribution: '$ID'" >&2
+        exit 1
+        ;;
+esac
index 3710ef1ca4f288ceb537b1e252474f2418dd3d62..bfcd302565797b294b5549d25ae3f923d88e03e2 100755 (executable)
 # This script is designed to run on a wheel archive before auditwheel.
 
 set -euo pipefail
-set -x
+# set -x
+
+source /etc/os-release
+dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 wheel=$(realpath "$1")
 shift
@@ -24,9 +27,20 @@ trap "rm -r ${tmpdir}" EXIT
 cd "${tmpdir}"
 python -m zipfile -e "${wheel}" .
 
+echo "
+Libs before:"
 # Busybox doesn't have "find -ls"
 find . -name \*.so | xargs ls -l
+
+# On Debian, print the package versions libraries come from
+echo "
+Dependencies versions of '_psycopg.so' library:"
+"${dir}/print_so_versions.sh" "$(find . -name \*_psycopg\*.so)"
+
 find . -name \*.so -exec strip "$@" {} \;
+
+echo "
+Libs after:"
 find . -name \*.so | xargs ls -l
 
 python -m zipfile -c ${wheel} *
index fe29e41220993025eec6bab131d9dbcf6cf688d5..0395712ac61851d3aa44f669046521a1c724b6d0 100755 (executable)
@@ -6,7 +6,7 @@
 set -euo pipefail
 set -x
 
-. /etc/os-release
+source /etc/os-release
 
 # Install PostgreSQL development files.
 case "$ID" in
@@ -28,13 +28,14 @@ case "$ID" in
             curl -skf https://www.postgresql.org/media/keys/ACCC4CF8.asc \
                 > /etc/apt/trusted.gpg.d/postgresql.asc
         fi
+
         apt-get update
         apt-get -y upgrade
         apt-get -y install libpq-dev
         ;;
 
     *)
-        echo "Unexpected Linux distribution: '$ID'" >&2
+        echo "$0: unexpected Linux distribution: '$ID'" >&2
         exit 1
         ;;
 esac