From ef503a8df55352e8a68a2673c0264490392947ba Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 13 Jul 2026 21:55:51 +0200 Subject: [PATCH 1/3] debian: ignore pycompile errors --- debian/cloudstack-common.postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/cloudstack-common.postinst b/debian/cloudstack-common.postinst index aa99edaee064..a84339895bd3 100644 --- a/debian/cloudstack-common.postinst +++ b/debian/cloudstack-common.postinst @@ -22,11 +22,11 @@ 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 + pycompile -p cloudstack-common || true fi if which pycompile >/dev/null 2>&1; then - pycompile -p cloudstack-common /usr/share/cloudstack-common + pycompile -p cloudstack-common /usr/share/cloudstack-common || true fi cp $CLOUDUTILS_DIR/cloud_utils.py $DIST_DIR From b8c4c2e86ee9360e28d6db558af0a839e7e210fb Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 14 Jul 2026 09:24:46 +0200 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- debian/cloudstack-common.postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/cloudstack-common.postinst b/debian/cloudstack-common.postinst index a84339895bd3..8e618915ff6a 100644 --- a/debian/cloudstack-common.postinst +++ b/debian/cloudstack-common.postinst @@ -22,7 +22,7 @@ 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 || true + pycompile -p cloudstack-common || echo "Warning: pycompile failed for cloudstack-common" >&2 fi if which pycompile >/dev/null 2>&1; then From b9502aec079e052bdcebb8dbbaf556f362a48eb3 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 14 Jul 2026 09:56:04 +0200 Subject: [PATCH 3/3] more changes --- debian/cloudstack-common.postinst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/cloudstack-common.postinst b/debian/cloudstack-common.postinst index 8e618915ff6a..b11e6a3fe502 100644 --- a/debian/cloudstack-common.postinst +++ b/debian/cloudstack-common.postinst @@ -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 || echo "Warning: pycompile failed for cloudstack-common" >&2 -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 || true +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