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

[Ubuntu Noble] catkin-lint version 1.6.22 is broken and hangs forever #43395

Open
mikaelarguedas opened this issue Nov 8, 2024 · 5 comments
Open
Assignees

Comments

@mikaelarguedas
Copy link
Member

The version of catkin-lint (1.6.22) provided in Ubuntu Noble fails to find packages and hangs forever.
The more recent versions 1.6.23+ do work. (I suppose this commit is needed)

I'm asking here as in the past catkin_lint was provided in the ROS apt repository.

Would it be possible to do one of the two following ?

Related to #41004

Thanks ! 🙏

@artivis
Copy link
Contributor

artivis commented Nov 8, 2024

Hi @mikaelarguedas, thanks for the ping 👍 .
Tracking this at LP#2087555 as well. Note that the version is also in Oracular.

@artivis
Copy link
Contributor

artivis commented Nov 8, 2024

@mikaelarguedas would you happen to have a minimal reproducible example? I gave this a quick try and it seems to work fine.

@mikaelarguedas
Copy link
Member Author

While trying to provide a simple reproducible example I faced another issue 😅

Simply installing the package as is on a base ubuntu 24.04 image:

FROM ubuntu:noble

RUN apt update && apt install -y git catkin-lint

WORKDIR /test_ws/src
RUN git clone https://github.com/ros/std_msgs

RUN catkin_lint .

results in:

 > [5/5] RUN catkin_lint .:                                                                                                                                                             
0.236 catkin_lint: cannot load rosdep database: No module named 'rosdep2'                                                                                                               
0.236 catkin_lint: unknown dependencies will be ignored
0.246 catkin_lint: cannot import 'all': No module named 'distutils'

And I can't seem to find a rosdep candidate in the ubuntu packages for noble:
https://packages.ubuntu.com/search?keywords=rosdep&searchon=names&suite=all&section=all


I haven't reproduced the freeze in a container yet but have a couple machines with fairly fresh ubuntu installs that do exhibit it, I'll dig a bit more into it in the next couple days

@artivis
Copy link
Contributor

artivis commented Nov 8, 2024

You may have missed the following: Changes to ROS Debian Science Support packages which may explain why rosdep isn't in Noble.

As for the issue with catkin_lint, I can install it in a fresh LXD container and somewhat successfully execute it:

lxc launch ubuntu:24.04 catkin-lint
lxc shell catkin-lint

ubuntu@catkin-lint:~$ apt update && apt install catkin-lint
...
ubuntu@catkin-lint:~$ mkdir workspace && cd workspace
ubuntu@catkin-lint:~$ git clone https://github.com/ros/geometry2 -b noetic-devel
ubuntu@catkin-lint:~$ catkin_lint .
catkin_lint: cannot load rosdep database: No module named 'rosdep2'
catkin_lint: unknown dependencies will be ignored
test_tf2: CMakeLists.txt(19): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(22): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
...

@mikaelarguedas
Copy link
Member Author

mikaelarguedas commented Nov 8, 2024

Thanks for looking into it!

You may have missed the following: Changes to ROS Debian Science Support packages which may explain why rosdep isn't in Noble.

oh yeah I did miss that, good news!
Interesting that catkin-lint made the cut without rosdep.


Reproducing the exact same set of steps on the official ubuntu:noble image:

docker run -it --rm ubuntu:noble
# apt update && apt upgrade -y && apt install -y git catkin-lint
# mkdir workspace && cd workspace/
# git clone https://github.com/ros/geometry2 -b noetic-devel
# catkin_lint .

catkin_lint: cannot load rosdep database: No module named 'rosdep2'
catkin_lint: unknown dependencies will be ignored
catkin_lint: cannot import 'all': No module named 'distutils'

Note sure what is different between the lxc base image and the docker one.
That specific issue seems to be addressed in fkie/catkin_lint@da9f311 (commit part of 1.6.23 but not 1.6.22 of catkin_lint)


Looking into the hanging issue, it may be some conflicting deps on some of our development environment a may not be an issue with the upstream pacage itself 🙏 😕
If that is confirmed I will close this,

Edit:
On a development machine with no packages installed from pip; I can reproduce the freeze with the version from apt but not with the same version installed from pip:

Using the apt package from Ubuntu repos it hangs:
$ catkin_lint .
^CTraceback (most recent call last):
  File "/usr/bin/catkin_lint", line 53, in <module>
    main()
  File "/usr/share/catkin-lint/catkin_lint/main.py", line 328, in main
    sys.exit(run_linter(args))
             ^^^^^^^^^^^^^^^^
  File "/usr/share/catkin-lint/catkin_lint/main.py", line 239, in run_linter
    env.add_path("/usr/share")
  File "/usr/share/catkin-lint/catkin_lint/environment.py", line 163, in add_path
    pkgs = find_packages(path, use_cache=self.use_cache)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/catkin-lint/catkin_lint/environment.py", line 75, in find_packages
    package_paths = find_package_paths(basepath)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/catkin_pkg/packages.py", line 66, in find_package_paths
    os.path.realpath(dirpath) in real_exclude_paths or \
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 435, in realpath
  File "<frozen posixpath>", line 470, in _joinrealpath
