lopsided98 / nix-ros-overlay

ROS overlay for the Nix package manager
Apache License 2.0
174 stars 68 forks source link

ros2 python-qt-binding sip4 patch to fix apps like rqt #414

Closed Pleune closed 4 weeks ago

Pleune commented 1 month ago

Without this patch, on WSL, and I believe all non-darwin systems, rqt will be unable to load the image_viewer plugin. See #404 and https://github.com/lopsided98/nix-ros-overlay/issues/404#issuecomment-2092797850

This could be selectively applied to rqt, similar to the ros1 overlay rviz patch. But I think it would be best to patch for all dependencies. This should not break anything, as it does not affect whether or not pyside or pyqt is chosen as the backend. It will simply allow the pyqt backend to function.

An alternative approach could be taken (and also works) where python-qt-bindings is patched to always choose pyside, but I actually see better framerate with the image_viewer plugin with pyqt (at least on WSL2).

I have tested this with rqt in ros2/humble.

Pleune commented 4 weeks ago

This breaks the compilation on rolling and Jazzy, because the sip4 patch is applied internally in the python-qt-binding package at configure time. See https://github.com/ros-visualization/python_qt_binding/blob/1fbfb441b86dfc9df252fb7e4a7c0d736a5d1cbe/cmake/sip_configure.py#L143.

The added propagatedbuilddependency on sip_4 causes dependent packages to call the cmake helper file which un turns will try to run sup_configure.py and prevent a successful build.

[ 42%] Built target ament_cmake_python_build_qt_gui_cpp_egg
[ 45%] Linking CXX shared library libqt_gui_cpp.so
[ 45%] Built target qt_gui_cpp
[ 48%] Running Shiboken generator for libqt_gui_cpp Python bindings...
[ 51%] Running SIP generator for qt_gui_cpp_sip Python bindings...
Traceback (most recent call last):
  File "/nix/store/yf6426f0j4p0l2q3lfq5swazng68ax5p-ros-rolling-python-qt-binding-2.3.0-r1/share/python_qt_binding/cmake/sip_configure.py", line 143, in <module>
    with open(os.path.join(tmpdirname, 'QtCore', 'QtCoremod.sip'), 'w') as outfp:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/build/tmp47o8fy9y/QtCore/QtCoremod.sip'
make[2]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:103: sip/qt_gui_cpp_sip/Makefile] Error 1
make[1]: *** [CMakeFiles/Makefile2:279: src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....