-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Avoid unneeded artifacts in the library installation directory #19044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
guitargeek
wants to merge
4
commits into
root-project:master
Choose a base branch
from
guitargeek:python_install_dir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Results 19 files 19 suites 3d 9h 58m 37s ⏱️ Results for commit cebd367. ♻️ This comment has been updated with latest results. |
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.
If the `CMAKE_INSTALL_PYTHONDIR` is different from the `CMAKE_INSTALL_LIBDIR`, the cppyy libraries will still be installed in the `CMAKE_INSTALL_LIBDIR` and then there are symlinks created in the `CMAKE_INSTALL_PYTHONDIR`. This should not be done, as system links should be avoided in the install tree, it entangles the regular ROOT libraries with the Python libraries, and there is actually no reason to do it.
6950325
to
cebd367
Compare
pcanal
reviewed
Jun 17, 2025
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${byproduct}.pcm DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
endforeach() | ||
|
||
list(APPEND core_implicit_modules "-mByproduct" "") |
There was a problem hiding this comment.
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?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.