debian/ubuntu: ignore pycompile errors (#13602)

This commit is contained in:
Wei Zhou 2026-07-14 12:18:24 +02:00 committed by GitHub
parent 13742921d1
commit 332800480d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,14 +19,14 @@
set -e
CLOUDUTILS_DIR="/usr/share/pyshared/"
DIST_DIR=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
if which pycompile >/dev/null 2>&1; then
pycompile -p cloudstack-common
fi
# distutils was removed in Python 3.12 (Ubuntu 24.04); the Debian/Ubuntu-patched
# sysconfig 'deb_system' scheme gives the same /usr/lib/python3/dist-packages path.
DIST_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('platlib', 'deb_system'))")
if which pycompile >/dev/null 2>&1; then
pycompile -p cloudstack-common /usr/share/cloudstack-common
if command -v py3compile >/dev/null 2>&1; then
py3compile -p cloudstack-common 2>/dev/null || echo "Warning: py3compile failed for cloudstack-common" >&2
py3compile -p cloudstack-common /usr/share/cloudstack-common 2>/dev/null || echo "Warning: py3compile failed for cloudstack-common (/usr/share/cloudstack-common)" >&2
fi
cp $CLOUDUTILS_DIR/cloud_utils.py $DIST_DIR