From 933e764831c4d3b31d0010c948acf262ca99d9bb 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 fe9a201e57..09b57ab7b9 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* OK/ { /tests* OK/p diff --git a/lib/functions.sh b/lib/functions.sh index db2746449f..53c8bc06e8 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -2840,7 +2840,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() {