2
$\begingroup$

I started to learn ros2, installed ros2 humble, have followed the tutorial of the channel Robotics Back-End before and I was able to successfully create a node.

After some time I wanted to visit the tutorial again and started working on it, but I have been facing "listing git files failed - pretending there aren't any" error on colcon build. I had my_robot_controller node before and I wanted to add a fresh new node called my_robot_controller_2.

This is the output of colcon build --event-handlers console_direct+ command on the workspace

Starting >>> my_robot_controller
Starting >>> my_robot_controller_2
running develop
running develop
running egg_info
writing ../../build/my_robot_controller/my_robot_controller.egg-info/PKG-INFO
writing dependency_links to ../../build/my_robot_controller/my_robot_controller.egg-info/dependency_links.txt
writing entry points to ../../build/my_robot_controller/my_robot_controller.egg-info/entry_points.txt
writing requirements to ../../build/my_robot_controller/my_robot_controller.egg-info/requires.txt
writing top-level names to ../../build/my_robot_controller/my_robot_controller.egg-info/top_level.txt
running egg_info
writing ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/PKG-INFO
writing dependency_links to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/dependency_links.txt
writing entry points to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/entry_points.txt
writing requirements to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/requires.txt
writing top-level names to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/top_level.txt
listing git files failed - pretending there aren't any
listing git files failed - pretending there aren't any
reading manifest file '../../build/my_robot_controller/my_robot_controller.egg-info/SOURCES.txt'
writing manifest file '../../build/my_robot_controller/my_robot_controller.egg-info/SOURCES.txt'
running build
running build_py
running install
running install_lib
running install_data
running install_egg_info
removing '/home/u28i31/ros2_ws/install/my_robot_controller/lib/python3.10/site-packages/my_robot_controller-0.0.0-py3.10.egg-info' (and everything under it)
Copying ../../build/my_robot_controller/my_robot_controller.egg-info to /home/u28i31/ros2_ws/install/my_robot_controller/lib/python3.10/site-packages/my_robot_controller-0.0.0-py3.10.egg-info
running install_scripts
reading manifest file '../../build/my_robot_controller_2/my_robot_controller_2.egg-info/SOURCES.txt'
writing manifest file '../../build/my_robot_controller_2/my_robot_controller_2.egg-info/SOURCES.txt'
running build
running build_py
running install
running install_lib
running install_data
running install_egg_info
removing '/home/u28i31/ros2_ws/install/my_robot_controller_2/lib/python3.10/site-packages/my_robot_controller_2-0.0.0-py3.10.egg-info' (and everything under it)
Copying ../../build/my_robot_controller_2/my_robot_controller_2.egg-info to /home/u28i31/ros2_ws/install/my_robot_controller_2/lib/python3.10/site-packages/my_robot_controller_2-0.0.0-py3.10.egg-info
running install_scripts
Installing draw_circle script to /home/u28i31/ros2_ws/install/my_robot_controller/lib/my_robot_controller
Installing test_node script to /home/u28i31/ros2_ws/install/my_robot_controller/lib/my_robot_controller
writing list of installed files to '/home/u28i31/ros2_ws/build/my_robot_controller/install.log'
writing list of installed files to '/home/u28i31/ros2_ws/build/my_robot_controller_2/install.log'
--- stderr: my_robot_controller
listing git files failed - pretending there aren't any
---
Finished <<< my_robot_controller [1.81s]
--- stderr: my_robot_controller_2
listing git files failed - pretending there aren't any
---
Finished <<< my_robot_controller_2 [1.81s]

Summary: 2 packages finished [1.97s]
  2 packages had stderr output: my_robot_controller my_robot_controller_2

This is the result of pip3 list | grep colcon

colcon-argcomplete                   0.3.3
colcon-bash                          0.4.2
colcon-cd                            0.1.1
colcon-cmake                         0.2.27
colcon-common-extensions             0.3.0
colcon-core                          0.12.1
colcon-defaults                      0.2.8
colcon-devtools                      0.2.3
colcon-installed-package-information 0.1.0
colcon-library-path                  0.2.1
colcon-metadata                      0.2.5
colcon-mixin                         0.2.3
colcon-notification                  0.2.15
colcon-output                        0.2.13
colcon-override-check                0.0.1
colcon-package-information           0.3.3
colcon-package-selection             0.2.10
colcon-parallel-executor             0.2.4
colcon-pkg-config                    0.1.0
colcon-powershell                    0.3.7
colcon-python-setup-py               0.2.8
colcon-recursive-crawl               0.2.1
colcon-ros                           0.3.23
colcon-test-result                   0.3.8
colcon-zsh                           0.4.0

A previous solution suggests to change the dashes in setup.cfg files to underscores but they are already with underscores.

[develop]
script_dir=$base/lib/my_package
[install]
install_scripts=$base/lib/my_package

If it helps, these lines are in my ~/.bashrc

source <(ng completion script)
source /opt/ros/humble/setup.bash
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
source ~/ros2_ws/install/setup.bash

Is there anything that I am missing?

$\endgroup$

1 Answer 1

3
$\begingroup$

I encountered the same issue while following the ROS 2 service client tutorial. Initially, I attempted the workaround suggested in this ROSanswers post, but it didn't resolve my problem.

The root cause of the issue was the presence of the setuptools_scm package. Colcon was using setuptools_scm instead of the traditional setuptools. To determine if you have setuptools_scm installed, you can use the following command:

pip3 list | grep setuptools

In my case, I completely removed the package because it wasn't useful for me.

pip3 uninstall setuptools-scm

In addition, make sure that you are using setuptools 58.2.0. In case you can install this specific version.

pip3 install setuptools==58.2.0

This worked for me. Let me know if encounter any issues.

$\endgroup$
4
  • 1
    $\begingroup$ It worked! Thank you very much :) $\endgroup$ Commented Oct 12, 2023 at 7:27
  • $\begingroup$ With setuptools-scm 8.0.4, it still prints "ERROR" but colcon finished building Humble packages successfully. $\endgroup$ Commented May 5 at 23:18
  • $\begingroup$ @Daniele Affinita what was the reason to install setuptools 58.2.0? $\endgroup$ Commented May 5 at 23:19
  • $\begingroup$ @YasushiShoji It's the last version of setuptools working with ros2 humble without warnings (source: answers.ros.org/question/396439/…) $\endgroup$ Commented May 15 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.