Repository navigation
humble, jazzy: ament_cmake_gtest/gmock use conda-forge's gtest - #118
Draft
Tobias-Fischer wants to merge 2 commits into
Draft
Tobias-Fischer wants to merge 2 commits into
Tobias-Fischer wants to merge 2 commits into
Conversation
humble's and jazzy's ament_cmake_gtest compile gtest_vendor's sources
(1.10 / 1.14) in every package's test build, against the headers of
conda-forge's gtest (1.18), which ament_cmake_gtest also depends on: any
ament_add_gtest test fails to build ("no declaration matches
testing::TestInfo::TestInfo(...)", RoboStack/ros-kilted#59). lyrical and
rolling are fine: upstream ament_cmake 2.8+ dropped the vendored sources.
Backport that change (as RoboStack/ros-kilted#100 does for kilted):
_ament_cmake_gtest_find_gtest / _ament_cmake_gmock_find_gmock just
find_package(GTest) and use its targets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ck test [skip ci] Turns the local checks of this PR into a recipe test, so later rebuilds keep them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For humble and jazzy, the gtest version clash reported for kilted in RoboStack/ros-kilted#59.
Their
ament_cmake_gtestbuildsgtest_vendor's sources (1.10 for humble, 1.14 for jazzy) into every package that usesament_add_gtest/ament_add_gmock. It does that against the headers of conda-forge'sgtest(now 1.18), whichament_cmake_gtestalso depends on. So any such test fails to build, e.g.gtest-internal-inl.h: error: unknown …/no declaration matches testing::TestInfo::TestInfo(...). lyrical and rolling aren't affected: upstream ament_cmake 2.8+ dropped the vendored sources and usesfind_package(GTest).This backports that upstream change, like RoboStack/ros-kilted#100 does for kilted:
ament_cmake_gtest:_ament_cmake_gtest_find_gtestjustfind_package(GTest REQUIRED)+ament_find_gtest()on theGTest::targets; the source-search block is removed.ament_cmake_gmock: the same for gmock.kilted's patches, adapted: the gtest one for humble's and jazzy's (identical) extras file, the gmock one as is for jazzy and without the
ament_add_gmock_executable.cmakehunk for humble (which doesn't have that file).gtest_vendorstays a dependency (vinca takes dependencies from the rosdistro), but nothing uses its sources any more.Recipe test (
shared/tests/ros2-ament-cmake-gmock.yaml): a minimal package with anament_add_gtestand anament_add_gmocktest is built and both run. Checked both ways on humble osx-arm64: it passes with these patches, and fails to compile against the published humble packages (gtest_vendor'sgtest-internal-inl.h: unknown typeInt32).Built and tested locally
ament_cmake_gtestandament_cmake_gmockrebuilt with the patches. A minimal ament package with anament_add_gtestand anament_add_gmocktest, in a fresh environment: before, the build fails compilingsrc/gtest_vendor; after, it finds conda-forge's GTest and both tests build and pass.ament_cmake_gtestandament_cmake_gmockbuilt with the patches, and the rest of that build (about 480 packages) on top of them. The minimalament_add_gtest/ament_add_gmockpackage test was only run on humble.Prepared on top of the current rosdistro syncs (#62 humble, #61 jazzy). CI is held with
[skip ci]; merge after them. CI needsament_cmake_gtest/ament_cmake_gmockevicted from the humble and jazzy build caches, if present.🤖 Generated with Claude Code