summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-07-15 11:21:17 +0200
committerMichał Górny <mgorny@gentoo.org>2022-07-15 11:36:18 +0200
commit0f653bace964789f1dd47f38088670b7dc2e8bf1 (patch)
tree5eb37a68f99ada4326d791cda2cdf09d29c729d6 /dev-lang
parentdev-lang/python: Install epython.py into stdlib (diff)
downloadgentoo-0f653bace964789f1dd47f38088670b7dc2e8bf1.tar.gz
gentoo-0f653bace964789f1dd47f38088670b7dc2e8bf1.tar.bz2
gentoo-0f653bace964789f1dd47f38088670b7dc2e8bf1.zip
dev-lang/python: Report ABI breakage in postinst
Python 3.11.0b4 has changed module ABI, so warn the users about the necessity of module recompiling. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/python-3.11.0_beta4-r2.ebuild16
1 files changed, 16 insertions, 0 deletions
diff --git a/dev-lang/python/python-3.11.0_beta4-r2.ebuild b/dev-lang/python/python-3.11.0_beta4-r2.ebuild
index 4681473655c9..aab4bbbdc169 100644
--- a/dev-lang/python/python-3.11.0_beta4-r2.ebuild
+++ b/dev-lang/python/python-3.11.0_beta4-r2.ebuild
@@ -457,3 +457,19 @@ src_install() {
"${scriptdir}/idle" || die
fi
}
+
+pkg_postinst() {
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ver_test "${v}" -lt 3.11.0_beta4-r2; then
+ ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files"
+ ewarn "installed previously are no longer valid and will be regenerated"
+ ewarn "(or ignored) on the next import. This may cause sandbox failures"
+ ewarn "when installing some packages and checksum mismatches when removing"
+ ewarn "old versions. To actively prevent this, rebuild all packages"
+ ewarn "installing Python 3.11 modules, e.g. using:"
+ ewarn
+ ewarn " emerge -1v /usr/lib/python3.11/site-packages"
+ fi
+ done
+}