Skip to content

[CMake] Avoid unneeded artifacts in the library installation directory - #19044

Open
guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:python_install_dir
Open

guitargeek wants to merge 3 commits into
root-project:masterfrom
guitargeek:python_install_dir

Conversation

@guitargeek

@guitargeek guitargeek commented Jun 14, 2025 •

Copy link
Copy Markdown
Contributor

Avoid unneeded artifacts in the library installation directory, in particular empty directories if the Python interfaces are installed in a directory other than the library installation directory.

Motivated by:

More detail in the commit description.

@guitargeek guitargeek self-assigned this Jun 14, 2025
@guitargeek guitargeek added in:Build System clean build Ask CI to do non-incremental build on PR labels Jun 14, 2025
@github-actions

github-actions Bot commented Jun 14, 2025 •

Copy link
Copy Markdown

Test Results

    19 files      19 suites   3d 5h 13m 16s ⏱️
 3 880 tests  3 878 ✅ 0 💤 2 ❌
64 927 runs  64 924 ✅ 1 💤 2 ❌

For more details on these failures, see this check.

Results for commit 17436d9.

♻️ This comment has been updated with latest results.

@guitargeek
guitargeek force-pushed the python_install_dir branch from 6950325 to cebd367 Compare June 14, 2025 20:58
@guitargeek
guitargeek marked this pull request as ready for review June 14, 2025 20:58
@guitargeek
guitargeek requested a review from bellenot as a code owner June 14, 2025 20:58
Comment thread core/CMakeLists.txt Outdated
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${byproduct}.pcm DESTINATION ${CMAKE_INSTALL_LIBDIR})
endforeach()

list(APPEND core_implicit_modules "-mByproduct" "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the semantic of those additions?

Comment thread core/CMakeLists.txt
list(APPEND core_implicit_modules "-mByproduct" "ROOT_Foundation_Stage1_NoRTTI")
list(APPEND core_implicit_modules "-mByproduct" "ROOT_Foundation_C")
list(APPEND core_implicit_modules "-mByproduct" "ROOT_Rtypes")
list(APPEND core_implicit_modules "-m" "_Builtin_intrinsics")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like it would now be listed twice in core_implicit_modules, i.e. once more inside the new foreach loop.

Comment thread bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt Outdated
Explicitly install byproducts of generating Core dictionaries, and put
the CMake code right next to where these byproducts are declared. This
is better than relying on all `.pcm` files getting installed via some
other part of the CMake code.
Explicitly installing the `modules.idx` file is better than copying it
by regex when copying the full library output directory.
Explicitly listing all the `pcm` files that otherwise would not get
installed seems tedious, but it has one clear advantage over
`install(DIRECTORY ...)`. The problem with the latter is that it
copies any subdirectories, not matter if the files in it were matched by
regex or not. So what happens is that you end up with several empty
directories in the install tree, notably the full directory structure of
the Python interfaces, in case they are installed to a different
directory. One way to fix this is to install the individual pcm files
instead, as suggested by this commit.

This branch has not been deployed

No deployments
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