Skip to content

Use get_package_share_path just as python (backport #112) - #117

Merged
ahcorde merged 2 commits into
kiltedfrom
mergify/bp/kilted/pr-112
May 15, 2026
Merged

ahcorde merged 2 commits into
kiltedfrom
mergify/bp/kilted/pr-112

Conversation

@mergify

@mergify mergify Bot commented Apr 26, 2026

Copy link
Copy Markdown

cpp and python were going out of sync.

Besides

  auto dbc = ament_index_cpp::get_package_share_path("can_dbc_pkg") / "test" / "motohawk.dbc";

Looks much better than

  std::filesystem::path package_path;
  ament_index_cpp::get_package_share_directory("can_dbc_pkg", package_path);
  auto dbc = package_path / "test" / "motohawk.dbc";

Due to the short-livedness of the get_package_share_directory(..., std::filesystem::path) syntax, I didn't deprecated it.

I can finish this PR including the tests etc if that's appreciated. For now I wanted feedback first. 🙂


This is an automatic backport of pull request #112 done by Mergify.

Signed-off-by: Tim Clephas <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
(cherry picked from commit acfcac6)

# Conflicts:
#	ament_index_cpp/include/ament_index_cpp/get_package_share_directory.hpp
#	ament_index_cpp/src/get_package_share_directory.cpp
#	ament_index_cpp/test/utest.cpp
@mergify mergify Bot added the conflicts label Apr 26, 2026
@mergify

mergify Bot commented Apr 26, 2026

Copy link
Copy Markdown
Author

Cherry-pick of acfcac6 has failed:

On branch mergify/bp/kilted/pr-112
Your branch is up to date with 'origin/kilted'.

You are currently cherry-picking commit acfcac6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   ament_index_cpp/CMakeLists.txt
	new file:   ament_index_cpp/include/ament_index_cpp/get_package_share_path.hpp
	new file:   ament_index_cpp/src/get_package_share_path.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ament_index_cpp/include/ament_index_cpp/get_package_share_directory.hpp
	both modified:   ament_index_cpp/src/get_package_share_directory.cpp
	both modified:   ament_index_cpp/test/utest.cpp

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Comment on lines +32 to +35
<<<<<<< HEAD
=======
[[deprecated("Use get_package_share_path(...) instead")]]
>>>>>>> acfcac6 (Use get_package_share_path just as python (#112))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we shouldn't include this deprecation (or the other one below) in this backport

@ahcorde

ahcorde commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Pulls: #117
Gist: https://gist.githubusercontent.com/ahcorde/4c7dacd653b89cc1e107b54224385597/raw/1bf81f806d100807aaad4aa77bd735c20cd18469/ros2.repos
BUILD args: --packages-above-and-dependencies ament_index_cpp
TEST args: --packages-above ament_index_cpp
ROS Distro: kilted
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19257

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
ahcorde merged commit f33f9a2 into kilted May 15, 2026
3 checks passed
@ahcorde
ahcorde deleted the mergify/bp/kilted/pr-112 branch May 15, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants