When PySide and shiboken are tested, they are built as wheels. After the normal unit tests, the script wheel_tester.py performs additional integration tests. These tests show some problems on certain platforms.
Instead of removing the small problems of the script, completely unrelated problems had to be circumvented in absence of the COIN staff.
These errors may be hiding since a while, already. They became a problem, when I tried to build an extension for wheel_tester.py, that should use PyInstaller to ensure that a built demo script works on all platforms. Automatically Test Small Example With PyInstaller
Error on Linux openSUSE_42_3: At the end of the log, you can see certain lines which report a problem with the sphinx package. The intended installer test could therefore not run.
This was circumvented by COIN: Skip doc build for Python 2, but erroneously classified as a sphinx bug.
If you take a closer look, you see:
When inspecting the source code of build.py, you realize that this code cannot belong to Python 2.7, which has some comment instead in line 39. The file=stderr belongs to the Python 3 version of sphinx/build.py line 39.
That means: The Python 2 library contains Python 3 code, which of course is not suitable for Python 2. It is hard to imagine how such an error is possible in an automated environment.
Error on Linux RHEL_7_4: The end of the log shows PyInstaller trying to build a test script. It fails on Python 3 with the following traceback:
The error message seems to make not much sense. For some reason, the correct library cannot be found.
As an intermediate circumvention, the build process was simply skipped on any failure, because we wanted to test running the compiled script, and not the compilation itself.
These errors became visible while developing the above mentioned PyInstaller test. Although PyInstaller has some issues as well, these problems are purely COIN misconfigurations and out of the scope of the original scripting task.
The following steps are necessary to fix them completely:
- make sure that Error on Linux openSUSE_42_3: gets solved
- make sure that Error on Linux RHEL_7_4: gets solved
- revert patch COIN: Skip doc build for Python 2
- change patch Automatically Test Small Example With PyInstaller to react again on build errors
While these two COIN problems were fixed, another issue came up:
macOS with Python 2.7.16 crashes the generated PyInstaller test program.
Python 2.7.16 includes the Tcl/Tk library in the Python distribution in a way that does not work with the usual framework layout that PyInstaller expects on macOS.
More info: https://www.python.org/download/mac/tcltk/
The error message is:
The hard-to-find reason for this error lies in the numpy module that was installed for other tests.
It turns out that Python 3.7 has the same problem when Tcl/Tk is used, and this has been reported since a while in https://github.com/pyinstaller/pyinstaller/pull/3830 .
That problem is not very visible because PyInstaller is not used often with Tcl/Tk. But on Python 2.7.16 the problem is more tricky, because the bug is triggered by the installation of numpy, which is a very frequently used module.
The proposed patch is the same for both Python versions and works fine. Until this is fixed, we excluded Tcl/Tk in the spec file.