From 10240cfd7d4ae857d02f537f449ba269c818228f Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Fri, 22 Dec 2023 16:25:25 +0000 Subject: [PATCH] When compiling python modules, always force rebuild and timestamp mode --- build/python311/build.sh | 6 ++++++ lib/functions.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/python311/build.sh b/build/python311/build.sh index 1115897a76..c92c1d4bee 100755 --- a/build/python311/build.sh +++ b/build/python311/build.sh @@ -123,6 +123,12 @@ post_configure() { restore_variable CC } +post_install() { + python_compile \ + -o0 -o1 -o2 \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' +} + TESTSUITE_SED=" 1,/Tests result:/ { /Tests result:/p diff --git a/lib/functions.sh b/lib/functions.sh index f35dca1632..89716e7700 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -2877,7 +2877,13 @@ python_vendor_relocate() { python_compile() { logmsg "Compiling python modules" - logcmd $PYTHON -m compileall $DESTDIR + logcmd $PYTHON \ + -m compileall \ + -j0 \ + -f \ + --invalidation-mode timestamp \ + "$@" \ + $DESTDIR } python_pep518() {