external/python3: Explicitly check that all extension modules got built

...to avoid issues like we now experienced on Jenkins box tb76, where e.g.
<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/108402/> failed with
just an unhelpful

> /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/external/python3/ExternalPackage_python3.mk:46: *** file /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/python3/LO_lib/_elementtree.cpython-3.8d.so does not exist in the tarball.  Stop.
> make[1]: *** Waiting for unfinished jobs....
> Makefile:299: recipe for target 'build' failed
> make: *** [build] Error 2

after ExternalProject_python3 had been built successfully, outputting just

> [build PRJ] python3

even though its workdir/UnpackedTarball/python3/build.log states

> *** WARNING: renaming "_elementtree" since importing it failed: pyexpat version is incompatible

and

> Following modules built successfully but were removed because they could not be imported:
> _elementtree

(but which got hidden by gbuild)

Change-Id: I28904ef41cb823e308bb8e15cbe969872702cb55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130355
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2022-02-23 11:12:10 +01:00
parent c7a920a9b7
commit 5931638fda
2 changed files with 14 additions and 4 deletions
+4
View File
@@ -44,6 +44,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
/maxcpucount \
/p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \
$(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
$(foreach i,$(python3_EXTENSION_MODULES), \
&& { test -e ../$i || { printf 'Error: missing %s\n' $i; false; } }) \
,PCBuild)
$(call gb_Trace_EndRange,python3,EXTERNAL)
@@ -123,6 +125,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
$(if $(filter MACOSX,$(OS)),DESTDIR=$(EXTERNAL_WORKDIR)/python-inst install) \
$(if $(SYSTEM_ZLIB),,ZLIB_INCDIR=$(WORKDIR)/UnpackedTarball/zlib) \
&& ln -s build/lib.* LO_lib \
$(foreach i,$(python3_EXTENSION_MODULES), \
&& { test -e $i || { printf 'Error: missing %s\n' $i; false; } }) \
)
$(call gb_Trace_EndRange,python3,EXTERNAL)