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

Build failure for ROS Iron: "Could not find a package configuration file provided by ament_cmake_flake8" #111

Closed
130s opened this issue Jul 12, 2023 · 4 comments · Fixed by #112
Assignees

Comments

@130s
Copy link
Member

130s commented Jul 12, 2023

Reported at ros/rosdistro#37815 (comment) thanks to @Yadunund

14:15:20 CMake Error at CMakeLists.txt:10 (find_package):
14:15:20   By not providing "Findament_cmake_flake8.cmake" in CMAKE_MODULE_PATH this
14:15:20   project has asked CMake to find a package configuration file provided by
14:15:20   "ament_cmake_flake8", but CMake did not find one.
14:15:20 
14:15:20   Could not find a package configuration file provided by
14:15:20   "ament_cmake_flake8" with any of the following names:
14:15:20 
14:15:20     ament_cmake_flake8Config.cmake
14:15:20     ament_cmake_flake8-config.cmake
14:15:20 
14:15:20   Add the installation prefix of "ament_cmake_flake8" to CMAKE_PREFIX_PATH or
14:15:20   set "ament_cmake_flake8_DIR" to a directory containing one of the above
14:15:20   files.  If "ament_cmake_flake8" provides a separate development package or
14:15:20   SDK, be sure it has been installed.
@130s
Copy link
Member Author

130s commented Jul 12, 2023

I'll see if I can find time in a few days but it'll be great if anyone can tackle (I should be able to spend time for review).

@130s 130s self-assigned this Jul 14, 2023
@130s
Copy link
Member Author

130s commented Jul 14, 2023

Ticket is about ROS Iron, but wondered why on other distros this wasn't reported?

In fact I do see the same error took place on Humble https://build.ros2.org/job/Hdev__smach__ubuntu_jammy_amd64/1/console (although this link is the build BEFORE the change in rosdistro was merged ros/rosdistro#37813, I just assume the same issue happens sooner or later on Humble, and rolling).

130s added a commit to 130s/executive_smach that referenced this issue Jul 14, 2023
flake8 is depended but not used, so removing.
@130s
Copy link
Member Author

130s commented Jul 14, 2023

I confirmed the issue by removing the package in question then build (in this example rocker isn't needed at all, it can be a pure docker run but you get the idea).

Reproducible footage
export LINUX_DISTRO=jammy
export ROS_DISTRO=iron
export DOCKERIMG=ros:iron-ros-base
export PATH_LOCAL_WS=/home/noodle/ros/executive_smach

rocker --nvidia --x11 --network host  \
  --volume $PATH_LOCAL_WS/ros/executive_smach:/cws/src/executive_smach \
  --volume /dev:/dev  \
  --  \
  $DOCKERIMG bash

Now in the Docker container

export DIR_CWS=/cws && cd $DIR_CWS
source /opt/ros/iron/setup.bash
apt update && rosdep update && rosdep install --from-paths src --ignore-src -r -y

apt purge ros-iron-ament-cmake-flake8 && apt autoremove

colcon build
Starting >>> smach   
Starting >>> smach_msgs
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'install-scripts' will not be supported in future versions. Please use the underscore name 'install_scripts' instead
  warnings.warn(
--- stderr: smach                                                         
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:157: UserWarning: newlines not allowed and will break in the future
  warnings.warn("newlines not allowed and will break in the future")
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/cws/install/smach/lib/python3.10/site-packages/smach/state_machine.py:77: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  return {k:v for (k, v) in self.__dict__.items() if k is not "_state_transitioning_lock"}
---
Finished <<< smach [0.42s]
--- stderr: smach_msgs
CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "Findament_cmake_flake8.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "ament_cmake_flake8", but CMake did not find one.

  Could not find a package configuration file provided by
  "ament_cmake_flake8" with any of the following names:

    ament_cmake_flake8Config.cmake
    ament_cmake_flake8-config.cmake

  Add the installation prefix of "ament_cmake_flake8" to CMAKE_PREFIX_PATH or
  set "ament_cmake_flake8_DIR" to a directory containing one of the above
  files.  If "ament_cmake_flake8" provides a separate development package or
  SDK, be sure it has been installed.

---
Failed   <<< smach_msgs [0.45s, exited with code 1]

Summary: 1 package finished [0.55s]
  1 package failed: smach_msgs
  2 packages had stderr output: smach smach_msgs
  2 packages not processed

@130s
Copy link
Member Author

130s commented Jul 14, 2023

I confirmed the issue by removing the package in question then build (in this example rocker isn't needed at all, it can be a pure docker run but you get the idea).

Just a follow-up comment to how I verified the issue #111 (comment), it looks like purging ament_cmake_flake8 execerbate ros2' build pipeline unnecessarilly. Even with the suggested fix #112, colcon build still fails shedding the same error.

:
Starting >>> smach_msgs
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'install-scripts' will not be supported in future versions. Please use the underscore name 'install_scripts' instead
  warnings.warn(
--- stderr: smach                                                         
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:157: UserWarning: newlines not allowed and will break in the future
  warnings.warn("newlines not allowed and will break in the future")
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/cws/install/smach/lib/python3.10/site-packages/smach/state_machine.py:77: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  return {k:v for (k, v) in self.__dict__.items() if k is not "_state_transitioning_lock"}
---
Finished <<< smach [0.41s]
--- stderr: smach_msgs                         
CMake Error at /opt/ros/iron/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:335 (find_package):
  By not providing "Findament_cmake_flake8.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "ament_cmake_flake8", but CMake did not find one.

  Could not find a package configuration file provided by
  "ament_cmake_flake8" with any of the following names:

    ament_cmake_flake8Config.cmake
    ament_cmake_flake8-config.cmake

  Add the installation prefix of "ament_cmake_flake8" to CMAKE_PREFIX_PATH or
  set "ament_cmake_flake8_DIR" to a directory containing one of the above
  files.  If "ament_cmake_flake8" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /opt/ros/iron/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/iron/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:316 (ament_execute_extensions)
  CMakeLists.txt:15 (rosidl_generate_interfaces)


---
Failed   <<< smach_msgs [1.04s, exited with code 1]

Summary: 1 package finished [1.14s]
  1 package failed: smach_msgs
  2 packages had stderr output: smach smach_msgs
  2 packages not processed

My guess is that somewhere in rosidl_generate_interfaces pipeline the ament_flake8 pkg is depended?

130s added a commit to 130s/executive_smach that referenced this issue Jul 14, 2023
flake8 is depended but not used, so removing.
@130s 130s closed this as completed in #112 Jul 14, 2023
130s added a commit that referenced this issue Jul 14, 2023
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

Successfully merging a pull request may close this issue.

1 participant