Skip to content

Conversation

hageboeck
Copy link
Member

With llvm's include(Googletest), CppInterOp might download its own
googletest, ignoring the system installation. This created several
problems:

  • An existing system installation might be ignored.
  • When used in ROOT with builtin gtest, a conflicting gtest might be
    downloaded.
  • When ROOT is configured with fail-on-missing while offline, the
    configuration fails, because it is assumed that gtest needs to be
    downloaded. This is not the case, though, if gtest is present in the
    system.

Therefore:

  • Test if the targets GTest::gtest or gtest exist. If found, no further
    actions are required.
  • New: If not found, run find_package(GTest). If found, continue as normal.
  • New: If not found, warn and disable the interop tests.

With the above, the logic in ROOT can be simplified:

  • ROOT switches On/Off CPPINTEROP_ENABLE_TESTING based on whether testing is on or off.
  • The internet connection check could be removed.

With llvm's include(Googletest), CppInterOp might download its own
googletest, ignoring the system installation. This created several
problems:
- An existing system installation might be ignored.
- When used in ROOT with builtin gtest, a conflicting gtest might be
  downloaded.
- When ROOT is configured with fail-on-missing while offline, the
  configuration fails, because it is assumed that gtest needs to be
  downloaded. This is not the case, though, if gtest is present in the
  system.

Therefore:
- Test if the targets GTest::gtest or gtest exist. If found, no further
  actions are required.
- New: If not found, run find_package(GTest). If found, continue as normal.
- New: If not found, warn and disable the interop tests.
It was assumed that CppInterOp needs internet connection to download
gtest. This should not be the case, any more, since it can use the
system googletest or ROOT builtin targets.

Therefore:
- Remove the internet connnectivity check. It fails builds on Gentoo,
  because packages are always built without connection.
- Change CPPINTEROP_ENABLE_TESTING from CACHE FORCE to CACHE.
  This enables users to override values when configuring. If they don't
  set any value, the value follows "testing=On/Off".
@hageboeck hageboeck self-assigned this Sep 30, 2025
Copy link

Test Results

    22 files      22 suites   3d 21h 24m 40s ⏱️
 3 683 tests  3 683 ✅ 0 💤 0 ❌
79 128 runs  79 128 ✅ 0 💤 0 ❌

Results for commit 72b979a.

@hageboeck hageboeck marked this pull request as ready for review October 1, 2025 11:47
@hageboeck hageboeck requested a review from bellenot as a code owner October 1, 2025 11:47
@hageboeck hageboeck requested a review from aaronj0 October 1, 2025 11:47
Copy link
Contributor

@aaronj0 aaronj0 left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@hageboeck hageboeck merged commit ab96a8d into root-project:master Oct 1, 2025
28 checks passed
@hageboeck hageboeck deleted the CppInterOp_gtest branch October 1, 2025 15:59
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 this pull request may close these issues.

2 participants