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

Calling colcon fails on Windows #552

Open
Deric-W opened this issue May 5, 2023 · 5 comments
Open

Calling colcon fails on Windows #552

Deric-W opened this issue May 5, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Deric-W
Copy link

Deric-W commented May 5, 2023

Description

Colcon build fails on Humble/Windows because catkin_pkg can not be found.

Expected Behavior

After setting up Humble and sourcing the setup script calling colcon build should not fail.

Actual Behavior

Since the Python version for Windows is hard coded the setup and colcon use different Python versions which leads to colcon complaining about missing packages.

System

  • OS: Windows 2019
  • ROS 2 Distro: Humble

Additional context

Workflow
Logs
Similar Issue

@Deric-W Deric-W added the bug Something isn't working label May 5, 2023
Deric-W added a commit to Deric-W/ros2cs that referenced this issue May 12, 2023
Deric-W added a commit to Deric-W/ros2cs that referenced this issue May 12, 2023
Since Windows setup is more complicated than Ubuntu
the workflow relies on `ros-tooling/setup-ros` and
`ros-tooling/action-ros-ci` while skipping the build script
because of ros-tooling/setup-ros#552.
@Deric-W
Copy link
Author

Deric-W commented May 12, 2023

I tried using ros-tooling/action-ros-ci to handle the building and testing since its is often used with this action but the error remains:

Workflow
Logs

@christophebedard
Copy link
Member

Looking at the workflow logs, it looks like the ament_cmake_export_assemblies package (from https://github.com/ros2-dotnet/ament_cmake_export_assemblies) depends on catkin_pkg. Usually, rosdep would install all packages' dependencies, but it doesn't support Windows, so you need to install it (or build it) yourself.

@Deric-W
Copy link
Author

Deric-W commented May 17, 2023

The log says that catkin_pkg is being installed by pip since colcon-ros depends on it.
I think the problem is that colcon selects Python version 3.11, which is not the version used during setup and therefore does not contain the installed packages.
Do you know a way of forcing colcon to use a particular Python version, using -DPYTHON_EXECUTABLE=... as extra CMake arg did not work.

@christophebedard
Copy link
Member

I'm not sure. Perhaps there's a workflow-/job-level environment variable you can set to select the Python version? See https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow

Windows support here (setup-ros and action-ros-ci) isn't great. Any PRs to improve it would be appreciated.

@Deric-W
Copy link
Author

Deric-W commented Jun 9, 2023

I found the cause with help from answers.ros.org and fixed the problem by instructing CMake to not try to find a higher Python version than the one specified with Python3_ROOT_DIR=... with the -DPython3_FIND_STRATEGY=LOCATION CMake arg.
Furthermore I had to create a junction C:\Python38 since it seemed hardcoded in some packages.
I dont know if I can make a PR since I made the changes using a custom build script and dont have any experience with Github Actions and Typescript development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants