Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS Humble needs to be rebuilt for Python 3.11 #227

Closed
pryre opened this issue May 10, 2023 · 8 comments
Closed

ROS Humble needs to be rebuilt for Python 3.11 #227

pryre opened this issue May 10, 2023 · 8 comments
Labels

Comments

@pryre
Copy link

pryre commented May 10, 2023

The current version seems to be built against Python3.10, Arch core has updated to Python3.11. Runtime error suggests that rclpy cannot find Python3.10 libraries anymore (which I believe is correct as they do not exist).

Failed to load entry point 'list': No module named 'rclpy._rclpy_pybind11'
The C extension '/opt/ros/humble/lib/python3.10/site-packages/_rclpy_pybind11.cpython-311-x86_64-linux-gnu.so' isn't present on the system. Please refer to 'https://docs.ros.org/en/humble/Guides/Installation-Troubleshooting.html#import-failing-without-library-present-on-the-system' for possible solutions
Traceback (most recent call last):
  File "/opt/ros/humble/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.5', 'console_scripts', 'ros2')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 50, in main
    add_subparsers_on_demand(
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/command/__init__.py", line 250, in add_subparsers_on_demand
    extension.add_arguments(
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/command/topic.py", line 29, in add_arguments
    add_subparsers_on_demand(
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/command/__init__.py", line 237, in add_subparsers_on_demand
    extension = command_extensions[name]
                ~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'list'

@pryre pryre changed the title ROS Humble needs to be rebuilt ROS Humble needs to be rebuilt for Python 3.11 May 10, 2023
@pryre
Copy link
Author

pryre commented May 13, 2023

Managed to rebuild the package myself, no major set-backs. Looks like there's an upstream update from pybind11_vendor that was required to be pulled (either that or I just missed it when I cloned the repo.

Had a few other instances of missing #include <cstdint> and #include <stdexception> in a few C++ packages, but that might be something on my end.

@petronny
Copy link
Member

petronny commented Jun 1, 2023

Hi, would you like to share your modified PKGBUILD so we can build it for everyone?

@pryre
Copy link
Author

pryre commented Jun 1, 2023

Good idea. I'll put the required changes into a patch and make sure everything is up to date with rolling. Give me a day or two and I'll make a pull request.

@petronny
Copy link
Member

petronny commented Jun 2, 2023

Thanks in advanced! It's also OK to just upload the PKGBUILD to here or somewhere if you are not familiar with cactus.yaml.

@pryre
Copy link
Author

pryre commented Jun 3, 2023

Had a good dig into this today. My attempt can be found on my branch. See PKGBUILDs and patches attached, prefixed with their parent packages. I have not had any experience with cactus, so thanks for that! -- Apologies that they are .txt, GitHub would not have accepted the raw files.

ros2-humble_PKGBUILD.txt
ros-humble_python_11_support.patch.txt
ros-arch-deps_PKGBUILD.txt

The major change was actually working around the SIP4 issues. The current state of SIP from PyQt/riverbankcomputing is a bit of a mess, and a lot of the ROS packages are stuck on SIP4 on ubuntu (even for their rolling branch?). It seems that the PyQt group are trying to push people along, but there's been a slow uptake. What concerns me is that there is comments floating around from that team basically saying that support for SIP4 is dead and people need to move on.

The only way I could get this to build effectively with my knowledge of SIP was to drop it entirely and switch to the pyside2 bindings. If anyone knows their way around PyQt better, then this can probably be avoided. I personally don't see the downside, but I would guess that there is licensing issues, etc. Apologies if this is not sufficient, and good luck to anyone that needs to fix that mess properly.

For anyone going down that path, I think the specific changes needed are to update the upstream of python_qt_binding, specifically this file. The python_qt_binding/cmake/sip_configure.py file needs to go from using the sipconfig build tools from SIP4 to the sipbuild build tools from SIP6 (current extra/sip package from the official repos). I had a brief crack at this, but it's well above my knowledge and I could not find any guides to perform a migration from SIP4->SIP6 in this manner. Ideally, I would imagine, the python_qt_binding upstream would be updated to give compatibility to build both SIP4 and SIP6 variants depending on availability. I may make an issue request over there shortly to start that talk.

@pryre
Copy link
Author

pryre commented Jun 3, 2023

From further investigation of the python_qt_bindings package, they are looking to depreciate this eventually package anyway, so it may be a non-issue in the future, or for the next major ROS2 release:
ros-visualization/python_qt_binding#117.

Also noted that the longer term fix has had a pull request waiting for a few years now (ros-visualization/python_qt_binding#94). I imagine that the ros-visualization group is a bit under-powered as of late. Guess we'll see how this pans out.

@AchmadFathoni
Copy link
Contributor

I managed to build humble in clean chroot using m2-farzan/ros2-humble-PKGBUILD#11.

@petronny
Copy link
Member

5088c72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants