Only on manylinux and musllinux images for the moment.
See #262
--- /dev/null
+#!/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
# 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
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} *
set -euo pipefail
set -x
-. /etc/os-release
+source /etc/os-release
# Install PostgreSQL development files.
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