Details
Description
Problem:
While adding support for cross compiling options I noticed the current
setup of the build process could be improved.
Since the wheel-split changes we currently generate three packages:
- Shiboken generator
- Shiboken (python module)
- PySide (python module)
Which makes sense, but sadly we cannot build Shiboken separately
in a proper way, i.e.: building shiboken generator also builds the python
module, and some Linux distributions that are maintaining the separate
packages are manually removing the files that are not interesting.
For example, Arch Linux's packages.
from which you can see the following while building shiboken:
build() { cd build cmake ../${_pkgfqn}/sources/shiboken2 \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_TESTS=OFF \ -DUSE_PYTHON_VERSION=3 make } package_shiboken2() { depends=(clang=$_clangver llvm libxslt qt5-xmlpatterns) cd build make DESTDIR="$pkgdir" install # Provided in python-shiboken2 rm -r "$pkgdir"/usr/lib/{python*,libshiboken*} } package_python-shiboken2() { depends=(python) cd build make DESTDIR="$pkgdir" install # Provided in shiboken2 rm -r "$pkgdir"/usr/{bin,include,lib/{cmake,pkgconfig},share} }
When they build shiboken 2 (the generator), they need to remove all the
shared libraries that are generated too:
rm -r "$pkgdir"/usr/lib/{python*,libshiboken*}
and then when building the python module, they need to remove the
shiboken generator files:
rm -r "$pkgdir"/usr/{bin,include,lib/{cmake,pkgconfig},share}
This is crucial for cross compiling purposes because one needs to build
the generator on the Host, and then build the python module for the
Target but using the Host generator and a specified sysroot.
Solution:
At the moment the CMake configuration to build shiboken needs some
love, but a split is not straightforward because many sub-directories
are being built:
- ApiExtractor
- libshiboken
- doc
- generator
- shibokenmodule
- tests
- data
I believe completely separating the building process of Shiboken generator
and Shiboken module (python) is crucial to achieve any kind of cross compiling
setup.
1. Building Shiboken generator should contain:
- ApiExtractor,
- doc (only from ApiExtractor)
- generator
- tests (without the shibokenmodule)
2. Building Shiboken module (python) should contain
- libshiboken
- shibokenmodule
- doc (only from shibokenmodule)
- tests (only the shibokenmodule one)
Notice that for step 2. we would need a mechanism to specify the
path to the generator to be used.
The data directory contains CMake Config files that will need to be
split too to properly found the generator and the module as separate
things.
We could even write a third one that include boths to not alter the
current build process.
Attachments
Issue Links
- is required for
-
PYSIDE-802 Enable PySide/Shiboken cross compilation for different targets.
- Closed
-
QTBUG-85279 Qt for macOS on Apple Silicon (arm64)
- Closed
For Gerrit Dashboard: PYSIDE-1033 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
270545,5 | CMake modularization: macros creation | 5.13 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
369068,2 | cmake: Fix option --sanitize-address | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
369102,2 | cmake: Fix option --sanitize-address | 6.1 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
369110,2 | cmake: Fix option --sanitize-address, take two | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
369144,3 | cmake: Fix option --sanitize-address | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
369191,2 | cmake: Fix option --sanitize-address, take two | 6.1 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
369205,3 | cmake: Fix option --sanitize-address, take two | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
373445,101 | CMake: shiboken: Add support for cross-building | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
373733,81 | CMake: Create new Shiboken6Tools CMake package | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
373735,103 | CMake: pyside: Add support for cross-building | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
374068,144 | setup.py: Add support for cross-building | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
381116,100 | WIP: coin: Cross-compile PySide to Raspberry Pi Archlinux armv7 in CI | dev | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |
382731,11 | setup.py: Don't add the Qt prefix dir to PATH env var before building | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
383450,2 | setup.py: Don't add the Qt prefix dir to PATH env var before building | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
395301,2 | Build system: Add build_info_collector to project file | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |