Hello Richard,

On 4/10/20 10:45 PM, Richard Shaw wrote:
Qt on Fedora Rawhide has been updated to 5.14.2. I'm working on updating PySide2 to 5.14.2.

That's nice, thank you.

I see from this commit[1] that now uic and rcc can produce python output that the programs in PySide2 are no longer needed, however, I'm unclear on the implementation.

That's right, from Qt 5.14, both uic and rcc can now generate Python
code by running `uic/rcc -g python`.

That's why we decided to drop the old implementations of pysideuic
and pyrcc respectively, since they were lacking of many features
that the current uic and rcc had, and we were getting more and more
reports on both tools.

At the moment, we are trying to do the same with pylupdate,
that maybe we would be able to incorporate in Qt's lupdate.

Form the description it appears PySide should be installing some sort of wrapper but instead seems to be grabbing the uic and rcc tools installed by qt4-qtbase-devel (renamed to append -qt5 on Fedora) and reinstalling them, resulting in the following error while building PySide2 for Fedora:

     Installed (but unpackaged) file(s) found:
    /usr/bin/rcc-qt5
    /usr/bin/uic-qt5

The offending code seems to be:

set(TOOLS_PATH "${_qt5Core_install_prefix}/bin")
set(UIC_PATH "${TOOLS_PATH}/uic-qt5${EXE_EXT}")
set(RCC_PATH "${TOOLS_PATH}/rcc-qt5${EXE_EXT}")
if (APPLE)
     set(DESIGNER_PATH "${TOOLS_PATH}/Designer.app")
else()
     set(DESIGNER_PATH "${TOOLS_PATH}/designer${EXE_EXT}")
endif()

install(FILES "${UIC_PATH}"
         DESTINATION bin
         PERMISSIONS
         OWNER_EXECUTE OWNER_WRITE OWNER_READ
         GROUP_EXECUTE GROUP_READ
         WORLD_EXECUTE WORLD_READ)

install(FILES "${RCC_PATH}"
         DESTINATION bin
         PERMISSIONS
         OWNER_EXECUTE OWNER_WRITE OWNER_READ
         GROUP_EXECUTE GROUP_READ
         WORLD_EXECUTE WORLD_READ)
---
in sources/pyside2-tools/CMakeLists.txt

Why would you find the system installed version of a binary and then turn around and try to install them again?

Since many people was relying on running "pyside2-uic" or "pyside2-rcc"
we decided to wrap around the uic and rcc to keep the compatibility,
so in a nutshell, calling `pyside2-uic` is nothing else than running
`uic -g python`.

To build the project you rely on a Qt installation,
which is no news, but the important bit here is that when building
the wheels, one needs to package the tools to distribute, since
a person running `pip install pyside2` will not necessarily have
a local Qt installation


Then, the process do the following:
- Gets the tools path from ${_qt5Core_install_prefix}/bin
- Copy them to the install directory: install(FILES "${...

And then, the entry points for `pyside2-uic/rcc` can be execute
from the `pyside_tool.py` script that lies in the installation
directory.

When I wrote the commit you mentioned, I was only considering the
wheel process, since it's our main installation method,
and the workaround that other distributions [1] have
is just to remove the binaries we copy to the install directory.


I think it makes sense to implement an option on the installation
process, something like --install-tools=no, to avoid copying the
binaries over. I believe a patch like that should not be too
complicated to add, so maybe a contributor reading this can submit
it and then I can review it without any problem.
Maybe you can help us with such process?

Thanks for your efforts on the Fedora package,
hopefully we can figure out this soon :)

Cheers


[1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/pyside2-tools#n34




Thanks,
Richard

[1] https://codereview.qt-project.org/c/pyside/pyside-tools/+/274708

_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside


--
Dr. Cristian Maureira-Fredes
R&D Manager

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside

Reply via email to