Run parallel build_ext only if there are at least two potential source
files to compile. This call is expensive and parallel builds do not
benefit us if there is only one file to compile.
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5528ff74cccf..d213cca4bb72 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1189,14 +1189,18 @@ distutils-r1_python_compile() {
fi
if [[ ${DISTUTILS_USE_PEP517} && ${GPEP517_TESTING} ]]; then
- # issue build_ext only if it looks like we have something
- # to build; setuptools is expensive to start
+ # issue build_ext only if it looks like we have at least
+ # two source files to build; setuptools is expensive
+ # to start and parallel builds can only benefit us if we're
+ # compiling at least two files
+ #
# see extension.py for list of suffixes
# .pyx is added for Cython
- if [[ -n $(
+ if [[ 2 -eq $(
find '(' -name '*.c' -o -name '*.cc' -o -name '*.cpp' \
-o -name '*.cxx' -o -name '*.c++' -o -name '*.m' \
- -o -name '*.mm' -o -name '*.p