Skip to content

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Aug 30, 2025

Wrapping to command inside a Cmake target doesn't seem to be necessary,
because in the test, the target is forced to be built without
dependencies anyway
(e.g. cmake --build . --target my_macro_test/fast --always-make when
using makefiles).

This fixes spurious project rebuilds when running the macro tests when
using ninja without forcing to run the test in serial mode.

Copy link

github-actions bot commented Aug 30, 2025

Test Results

    20 files      20 suites   3d 15h 7m 57s ⏱️
 3 653 tests  3 649 ✅   0 💤 4 ❌
71 384 runs  71 166 ✅ 213 💤 5 ❌

For more details on these failures, see this check.

Results for commit c4ce0be.

♻️ This comment has been updated with latest results.

Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

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

Wrapping to command inside a Cmake target doesn't seem to be necessary, because in the test, the target is forced to be built without dependencies anyway (e.g. cmake --build . --target my_macro_test/fast --always-make when using makefiles).

This is only partially true, for Unix Makefiles. With Ninja, we don't use /fast nor --always-make AFAICT

@guitargeek
Copy link
Contributor Author

The intention of the original macro is apparently to only build this one target that runs the command. The fact that this was not done correctly for Ninja doesn't mean that rebuilding all dependencies was the intended behavior. I suppose it was just not correctly implemented.

@@ -2340,36 +2340,18 @@ macro(ROOTTEST_COMPILE_MACRO filename)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

if(ARG_DEPENDS)
set(deps ${ARG_DEPENDS})
message(WARNING "Specifying DEPENDS in ROOTTEST_COMPILE_MACRO has no effect.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this warning is never hit. Nowhere in the codebase to we specify DEPENDS in a ROOTTEST_COMPILE_MACRO. Together with the dependencies being ignored via the \fast target when using Makefiles, that makes it clear to me that it was never the intention to have dependencies for these macro tests.

The problem is that even with no dependencies, a re-configuration will still be triggered if the CMake code was changed, which is the reason thy the RUN_SERIAL true workaround was needed.

Wrapping to command inside a Cmake target doesn't seem to be necessary,
because in the test, the target is forced to be built without
dependencies anyway
(e.g. `cmake --build . --target my_macro_test/fast --always-make` when
using makefiles).

This fixes spurious project rebuilds when running the macro tests when
using ninja without forcing to run the test in serial mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean build Ask CI to do non-incremental build on PR in:Build System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants