Colcon build fails following docs without clear error or traceback

590 Views Asked by At

I'm taking my first baby-steps with ROS2 and following the beginner tutorials in the docs to familiarise myself with the workflows.

On the section about paramaters it shows you how to use launch-files. https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Using-Parameters-In-A-Class-Python.html

I followed the first section of this tutorial. All is well.

The second section tells you to create a launch-file and adding data_files to setup.py. This is where colcon --build fails with a rather obscure error:

Summary: 2 packages finished [4.96s]
  1 package failed: python_parameters
  1 package aborted: my_package
  1 package had stderr output: python_parameters
  2 packages not processed
Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec("with suppress(ImportError):    from setuptools.extern.packaging.specifiers    import SpecifierSet");exec("with suppress(ImportError):    from packaging.specifiers import SpecifierSet");from distutils.core import run_setup;dist = run_setup(    \'setup.py\', script_args=(\'--dry-run\',), stop_after=\'config\');skip_keys = (\'cmdclass\', \'distclass\', \'ext_modules\', \'metadata\');data = {    key: value for key, value in dist.__dict__.items()     if (        not key.startswith(\'_\') and         not callable(value) and         key not in skip_keys and         key not in dist.display_option_names    )};data[\'metadata\'] = {    k: v for k, v in dist.metadata.__dict__.items()     if k not in (\'license_files\', \'provides_extras\')};sys.stdout.buffer.write(repr(data).encode(\'utf-8\'))']' returned non-zero exit status 1.

If I remove the data_files from setup.py; colcon --build runs fine.

This is what I have inside of the setup args:

    data_files=[
        (os.path.join('share', package_name), glob('launch/*launch.[pxy][yma]*')),
    ]

This makes me suggest the problem is with data_files. But I'm at a loss here. As soon as data_file is present, containing a value or not, the build fails. Can someone help me debug this?

thank you!

1

There are 1 best solutions below

0
On

So yes, really silly...

data_files was present twice in the setup.py folder.
Same the tb wasn't more informative.