diff --git a/.github/workflows/build-pyside6-essentials.yml b/.github/workflows/build-pyside6-essentials.yml new file mode 100644 index 00000000000..aff1f9c07e0 --- /dev/null +++ b/.github/workflows/build-pyside6-essentials.yml @@ -0,0 +1,252 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/create_wheels.py?h=6.11.2 +name: Build pyside6-essentials wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pyside6-essentials.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pyside6-essentials.yml' + - 'docs/packages/pyside6-essentials.yaml' + - 'patches/pyside6-essentials/**' + push: + branches: [main] + paths: + - '.github/workflows/build-pyside6-essentials.yml' + - 'docs/packages/pyside6-essentials.yaml' + - 'patches/pyside6-essentials/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + # Rocky 10's riscv64 repos ship no patchelf package (gotcha 95), and pip installing + # the `patchelf` PyPI package builds NixOS/patchelf from source, which runs its own + # `make check` and fails 8/48 tests on riscv64. pyside-setup's build_patchelf() just + # needs the binary on PATH, so fetch NixOS/patchelf's own riscv64 release instead. + PATCHELF_VERSION: '0.17.2' + PATCHELF_SHA256: '4b28f7bc890c42076b2955be2229ac1607aa9a6d4ee40e33d69517ef0c403a56' + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: pyside6-essentials + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + name: Build pyside6-essentials ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 1440 + + env: + PYSIDE_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout pyside-setup ${{ env.PYSIDE_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: pyside/pyside-setup + ref: ${{ env.PYSIDE_VERSION }} + persist-credentials: false + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Apply patches + run: git apply python-wheels/patches/pyside6-essentials/${{ env.PYSIDE_VERSION }}/*.patch + + - name: Pull manylinux_riscv64 image + run: docker pull "${MANYLINUX_RISCV64_IMAGE}" + + # pyside-setup's build_scripts/config.py only exposes four --build-type values + # (all/shiboken6/shiboken6-generator/pyside6); PySide6_Essentials, PySide6_Addons + # and the PySide6 meta-wheel aren't build targets at all, they're carved out of + # one accumulated build/a/package_for_wheels tree by create_wheels.py. So + # shiboken6-generator and shiboken6 are rebuilt here too (even though only + # Essentials is published by this workflow) to populate that tree; a future + # pyside6-addons/pyside6 port can extend this same build (gotcha 382). + - name: Build shiboken6-generator, shiboken6 and pyside6, then carve out wheels + run: | + docker run --rm -v "$(pwd):/work" -w /work \ + -e PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ \ + -e PATCHELF_VERSION="${PATCHELF_VERSION}" \ + -e PATCHELF_SHA256="${PATCHELF_SHA256}" \ + "${MANYLINUX_RISCV64_IMAGE}" bash -c ' + set -euxo pipefail + dnf -y install clang-devel llvm-devel "qt6-qt*-devel" \ + libxcb-devel libX11-devel libxkbcommon-devel fontconfig-devel gtk3-devel + curl -fsSL -o /tmp/patchelf.tar.gz \ + "https://github.com/NixOS/patchelf/releases/download/${PATCHELF_VERSION}/patchelf-${PATCHELF_VERSION}-riscv64.tar.gz" + echo "${PATCHELF_SHA256} /tmp/patchelf.tar.gz" | sha256sum -c - + tar xzf /tmp/patchelf.tar.gz -C /usr/local + rm -f /tmp/patchelf.tar.gz + pybin=/opt/python/cp312-cp312/bin + export PATH="$pybin:$PATH" + "$pybin/pip" install -q \ + "setuptools==78.1.0" "packaging==24.2" "build==1.2.2.post1" \ + "wheel==0.46.3" "distro==1.9.0" "ninja==1.13.2" "pyproject_hooks==1.2.0" + tar xJf /opt/_internal/static-libs-for-embedding-only.tar.xz -C /opt/_internal + "$pybin/python3" setup.py bdist_wheel \ + --build-type=shiboken6-generator \ + --qtpaths=/usr/bin/qtpaths6 \ + --cmake=/usr/bin/cmake \ + --parallel="$(nproc)" \ + --skip-docs \ + --limited-api=yes + "$pybin/pip" install -q --no-deps dist/shiboken6_generator-*.whl + "$pybin/python3" setup.py bdist_wheel \ + --build-type=shiboken6 \ + --qtpaths=/usr/bin/qtpaths6 \ + --cmake=/usr/bin/cmake \ + --parallel="$(nproc)" \ + --skip-docs \ + --limited-api=yes + "$pybin/pip" install -q dist/shiboken6-*.whl + # shiboken6 (ApiExtractor) adds libclang builtin headers (stddef.h, ...) from + # $LLVM_INSTALL_DIR/lib/clang//include, else from `llvm-config --libdir`. + # Rocky 10 llvm-config reports /usr/lib64/llvm21/lib64, but clang-libs puts + # the headers in /usr/lib/clang/21/include, so every Qt module failed with + # "stddef.h file not found". Point it at /usr so it finds /usr/lib/clang/21. + # --standalone bundles+rpath-patches assistant/designer/linguist + # (PYSIDE_UNIX_BUNDLED_TOOLS) unconditionally; none is installed by the + # qt6-qt*-devel packages above, so patchelf failed on a file that was + # never copied. --no-qt-tools skips them -- they are standalone Qt dev + # tools, not part of the `import PySide6` surface this wheel ships. + LLVM_INSTALL_DIR=/usr \ + "$pybin/python3" setup.py bdist_wheel \ + --build-type=pyside6 \ + --standalone \ + --qtpaths=/usr/bin/qtpaths6 \ + --cmake=/usr/bin/cmake \ + --parallel="$(nproc)" \ + --skip-docs \ + --limited-api=yes \ + --no-qt-tools + "$pybin/python3" create_wheels.py --no-examples + "$pybin/pip" install -q auditwheel + # pyside6_essentials QtQml.abi3.so etc. carry an $ORIGIN/../shiboken6/ RPATH + # (valid once installed next to the shiboken6 wheel), but auditwheel repair + # inspects the extracted wheel tree in isolation, where that relative + # path does not resolve -- it only finds NEEDED libraries via LD_LIBRARY_PATH + # or the system lib dirs, not by searching site-packages. Without it, + # repair failed with: ValueError: Cannot repair wheel, because required + # library "libshiboken6.abi3.so.6.11" could not be located. Point it at the + # shiboken6 wheel already pip-installed above, where that .so actually lives. + export LD_LIBRARY_PATH="$("$pybin/python3" -c "import os, shiboken6; print(os.path.dirname(shiboken6.__file__))"):${LD_LIBRARY_PATH:-}" + # Real riscv64 CI: once LD_LIBRARY_PATH let auditwheel locate + # libshiboken6, it went ahead and vendored a private copy of that .so + # into pyside6_essentials (gotcha 17 dep-wheel case) instead of + # trusting the $ORIGIN/../shiboken6/ RPATH above. That gives the + # process two independent libshiboken6 instances at runtime -- the + # vendored copy QtCore.abi3.so links against, and the one the + # separately pip-installed shiboken6 wheel actually loads -- so their + # C++-side enum and type registries diverge and the smoke test import + # of PySide6.QtCore aborted with Fatal Python error: libshiboken: + # could not init enum. --exclude keeps the shiboken6 .so out of the + # repair so the wheel relies on the real shiboken6 install instead. + "$pybin/python3" -m auditwheel -v repair --plat manylinux_2_39_riscv64 \ + --exclude libshiboken6.abi3.so.6.11 \ + -w audited dist/pyside6_essentials-*.whl + rm -f dist/*.whl + mv audited/*.whl dist/ + # Diagnostic only, not a fix: dump the actual RPATH of the repaired wheel + # so we can see in the real log whether auditwheel kept or dropped the original + # $ORIGIN/../shiboken6/ entry above (it only preserves rpath entries that + # resolve to somewhere inside the wheel being repaired, and shiboken6 lives + # in a separate wheel, so that entry may be silently dropped + "$pybin/python3" -c " + import glob, zipfile, subprocess, os + whl = glob.glob(\"dist/pyside6_essentials-*.whl\")[0] + zf = zipfile.ZipFile(whl) + names = [n for n in zf.namelist() if n.startswith(\"PySide6/\") and n.endswith(\".abi3.so\") and \".libs/\" not in n] + zf.extractall(\"/tmp/rpathcheck\", members=names) + zf.close() + for n in sorted(names): + print(\"RPATH\", n) + subprocess.run([\"patchelf\", \"--print-rpath\", os.path.join(\"/tmp/rpathcheck\", n)]) + " + "$pybin/pip" install -q dist/pyside6_essentials-*.whl + # Diagnostic only, not a fix: the previous run confirmed the crash is a + # bare SIGABRT specifically on `import PySide6.QtQuick` (QtCore/QtGui/ + # QtWidgets/QtNetwork/QtQml all import fine first), with zero stderr + # text (no glibc malloc-corruption message, no Qt warning) and no core + # file - the container on this runner has no CAP_SYS_ADMIN, so `ulimit + # -c unlimited` and writing /proc/sys/kernel/core_pattern both silently + # no-op (confirmed in the log of that run: "Operation not permitted" / + # "Read-only file system"). Run the import live under gdb instead of + # relying on a post-mortem core file, so the backtrace is captured at + # the moment of the abort regardless of core-dump permissions. + dnf -y install gdb || true + cat > /tmp/qtquick_smoke.py <&1 | tee /tmp/gdb_smoke.log + set -e + # gdb exit code reflects gdb, not the inferior - check for the + # final print from the script instead, same signal the plain + # smoke test used before this diagnostic wrapper. + if ! grep -q "PySide6 Essentials import OK" /tmp/gdb_smoke.log; then + echo "smoke test did not complete - see gdb backtrace above" + exit 1 + fi + ' + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pyside6-essentials-${{ env.PYSIDE_VERSION }}-cp310-abi3-manylinux_riscv64 + path: dist/pyside6_essentials-*.whl + if-no-files-found: error + + publish: + name: Publish pyside6-essentials ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + matrix: ${{ needs.setup.outputs.matrix }} + artifact-pattern: pyside6-essentials-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/pyside6-essentials.yaml b/docs/packages/pyside6-essentials.yaml new file mode 100644 index 00000000000..9758b4756f8 --- /dev/null +++ b/docs/packages/pyside6-essentials.yaml @@ -0,0 +1,7 @@ +package-name: pyside6-essentials +source-code: https://code.qt.io/cgit/pyside/pyside-setup.git/ +license: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +versions: +- version: 6.11.2 + files: + - python: 3.10-abi3:manylinux diff --git a/patches/pyside6-essentials/6.11.2/0001-libpyside-guard-QMetaPropertyBuilder-setVirtual-set.patch b/patches/pyside6-essentials/6.11.2/0001-libpyside-guard-QMetaPropertyBuilder-setVirtual-set.patch new file mode 100644 index 00000000000..c0367a54780 --- /dev/null +++ b/patches/pyside6-essentials/6.11.2/0001-libpyside-guard-QMetaPropertyBuilder-setVirtual-set.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sun, 25 Oct 2026 00:00:00 +0000 +Subject: [PATCH] libpyside: guard QMetaPropertyBuilder::setVirtual/setOverride + for Qt < 6.11 + +Upstream-Status: Inappropriate [our image ships Qt 6.10.1, not the 6.11.x pyside-setup 6.11.2 expects] + +MetaObjectBuilderPrivate::addProperty() calls +QMetaPropertyBuilder::setVirtual()/setOverride(), which Qt added in +6.11 (alongside the PropertyFlag::Virtual/Override property flags). +As documented in this package's PR description, the manylinux_riscv64 +image only has Rocky 10's Qt6 AppStream packages, which are Qt 6.10.1, +so these two calls fail to compile: + + dynamicqmetaobject.cpp:352:17: error: 'class QMetaPropertyBuilder' has + no member named 'setVirtual'; did you mean 'setFinal'? + dynamicqmetaobject.cpp:353:17: error: 'class QMetaPropertyBuilder' has + no member named 'setOverride' + +Guard both calls with a QT_VERSION check so the module still builds +against 6.10.1; QProperty's VIRTUAL/OVERRIDE qualifiers (QML-only, +cf. QTBUG-115656) simply won't be propagated onto the QMetaObject +under the downleveled Qt, same as every other 6.11-only surface this +build already exposes as 6.10 per the PR description. + +diff --git a/sources/pyside6/libpyside/dynamicqmetaobject.cpp b/sources/pyside6/libpyside/dynamicqmetaobject.cpp +index 0000000..0000000 100644 +--- a/sources/pyside6/libpyside/dynamicqmetaobject.cpp ++++ b/sources/pyside6/libpyside/dynamicqmetaobject.cpp +@@ -349,8 +349,10 @@ int MetaObjectBuilderPrivate::addProperty(const QByteArray &propertyName, + newProperty.setUser(flags.testFlag(PySide::Property::PropertyFlag::User)); + newProperty.setConstant(flags.testFlag(PySide::Property::PropertyFlag::Constant)); + newProperty.setFinal(flags.testFlag(PySide::Property::PropertyFlag::Final)); ++#if QT_VERSION >= QT_VERSION_CHECK(6, 11, 0) + newProperty.setVirtual(flags.testFlag(PySide::Property::PropertyFlag::Virtual)); + newProperty.setOverride(flags.testFlag(PySide::Property::PropertyFlag::Override)); ++#endif + + index = newProperty.index() + m_baseObject->propertyCount(); + m_dirty = true; +-- +2.43.0 diff --git a/patches/pyside6-essentials/6.11.2/0002-PySide6-drop-Qt-6.11-only-wrappers-for-Qt-6.10.patch b/patches/pyside6-essentials/6.11.2/0002-PySide6-drop-Qt-6.11-only-wrappers-for-Qt-6.10.patch new file mode 100644 index 00000000000..2cbd44e8781 --- /dev/null +++ b/patches/pyside6-essentials/6.11.2/0002-PySide6-drop-Qt-6.11-only-wrappers-for-Qt-6.10.patch @@ -0,0 +1,114 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sun, 8 Nov 2026 00:00:00 +0000 +Subject: [PATCH] PySide6: drop Qt 6.11-only wrappers when building against + Qt < 6.11 + +Upstream-Status: Inappropriate [our image ships Qt 6.10.1, not the 6.11.x pyside-setup 6.11.2 expects] + +The typesystems mark QBasicReadWriteLock, QQuaternion::Axes, +QCustomSeries, QWebView/QWebViewLoadingInfo/QWebViewSettings and +QStyleOptionMenuItemV2 as since="6.11", so shiboken skips them against +Rocky 10's Qt 6.10.1. The module CMakeLists still list their +*_wrapper.cpp unconditionally, and CMake's AUTOMOC then aborts on the +first missing one: + + AutoGen error + The source file "BIN:/PySide6/QtCore/PySide6/QtCore/ + qbasicreadwritelock_wrapper.cpp" does not exist. + +QtWidgets isn't AUTOMOC'd, so there the same gap instead reaches ninja's +Unity build, which fails to compile the #include of the missing file: + + fatal error: .../PySide6/QtWidgets/qstyleoptionmenuitemv2_wrapper.cpp: + No such file or directory + +Remove those sources from the module lists when Qt is older than 6.11. +--- +diff --git a/sources/pyside6/PySide6/QtCore/CMakeLists.txt b/sources/pyside6/PySide6/QtCore/CMakeLists.txt +index 997b0fe..8aa4b66 100644 +--- a/sources/pyside6/PySide6/QtCore/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtCore/CMakeLists.txt +@@ -207,6 +207,12 @@ ${SPECIFIC_OS_FILES} + ${QtCore_GEN_DIR}/qtcore_module_wrapper.cpp + ) + ++# Qt < 6.11 lacks these classes, so shiboken generates no wrapper for them. ++if(Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 6.11) ++ list(REMOVE_ITEM QtCore_SRC ++ ${QtCore_GEN_DIR}/qbasicreadwritelock_wrapper.cpp) ++endif() ++ + get_property(QtCore_disabled_features TARGET Qt${QT_MAJOR_VERSION}::Core + PROPERTY QT_DISABLED_PUBLIC_FEATURES) + +diff --git a/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt b/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt +index 1846f59..1f04b65 100644 +--- a/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt +@@ -62,6 +62,12 @@ ${QtGraphs_GEN_DIR}/qxyseries_wrapper.cpp + ${QtGraphs_GEN_DIR}/qtgraphs_module_wrapper.cpp + ) + ++# Qt < 6.11 lacks these classes, so shiboken generates no wrapper for them. ++if(Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 6.11) ++ list(REMOVE_ITEM QtGraphs_SRC ++ ${QtGraphs_GEN_DIR}/qcustomseries_wrapper.cpp) ++endif() ++ + set(QtGraphs_include_dirs ${QtGraphs_SOURCE_DIR} + ${QtGraphs_BINARY_DIR} + ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} +diff --git a/sources/pyside6/PySide6/QtGui/CMakeLists.txt b/sources/pyside6/PySide6/QtGui/CMakeLists.txt +index 778b1d6..6b1c4a7 100644 +--- a/sources/pyside6/PySide6/QtGui/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtGui/CMakeLists.txt +@@ -291,6 +291,12 @@ ${QtGui_GEN_DIR}/qwindowstatechangeevent_wrapper.cpp + ${QtGui_GEN_DIR}/qtgui_module_wrapper.cpp + ) + ++# Qt < 6.11 lacks these classes, so shiboken generates no wrapper for them. ++if(Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 6.11) ++ list(REMOVE_ITEM QtGui_SRC ++ ${QtGui_GEN_DIR}/qquaternion_axes_wrapper.cpp) ++endif() ++ + get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui + PROPERTY QT_ENABLED_PUBLIC_FEATURES) + +diff --git a/sources/pyside6/PySide6/QtWebView/CMakeLists.txt b/sources/pyside6/PySide6/QtWebView/CMakeLists.txt +index 4251bac..129af2d 100644 +--- a/sources/pyside6/PySide6/QtWebView/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtWebView/CMakeLists.txt +@@ -12,6 +12,14 @@ ${QtWebView_GEN_DIR}/qwebviewsettings_wrapper.cpp + ${QtWebView_GEN_DIR}/qtwebview_module_wrapper.cpp + ) + ++# Qt < 6.11 lacks these classes, so shiboken generates no wrapper for them. ++if(Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 6.11) ++ list(REMOVE_ITEM QtWebView_Src ++ ${QtWebView_GEN_DIR}/qwebview_wrapper.cpp ++ ${QtWebView_GEN_DIR}/qwebviewloadinginfo_wrapper.cpp ++ ${QtWebView_GEN_DIR}/qwebviewsettings_wrapper.cpp) ++endif() ++ + set(QtWebView_include_dirs ${QtWebView_SOURCE_DIR} + ${QtWebView_BINARY_DIR} + ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} +diff --git a/sources/pyside6/PySide6/QtWidgets/CMakeLists.txt b/sources/pyside6/PySide6/QtWidgets/CMakeLists.txt +index e1b1332..34ba4af 100644 +--- a/sources/pyside6/PySide6/QtWidgets/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtWidgets/CMakeLists.txt +@@ -203,6 +203,12 @@ ${SPECIFIC_OS_FILES} + ${QtWidgets_GEN_DIR}/qtwidgets_module_wrapper.cpp + ) + ++# Qt < 6.11 lacks these classes, so shiboken generates no wrapper for them. ++if(Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 6.11) ++ list(REMOVE_ITEM QtWidgets_SRC ++ ${QtWidgets_GEN_DIR}/qstyleoptionmenuitemv2_wrapper.cpp) ++endif() ++ + set(QtWidgets_include_dirs ${QtWidgets_SOURCE_DIR} + ${QtWidgets_BINARY_DIR} + ${pyside6_SOURCE_DIR} diff --git a/patches/pyside6-essentials/6.11.2/0003-build_scripts-skip-the-designer-plugin-copy-when-it.patch b/patches/pyside6-essentials/6.11.2/0003-build_scripts-skip-the-designer-plugin-copy-when-it.patch new file mode 100644 index 00000000000..251f40da3c5 --- /dev/null +++ b/patches/pyside6-essentials/6.11.2/0003-build_scripts-skip-the-designer-plugin-copy-when-it.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Mon, 16 Nov 2026 00:00:00 +0000 +Subject: [PATCH] build_scripts: skip the designer plugin copy when it was + not built + +Upstream-Status: To upstream [no Gerrit account to submit to Qt's code review] + +prepare_standalone_package_linux() unconditionally copies +{install_dir}/plugins/designer into the wheel's Qt/plugins/designer, +with no existence guard (unlike every other optional copydir() call in +this same function, which pass force=False). On this build the PySide +Designer custom-widget plugin component isn't produced -- Rocky 10's +qt6-qt*-devel packages carry Designer's headers/libs but not its +runtime application pieces, same gap --no-qt-tools already works +around for the bundled assistant/designer/linguist executables -- so +plugins/designer never exists under install/, and the build failed +with: + + setup.py/prepare_packages: [Errno 2] No such file or directory: + '.../install/plugins/designer' + +Pass force=False, same as the adjacent qt_translations_dir and +shiboken6 docs/html copies in this file, so a missing optional +component is skipped (logged) instead of aborting the build. The +Designer plugin is only consumed by the standalone Designer *app* to +load custom PySide widgets, not by `import PySide6.QtDesigner` itself. + +diff --git a/build_scripts/platforms/linux.py b/build_scripts/platforms/linux.py +index 32ad9da..464a8ca 100644 +--- a/build_scripts/platforms/linux.py ++++ b/build_scripts/platforms/linux.py +@@ -101,6 +101,7 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False, is + plugins_target / "designer", + _filter=["*.so"], + recursive=False, ++ force=False, + _vars=_vars) + + copied_plugins = pyside_build.get_shared_libraries_in_path_recursively( +-- +2.43.0 diff --git a/skills/python-project-porting/references/gotchas-index.md b/skills/python-project-porting/references/gotchas-index.md index ca4ae0de287..ee0a927a0a8 100644 --- a/skills/python-project-porting/references/gotchas-index.md +++ b/skills/python-project-porting/references/gotchas-index.md @@ -1318,6 +1318,10 @@ The porting gotchas (566 of them) live in [`references/gotchas/`](gotchas/), spl CI/releases directly, not the consuming package's hardcoded list, and bypass via an existing path/URL override env var instead of patching (the componentize-py / WASI-SDK case). +- **714** — Pointing `auditwheel repair` at a dep-wheel's `.so` via `LD_LIBRARY_PATH` so it can + be located makes it get vendored too, unless `--exclude` says otherwise — two loaded copies + of a native runtime with its own internal registries corrupts them both (the + pyside6-essentials/shiboken6 case). ### Compiled-vs-pure detection & the require-extension knob — [`gotchas/compiled-vs-pure-detection.md`](gotchas/compiled-vs-pure-detection.md) diff --git a/skills/python-project-porting/references/gotchas/native-deps-and-linking.md b/skills/python-project-porting/references/gotchas/native-deps-and-linking.md index 4269e76a843..61d62588304 100644 --- a/skills/python-project-porting/references/gotchas/native-deps-and-linking.md +++ b/skills/python-project-porting/references/gotchas/native-deps-and-linking.md @@ -64,6 +64,10 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/native-deps-and-linkin - **691** — Splitting a non-relocatable native-deps build into its own job breaks CMake `find_package()` for the later build job unless both jobs agree on the same literal absolute install path (the meshioplusplus / netCDF case). +- **714** — Pointing `auditwheel repair` at a dep-wheel's `.so` via `LD_LIBRARY_PATH` so it + can be *located* makes it get *vendored* too, unless `--exclude` says otherwise — two + loaded copies of a native runtime with its own internal registries corrupts them both + (the pyside6-essentials/shiboken6 case). - **702** — A build-time cross-toolchain downloader's own host-arch match list can simply be stale against the toolchain project's *own* current release matrix — check the toolchain's own CI/releases directly and bypass via an existing path/URL override, no patch needed (the @@ -1030,3 +1034,40 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/native-deps-and-linkin *binary*'s own downloader lacking a riscv64 entry) — there the fix was exploiting an existing PATH-search fallback because the target binary's upstream truly ships no riscv64 asset; here the fix is a path override because the SDK's upstream already does. + +714. **Pointing `auditwheel repair` at a dep-wheel's `.so` via `LD_LIBRARY_PATH` so it can be + *located* makes it get *vendored* too, unless `--exclude` says otherwise (the + pyside6-essentials/shiboken6 case).** pyside6_essentials's extension modules carry an + `$ORIGIN/../shiboken6/` RPATH, valid once pip-installed next to the separately-published + `shiboken6` wheel. But `auditwheel repair` inspects the extracted wheel tree in + isolation, where that relative RPATH does not resolve, so it cannot find + `libshiboken6.abi3.so.6.11` and fails outright (gotcha 17's "could not be located" case). + Exporting `LD_LIBRARY_PATH` to point at the already pip-installed `shiboken6` wheel's own + copy of that `.so` fixes the "could not be located" failure — but with no `--exclude`, + auditwheel then does what it always does with a NEEDED library it *can* locate and that + isn't on the manylinux policy allowlist: it vendors a private copy into the wheel being + repaired and rewrites that wheel's own `.so`s to link against the copy instead. + - **The result is two independently-loaded copies of the same native runtime in one + process**, not one shared instance: the `shiboken6` wheel's copy (the one Python's + `import shiboken6.Shiboken` actually loads) and the vendored copy baked into + `pyside6_essentials` (the one its own `QtCore.abi3.so` etc. now link against). Every + piece of process-global C++ state libshiboken keeps — the enum-type registry, the + "have I initialized yet" flag `init_enum()` guards with — exists twice and the two + copies never see each other's writes. + - **The crash lands far from the cause.** `from PySide6 import QtCore` aborted with + `Fatal Python error: libshiboken: could not init enum` plus a `RecursionError: + maximum recursion depth exceeded` reported alongside it — not a riscv64 ABI fault and + not a Python-version mismatch (Alpine ships this exact shiboken6/PySide6 minor version + on riscv64 via ordinary distro packaging). `could not init enum` is + `sbkenum.cpp`'s `init_enum()` hitting `Py_FatalError` because its own + `PyImport_ImportModule("shiboken6.Shiboken")` sanity re-check failed, which only + happens here because the *other* loaded copy of libshiboken has already wedged the + interpreter into a bad enough state (hence the pending `RecursionError`) for that + import to fail. Chase the two-copies evidence instead of the printed message: check + the repaired wheel's `*.libs/` (or equivalent auditwheel-vendored dir) for a second, + renamed `libshiboken6*.so` before treating this as an upstream Qt/shiboken bug. + - **Fix: `--exclude libshiboken6.abi3.so.6.11` on the `auditwheel repair` call**, same as + gotcha 17's general dep-wheel rule — once excluded, the wheel keeps relying on the real + `shiboken6` install via its RPATH instead of a private, independently-stateful copy. + Keep the `LD_LIBRARY_PATH` export too: auditwheel still needs to resolve the path to + check it, `--exclude` only stops it from being grafted in.