Skip to content

Conversation

@hageboeck
Copy link
Member

@hageboeck hageboeck commented Jan 7, 2026

When ROOT is installed in the system, roottest would try invoking /usr/bin/root.exe, leading to failures when trying to combine .pcms from two different ROOT builds.

This was caused by a find_package(ROOT) and find_program(root-config) at the start of the roottest config, which find the system ROOT before the ROOT being configured. With roottest being part of the ROOT build, any find_package(ROOT) and discovery of root-config and ROOTSYS could be removed, since these variables are anyway known already in the running CMake configuration.

This entailed a move from if(ROOT_<component>_FOUND) to if(<component>), since the former is only set by find_package(ROOT) whereas the latter always available. As a side effect of this move, 4 tests enabled themselves, because the ROOT_xxx_FOUND apparently didn't propagate correctly to all locations in roottest. These are:

@hageboeck hageboeck self-assigned this Jan 7, 2026
@hageboeck hageboeck force-pushed the roottest_systemRoot branch from 7ccf1e0 to c55369f Compare January 7, 2026 17:22
@hageboeck hageboeck requested a review from guitargeek January 7, 2026 17:23
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Test Results

    22 files      22 suites   3d 16h 23m 1s ⏱️
 3 794 tests  3 792 ✅ 0 💤 2 ❌
80 380 runs  80 378 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 58a965d.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck force-pushed the roottest_systemRoot branch 2 times, most recently from f523bff to 98e28dd Compare January 8, 2026 10:22
Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Thank you very much, great initiative!

There is however something that needs to happen at the same time as a corollary. The find_package(ROOT) sets these ROOT feature variables like ROOT_pyroot_FOUND, which are extensively used in the tests (for example here).

Now that these variables are not set, the features are not detected and many tests are skipped, like the linked roottest-python-pythonizations-pythonizations. You can compare your CI runs with the nightlies and count the number of tests, and then the extent of this gets clear. For example, in this PR, 3706 test ran on alma10, and in the last nightlies there were 3742.

What you need to do is the same PR (or maybe another one that we merge before) is to replace all these feature variables with the CMake variables that ROOT sets at build time, like pyroot.

"message(ERROR" is not valid CMake.
The test was enabled based on whether ROOT_cintex_FOUND was set. This,
however, will never be set, so the test was always disabled.
@hageboeck hageboeck force-pushed the roottest_systemRoot branch from 98e28dd to 4d45862 Compare January 8, 2026 16:08
@hageboeck
Copy link
Member Author

@guitargeek

Now that these variables are not set, the features are not detected and many tests are skipped, like the linked roottest-python-pythonizations-pythonizations. You can compare your CI runs with the nightlies and count the number of tests, and then the extent of this gets clear. For example, in this PR, 3706 test ran on alma10, and in the last nightlies there were 3742.

I raise to 3746. I noticed this also locally, since there were subfolders where the (previously plain and local) CMake variables didn't get propagated correctly. Now, since the ifs in rootest rely on global CACHE variables, they are visible in all subdirectories.

The build options called ROOT_xxx_FOUND originate from
find_package(ROOT). Given that roottest is built as part of the ROOT
build, one can now directly use the build option flags from ROOT's
CMake.
This will allow to remove the find_package(ROOT) step in the future.

This change enabled the following test, which was disabled because
ROOT_mathmore_FOUND wasn't set correctly:
+gtest-roofit-roofit-vectorisedPDFs-testLegendre
When ROOT is installed in the system, roottest would try invoking
/usr/bin/root.exe, leading to failures when trying to combine .pcms from
two different ROOT builds.

This was caused by a find_package(ROOT) and find_program(root-config),
which find the system ROOT before the ROOT being configured.
With roottest being part of the ROOT build, any find_package(ROOT) and
discovery of root-config and ROOTSYS could be removed, since these
variables are anyway known already in the running CMake configuration.

This enabled the following tests, which were disabled because the
ROOT_xxx_FOUND flags weren't propagated correctly to the subdirectory:
+roottest-python-JupyROOT-cppcompleter_doctest
+roottest-python-JupyROOT-handlers_doctest
+roottest-python-JupyROOT-utils_doctest
@hageboeck hageboeck force-pushed the roottest_systemRoot branch from 4d45862 to 58a965d Compare January 8, 2026 17:12
@hageboeck hageboeck marked this pull request as ready for review January 9, 2026 08:14
Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Nice, thanks for this! Looks good now

@hageboeck hageboeck marked this pull request as draft January 9, 2026 10:45
@hageboeck
Copy link
Member Author

hageboeck commented Jan 9, 2026

Nice, thanks for this! Looks good now

OK, needs one more iteration, though. The following ifs don't do what we expected on Windows:

if(NOT MSVC OR CMAKE_SIZEOF_VOID_P EQUAL 8 OR llvm13_broken_tests)
if(NOT MSVC OR "${CMAKE_GENERATOR_PLATFORM}" MATCHES "Win32" OR win_broken_tests)
ROOTTEST_ADD_TEST(class MACRO
runPyClassTest.C
WORKING_DIR ${CMAKE_CURRENT_SOURCE_DIR}
OUTREF PyClassTest.ref)
endif()
endif()

It's understood now. The logic will be updated in #20830

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.

3 participants