Skip to content

Conversation

hageboeck
Copy link
Member

Instead of a two-step process that writes the dynamic contents at CMake configure time, and a build-time step that concatenates the static and dynamic part of the modulemap, CMake's configure_file is used to directly write the full contents at configure time.

This is carrying the simplifications in #19786 even further.

@hageboeck hageboeck self-assigned this Sep 2, 2025
@hageboeck hageboeck requested a review from bellenot as a code owner September 2, 2025 12:38
@hageboeck hageboeck added the clean build Ask CI to do non-incremental build on PR label Sep 2, 2025
Copy link

github-actions bot commented Sep 2, 2025

Test Results

    20 files      20 suites   4d 3h 24m 23s ⏱️
 3 653 tests  3 612 ✅   0 💤 41 ❌
71 384 runs  71 182 ✅ 161 💤 41 ❌

For more details on these failures, see this check.

Results for commit ec42560.

♻️ This comment has been updated with latest results.

Instead of a two-step process that writes the dynamic contents at
CMake configure time, and a build-time step that concatenates the static
and dynamic part of the modulemap, CMake's configure_file() is used to
directly write the full contents at configure time.
As usual for configure files, the time stamp only changes when the file
contents change, so spurious rebuilds of the modules are avoided.
COPYONLY)
string(REPLACE ";" "" ROOT_GENERATED_MODULEMAP_CONTENT "${__modulemap_extra_content}")
# Now append the generated content to the original modulemap
configure_file(${CMAKE_SOURCE_DIR}/cmake/unix/module.modulemap ${CMAKE_BINARY_DIR}/include/ROOT.modulemap)
Copy link
Member

Choose a reason for hiding this comment

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

Would that work if somebody reconfigure with different options? Eg. cmake -DTMVA=On then cmake -DTMVA=Off.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it does! I tested it, and the CMAKE variable is filled into the file again

Copy link
Member Author

Choose a reason for hiding this comment

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

(and of course, when you reconfigure with different options, the time stamp is updated)

Copy link
Member

Choose a reason for hiding this comment

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

Hm... okay. I tried that long time ago and failed to make it work but perhaps now we have all the dependencies tracked right...

Copy link
Member Author

Choose a reason for hiding this comment

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

What concerns the build system, the only dependencies that remain are *.pcm -> ${BINDIR}/include/ROOT.modulemap
The contents of the modulemap are (re-)generated during every CMake run, and if it comes out to be the same contents, the file remains untouched.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Btw there is this comment here

// FIXME: Merge the modulemap generation from cmake and here in rootcling.
that might be relevant.

Copy link
Member Author

Choose a reason for hiding this comment

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

@vgvassilev is the comment above still relevant?

Copy link
Member

Choose a reason for hiding this comment

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

Somewhat relevant but requires a lot of work. We could move all of the logic of modulemap creation to rootcling to merge the paths with Aclic. This however has other underwater rocks.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants