commit:     0f653bace964789f1dd47f38088670b7dc2e8bf1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 09:21:17 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 09:36:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f653bac

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 <AT> gentoo.org>

 dev-lang/python/python-3.11.0_beta4-r2.ebuild | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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
+}

Reply via email to