KeyboardInterrupt
Using the same version from pip it works
pip3 install catkin-lint==1.6.22 --break-system-packages
$ catkin_lint .
catkin_lint: neither ROS_DISTRO environment variable nor --rosdistro option set
catkin_lint: unknown dependencies will be ignored
test_tf2: CMakeLists.txt(19): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(22): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(25): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(28): error: catkin_add_gtest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(38): error: add_rostest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(43): error: add_rostest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(49): error: add_rostest() used without if(CATKIN_ENABLE_TESTING)
test_tf2: CMakeLists.txt(17): warning: use of link_directories() is strongly discouraged
tf2_bullet: CMakeLists.txt(10): error: catkin_package() exports non-package include path
tf2_eigen: CMakeLists.txt(16): warning: duplicate find_package(cmake_modules)
tf2_eigen: CMakeLists.txt(17): warning: CMake module 'Eigen' is deprecated, use 'Eigen3' instead
tf2_geometry_msgs: CMakeLists.txt(38): error: catkin_package() is called before find_package()
tf2_geometry_msgs: CMakeLists.txt(22): warning: use of link_directories() is strongly discouraged
tf2_geometry_msgs: CMakeLists.txt(35): warning: target_include_directories() exports external PUBLIC path '${orocos_kdl_INCLUDE_DIRS}'
tf2_geometry_msgs: CMakeLists.txt(38): warning: duplicate find_package(geometry_msgs)
tf2_geometry_msgs: CMakeLists.txt(38): warning: duplicate find_package(tf2_ros)
tf2_geometry_msgs: CMakeLists.txt(38): warning: duplicate find_package(tf2)
tf2_geometry_msgs: CMakeLists.txt(41): warning: target_include_directories() exports external PUBLIC path '${orocos_kdl_INCLUDE_DIRS}'
tf2_kdl: CMakeLists.txt(47): error: catkin_package() is called before find_package()
tf2_kdl: CMakeLists.txt(47): error: call to find_package(catkin) shadows previously selected components
tf2_kdl: package.xml: error: missing build_depend on 'tf2_msgs'
tf2_kdl: CMakeLists.txt(13): warning: duplicate find_package(cmake_modules)
tf2_kdl: CMakeLists.txt(14): warning: CMake module 'Eigen' is deprecated, use 'Eigen3' instead
tf2_kdl: CMakeLists.txt(32): warning: use of link_directories() is strongly discouraged
tf2_kdl: CMakeLists.txt(47): warning: duplicate find_package(tf2)
tf2_kdl: CMakeLists.txt(47): warning: duplicate find_package(tf2_ros)
tf2_kdl: CMakeLists.txt(47): warning: duplicate find_package(tf2_msgs)
tf2_kdl: CMakeLists.txt(51): warning: target_include_directories() exports external PUBLIC path '${orocos_kdl_INCLUDE_DIRS}'
tf2_msgs: CMakeLists.txt: error: unconfigured message dependency 'std_msgs'
tf2_msgs: CMakeLists.txt(15): error: package 'std_msgs' must be in CATKIN_DEPENDS in catkin_package()
tf2_msgs: CMakeLists.txt(15): error: package 'message_runtime' must be in CATKIN_DEPENDS in catkin_package()
tf2_msgs: package.xml: error: missing build_depend on 'std_msgs'
tf2_msgs: package.xml: error: missing run_depend on 'std_msgs'
tf2_msgs: warning: file 'srv/FrameGraph.srv' is executable but not installed
tf2_msgs: CMakeLists.txt(15): warning: catkin_package() exports package include path that is not installed
tf2_ros: CMakeLists.txt(103): error: catkin_package() is called before find_package()
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(actionlib)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(actionlib_msgs)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(geometry_msgs)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(message_filters)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(roscpp)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(rosgraph)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(rospy)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(tf2)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(tf2_msgs)
tf2_ros: CMakeLists.txt(103): warning: duplicate find_package(tf2_py)
tf2_sensor_msgs: CMakeLists.txt(45): error: catkin_package() is called before find_package()
tf2_sensor_msgs: CMakeLists.txt(45): error: call to find_package(catkin) shadows previously selected components
tf2_sensor_msgs: CMakeLists.txt(13): warning: duplicate find_package(cmake_modules)
tf2_sensor_msgs: CMakeLists.txt(14): warning: CMake module 'Eigen' is deprecated, use 'Eigen3' instead
tf2_sensor_msgs: CMakeLists.txt(45): warning: duplicate find_package(sensor_msgs)
tf2_sensor_msgs: CMakeLists.txt(45): warning: duplicate find_package(tf2_ros)
tf2_sensor_msgs: CMakeLists.txt(45): warning: duplicate find_package(tf2)
catkin_lint: checked 13 packages and found 53 problems
catkin_lint: option -W2 will show 56 additional notices

@nuclearsandwich nuclearsandwich self-assigned this Dec 2, 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

3 participants