Skip to content

Conversation

scpeters
Copy link
Member

🎉 New feature

Part of gazebo-tooling/release-tools#1244, companion to gazebosim/gz-sim#2726.

Summary

The major version is removed from the cmake project name for gz-sim in gazebosim/gz-sim#2726, so update the find_package and target_link_libraries calls accordingly.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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.

* Update cmake project name, package.xml name
* Change gz-launch executable target name to avoid
  conflict with library target name. Set the
  OUTPUT_NAME property to retain same executable
  file name.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Companion to gazebosim/gz-sim#2726.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
CMakeLists.txt Outdated
gz_find_package(gz-sim9 REQUIRED PRIVATE COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim9_VERSION_MAJOR})
gz_find_package(gz-sim REQUIRED PRIVATE COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim_VERSION_MAJOR})
Copy link
Member Author

Choose a reason for hiding this comment

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

we could alternatively delete the GZ_SIM_VER variable since I believe it is not used after these changes

Copy link
Member Author

Choose a reason for hiding this comment

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

removed in 28765fe

@scpeters
Copy link
Member Author

@scpeters
Copy link
Member Author

testing with gazebo-tooling/gazebodistro@7e1c523

this is failing because the base branch is still using gz-gui9; merging with main should resolve it

@scpeters
Copy link
Member Author

this is failing because the base branch is still using gz-gui9; merging with main should resolve it

merged and resolved conflicts, trying again

Build Status https://build.osrfoundation.org/job/ci__colcon_any-manual_ubuntu_noble_amd64/20/

Base automatically changed from scpeters/package_name_without_major_version to main March 25, 2025 19:00
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member Author

@scpeters
Copy link
Member Author

scpeters commented Mar 26, 2025

this job has finished the build successfully and is running tests

Build Status https://build.osrfoundation.org/job/ci__colcon_any-manual_ubuntu_noble_amd64/23/

@scpeters
Copy link
Member Author

this job has finished the build successfully and is running tests

Build Status https://build.osrfoundation.org/job/ci__colcon_any-manual_ubuntu_noble_amd64/23/

just finished!

@scpeters scpeters marked this pull request as ready for review March 26, 2025 13:57
@scpeters scpeters requested a review from nkoenig as a code owner March 26, 2025 13:57
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
# Find gz-sim
gz_find_package(gz-sim10 REQUIRED PRIVATE COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR})
gz_find_package(gz-sim REQUIRED PRIVATE COMPONENTS gui)
Copy link
Contributor

Choose a reason for hiding this comment

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

My personal opinion here is that a configuration instructions should encode the known versions that work and specially the versions that are known not to work.

If we know that this is going to fail with gz-sim less than 10, let's encode it.

Suggested change
gz_find_package(gz-sim REQUIRED PRIVATE COMPONENTS gui)
gz_find_package(gz-sim REQUIRED VERSION 10 PRIVATE COMPONENTS gui)

Copy link
Member Author

@scpeters scpeters Mar 27, 2025

Choose a reason for hiding this comment

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

I had suggested in the shorter proposal gazebo-tooling/release-tools#1244 (comment) that we not use explicit version numbers when calling find_package on the main branch, but that we add it in when creating stable release branches

  • Finding Gazebo packages with cmake's find_package function:
    • On main branches: the major version number should not be used when finding a package with cmake’s find_package() function. For example: find_package(gz-utils4 REQUIRED COMPONENTS log) should instead be find_package(gz-utils REQUIRED COMPONENTS log). This helps reduce maintenance churn on the main branches.
    • When branching from main to create stable release branches: add explicit major versions into the find_package calls like find_package(gz-utils 4 REQUIRED COMPONENTS log). This generates configuration errors when incompatible versions are built together, which is helpful.

I think this will reduce churn on the main branches, while still providing helpful error messages for stable release branches

Copy link
Contributor

Choose a reason for hiding this comment

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

ah sorry, did not get that in mind. Sound fine.

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Mar 28, 2025
@scpeters scpeters merged commit 6f887fb into main Mar 30, 2025
9 of 10 checks passed
@scpeters scpeters deleted the scpeters/package_name_without_major_version_sim branch March 30, 2025 00:12
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants