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

Cant build with ros2 humble on devel & release #151

Closed
geoeo opened this issue Feb 5, 2024 · 8 comments
Closed

Cant build with ros2 humble on devel & release #151

geoeo opened this issue Feb 5, 2024 · 8 comments

Comments

@geoeo
Copy link

geoeo commented Feb 5, 2024

When I try colcon build

I get

Error processing idl file: /home/haubenstockm/git/ros2/flir_camera_driver/build/flir_camera_msgs/rosidl_adapter/flir_camera_msgs/msg/ImageMetaData.idl
Traceback (most recent call last):
  File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 40, in <module>
    sys.exit(main())
  File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 36, in main
    generate_py(args.generator_arguments_file, args.typesupport_impls.split(';'))
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/generate_py_impl.py", line 61, in generate_py
    generated_files = generate_files(generator_arguments_file, mapping)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 96, in generate_files
    raise(e)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 91, in generate_files
    post_process_callback=post_process_callback)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 131, in expand_template
    em.BUFFERED_OPT: True,
AttributeError: module 'em' has no attribute 'BUFFERED_OPT'
gmake[2]: *** [flir_camera_msgs__py/CMakeFiles/flir_camera_msgs__py.dir/build.make:126: rosidl_generator_py/flir_camera_msgs/_flir_camera_msgs_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:590: flir_camera_msgs__py/CMakeFiles/flir_camera_msgs__py.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< flir_camera_msgs [0.39s, exited with code 2]
@geoeo geoeo changed the title Cant build with ros2 humble on devel Cant build with ros2 humble on devel & release Feb 5, 2024
@geoeo
Copy link
Author

geoeo commented Feb 5, 2024

This can be fixed by
https://stackoverflow.com/questions/77642155/attributeerror-module-object-has-no-attribute-raw-opt/77656642#77656642

Now I have the error

--- stderr: flir_camera_msgs                             
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(_sre.o): warning: relocation against `PyExc_RecursionError' in read-only section `.text'
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(bytearrayobject.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/flir_camera_msgs__rosidl_generator_py.dir/build.make:125: rosidl_generator_py/flir_camera_msgs/libflir_camera_msgs__rosidl_generator_py.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:475: CMakeFiles/flir_camera_msgs__rosidl_generator_py.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< flir_camera_msgs [2.38s, exited with code 2]

Maybe its related to multiple python versions being installed? python3 and python select 3.10 but it seems this is defaulting to 3.6

Building the vanilla ros2 humble examples works fine.

@berndpfrommer
Copy link
Collaborator

Is there a reason you are not installing the package via apt from the rosdistro?
This repo built fine about 3 weeks ago, and there have been no commits since. So something has changed about the environment.
Also, I see /usr/local/lib in your logs which indicates you have installed some custom python versions under /usr/local/ that could cause the problem. Can you eliminate that as a source of error?

@geoeo
Copy link
Author

geoeo commented Feb 5, 2024

I just noticed my pip version defaults to 3.6

Ill change this to 3.10 and see if this fixes it

@geoeo
Copy link
Author

geoeo commented Feb 6, 2024

@berndpfrommer Both my python and pip now default to 3.10. And its still selecting 3.6. I really dont want to install from apt because I dont want to reinstall spinnaker binaries. Im not sure, but it seems your build chain assumes only 1 python version on the system?

I cant remove python versions from system since I need them

@berndpfrommer
Copy link
Collaborator

berndpfrommer commented Feb 6, 2024 via email

@geoeo
Copy link
Author

geoeo commented Feb 6, 2024

Interesting. Ill try the apt then.
Thanks! @berndpfrommer any idea to whom I can escalate this issue?

@berndpfrommer
Copy link
Collaborator

As far as the spinnaker_camera_driver goes I'm probably the most knowledgeable. This honestly doesn't seem to be a driver-specific issue. You can try posting on the robotics stack exchange but complex environment issues like this often get little attention.

There was definitely some issue with the "em" module, somewhere between colcon and Ubuntu, see here.
If you can find some simple messages package that builds correctly you can try peeling away from flir_camera_msgs until it also builds.

Another option: install flir_camera_msgs from the apt repo, delete the source directory containing flir_camera_msgs from your workspace, and try just building the driver, if you really want to build from source.

@geoeo
Copy link
Author

geoeo commented Feb 6, 2024

Thanks. I also get this issue with other packages. It seems to be ros2. I will close this. Thanks for your help

@geoeo geoeo closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants