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

Warnings and issues during setup #30

Open
MrBlenny opened this issue Sep 15, 2022 · 2 comments
Open

Warnings and issues during setup #30

MrBlenny opened this issue Sep 15, 2022 · 2 comments

Comments

@MrBlenny
Copy link

MrBlenny commented Sep 15, 2022

When following the setup guide things didn't go too smoothly for me.

Issue 1 - setup.cfg

I was getting the following error:

WARNING:colcon.colcon_poetry_ros.task.poetry.build:Poetry did not install any scripts. Are you missing a [tool.poetry.scripts] section?

I was able to solve this by deleting the setup.cfg. If this is the correct solution it would be good to add a note in the README.md

Issue 2 - not finding install packages

Running a simple colcon build and then python3 -m colcon_poetry_ros.dependencies.install results in:

No packages were found in the following paths: <some_path_to_my_working_dir>

Specifying python3 -m colcon_poetry_ros.dependencies.install --base-path install got me closer to the solution but I was still getting

No packages were found in the following paths: install

Issue 3 - missing pyproject.tomls

pyproject.toml and package.xml missing from root of install dir.

As mentioned in issue 2, I was getting No packages were found in the following paths: install
I was able to resolve this by adding more data-files to the pyproject.toml

[tool.colcon-poetry-ros.data-files]
"share/ament_index/resource_index/packages" = ["resource/my_package_name"]
"share/my_package_name" = ["package.xml", "pyproject.toml"]

Does it also make sense to add the poetry.lock here?

I can get it working using
colcon build
and
python3 -m colcon_poetry_ros.dependencies.install --base-path /install/my_package_name/share/ but --base-path install won't find anything.
It seems globbing helps with this:
python3 -m colcon_poetry_ros.dependencies.install --base-path install/*/share

Issue 4 - merge install

I can make the above work with --merge-install using:
colcon build --merge-install
python3 -m colcon_poetry_ros.dependencies.install --merge-install --base-path install/share

This only works with --merge-install --base-path install/share.
If I add a different --base-path, eg --merge-install --base-path /opt/some_path_where_i_did_my_colcon_install_base, it will still output all the ./install/lib/etc/etc relative to the working dir, not the base-path

I've been rsyncing the files over to the base-path location as a quick hack...

python3 -m colcon_poetry_ros.dependencies.install --base-path /my_base_path/*/share
rsync -av install/ /my_base_path/
rm -rf install

Issue 5 - mode

I could not get --mode bundle to work without --merge-install.

With merge install: python3 -m colcon_poetry_ros.dependencies.install --method bundle --merge-install --base-path install/share it seems to work
Without merge install it would error:

  • Bundling some_package (0.0.0) into /home/ros/some_path/install/some_package: Installing dependencies

[Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ros/some_path/colcon-poetry-ros/colcon_poetry_ros/dependencies/install.py", line 178, in <module>
    main()
  File "/home/ros/some_path/colcon-poetry-ros/colcon_poetry_ros/dependencies/install.py", line 25, in main
    _install_dependencies_via_poetry_bundle(
  File "/home/ros/some_path/colcon-poetry-ros/colcon_poetry_ros/dependencies/install.py", line 82, in _install_dependencies_via_poetry_bundle
    subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['poetry', 'bundle', 'venv', '/home/ros/some_path/install/some_package']' returned non-zero exit status 1.

In summary, I seem to almost have it mostly working... I'm not sure if my setup is weird or if it is just a matter of improving the logs and how the packages are collected. The main issue I see is that python3 -m colcon_poetry_ros.dependencies.install --base-path /my_base_path/*/share does not install the deps into the base_path folder.

@velovix
Copy link
Member

velovix commented Sep 19, 2022

Sorry to hear you had problems getting the tool set up. I appreciate you sticking with it and providing this report!

Issue 1 - setup.cfg

I wouldn't expect the presence of a setup.cfg to affect this behavior at all. Would you be able to share with me the contents of the setup.cfg file before you deleted it? Hopefully I can use that to reproduce the problem on my end.

Issue 2 - not finding install packages

The --base-paths argument is for telling the tool where the source code for your ROS packages are. Many ROS projects put those in src. Supplying install to this flag would cause exactly the issues you describe.

Issue 3 - missing pyproject.tomls

I believe this is again caused by using --base-paths install. The pyproject.toml should be next to your package.xml and source code under your source directory.

Issue 4 - merge install

Unfortunately, merge installs are in a pretty rough state right now. You should have better luck with the revised --base-paths value, but there are still known issues with merge installs. Let me know if you find any more.

Issue 5 - mode

I think again this has to do with the --base-paths value you're using. If you still have the issue though, let me know.

@velovix
Copy link
Member

velovix commented Sep 19, 2022

Regarding issue 3, I want to mention one more thing. You shouldn't have to include the pyproject.toml or the poetry.lock in the tool.colcon-poetry-ros.data-files section. You can if you'd like though, it shouldn't cause any problems.

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