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

Add colcon.pkg with gz-cmake4 dependency #142

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

scpeters
Copy link
Member

🦟 Bug fix

Fixes colcon build ordering since #136 was merged

Summary

Since #128, gz-tools2 supports building with either gz-cmake3 or gz-cmake4, and colcon was correctly identifying the dependency relationship due to the cmake find_package calls. A package.xml was added in #136 with a build_depend only on gz-cmake3, which now breaks the build-from-source order for Ionic workspaces that include gz-tools2:

Starting >>> gz-cmake4
Starting >>> gz-tools2
--- output: gz-tools2
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.20348.
-- The C compiler identification is MSVC 19.29.30148.0
-- The CXX compiler identification is MSVC 19.29.30148.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:19 (message):
  Could not find either gz-cmake3 or gz-cmake4


-- Configuring incomplete, errors occurred!

This pull request adds a colcon.pkg file with an explicit dependency on gz-cmake4 to fix the build order

Alternatives considered

  • Use the colcon.pkg to force the build type back to cmake: f18e584. This also fixes the build (Build Status), but it has more side-effects that just adding gz-cmake4 as a dependency.
  • Add <member_of_group>gz-cmake</member_of_group> to the package.xml file in gz-cmake3 and gz-cmake4 and a <group_depend>gz-cmake</group_depend> tag in downstream package.xml files (thanks to @cottsay for the suggestion). This is more elegant but requires more coordination between packages, while this colcon.pkg change can fix CI now.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@scpeters scpeters requested a review from caguero as a code owner April 22, 2024 19:02
@github-actions github-actions bot added 🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic 🏛️ ionic Gazebo Ionic labels Apr 22, 2024
@@ -0,0 +1,8 @@
# Configuration file for colcon (https://colcon.readthedocs.io).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also want to mention why we are adding this file here so we remember the original cause to introduce the file and listing only a subset of the versions that the sotfware can depend on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments added in 805d1fd

# - https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files

{
"dependencies": ["gz-cmake4"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"dependencies": ["gz-cmake4"],
"build-dependencies": ["gz-cmake4"],

Quoting: https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files

dependencies (list of strings) to declare additional dependencies on other packages. For more fine grain control it is also possible to set build-dependencies, run-dependencies, and test-dependencies.

Copy link
Contributor

@cottsay cottsay Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricky.

Is gz-cmake4 required when a package which depends on gz-tools is built? If so, it would also need to be in run-dependencies. At that point it's probably easier to leave it as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this as is for now and merge to fix CI. We can follow up with other approaches after CI is fixed

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this locally and it seems to work great! Thanks @scpeters

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters merged commit 2b228e5 into gz-tools2 Apr 22, 2024
9 checks passed
@scpeters scpeters deleted the scpeters/colcon_pkg_depend_cmake4 branch April 22, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic 🏛️ ionic Gazebo Ionic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants