-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prevent LLVM cmake from finding builtin zstd. #17909
base: master
Are you sure you want to change the base?
Conversation
Current code was, if CMAKE_PREFIX_PATH had more than one element, essentially inadvertently replacing ROOTSYS by the current path.
LLVM uses the lower case spelling for 'zstd' and thus find_package was still being called.
Somewhat related: https://its.cern.ch/jira/browse/ROOT-10537 |
You are right. I will fix that issue as part of this PR. |
Test Results 18 files 18 suites 4d 6h 21m 54s ⏱️ For more details on these failures, see this check. Results for commit 72e5f75. ♻️ This comment has been updated with latest results. |
Sigh ... But sometimes we seem to want to use the builtin libzstd:
i.e. either libzstd is not installed locally or it is no longer found. |
Right ... :( ... Actually the error message is triggered by reading the previously produced |
The cleanup of the prefix path looks reasonable. Just one clarification regarding the pcms:
When LLVM wasn't configured with compression libraries, this still results in functioning pcms, just uncompressed? In that case I think we can go ahead. |
That is correct. |
In particular only remove full match. This fixes: https://its.cern.ch/jira/browse/ROOT-10537 which saw: ``` ...:${ROOTSYS}/lib:${ROOTSYS}/lib64:... ``` being replaced by: ``` ...::64:... ``` being replaced by:
@hageboeck I updated to consistent apply the fix to all 3 variable ... and extend to fix https://its.cern.ch/jira/browse/ROOT-10537 |
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.
I updated to consistent apply the fix to all 3 variable
Great, I was going to ask that! 🙂
I think I found a mistake (the replacements should start from the original ENV, not from the temporary variable, which is always empty.
And using a larger regex, one can probably save a few lines.
CMakeLists.txt
Outdated
string(REPLACE ":${_path}:" ":" _temp_envvar "${_temp_envvar}") | ||
string(REGEX REPLACE "^${_path}:" "" _temp_envvar "$ENV{${ENV_VAR}}") | ||
string(REGEX REPLACE ":${_path}$" "" _temp_envvar "${_temp_envvar}") |
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.
It looks like the lines were reordered, so the last argument needs to change.
And after the first line dealt with :A:
, you should get away with a single regex:
string(REPLACE ":${_path}:" ":" _temp_envvar "${_temp_envvar}") | |
string(REGEX REPLACE "^${_path}:" "" _temp_envvar "$ENV{${ENV_VAR}}") | |
string(REGEX REPLACE ":${_path}$" "" _temp_envvar "${_temp_envvar}") | |
string(REPLACE ":${_path}:" ":" _temp_envvar "$ENV{${ENV_VAR}}") | |
string(REGEX REPLACE ":?${_path}:?" "" _temp_envvar "${_temp_envvar}") |
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.
It looks like the lines were reordered, so the last argument needs to change.
Indeed, exactly what happeed :(
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.
And after the first line dealt with :A:, you should get away with a single regex:
string(REGEX REPLACE ":?${_path}:?" "" _temp_envvar "${_temp_envvar}")
I think they would still wrong partially replace
/some/other/path/${_path}
${_path}64
...:${_path}64:...
etc.
CMakeLists.txt
Outdated
if ("${_temp_envvar}" STREQUAL "${_path}") | ||
set(ENV{ENV_VAR} "") |
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.
This should be unnecessary if the above suggestion works as I think it works. The replacement should take care of all of
A:
:A
A
# if we leave the ':' it will result in an empty entry in the CMAKE_PREFIX_PATH | ||
# which will interpreted as the current directory. |
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.
This comment seems outdated now.
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.
The comment is maybe misplaced but still relevant. For the other paths, there is no side effect to having ::
whereas it is disastrous for CMAKE_PREFIX_PATH
.
Fix removal of ROOTSYS from CMAKE_PREFIX_PATH.
Current code was, if CMAKE_PREFIX_PATH had more than one element, essentially
inadvertently replacing ROOTSYS by the current path. (eg. if
CMAKE_PREFIX_PATH
contains just
:
or::
or:somethingelse
, it will add the current directory (top levelof the build directory to the prefix path).
Fix find_package disabling for zstd.
LLVM uses the lower case spelling for 'zstd' and thus find_package was still being called.
In practice this lead my build:
-Dbuiltin_zstd=ON -Dbuiltin_xxhash=ON -Dminimal=ON -Dbuiltin_zlib=ON
onAlmaLinux release 9.5 (Teal Serval)
to pick up thelib/libstd.a
for the LLVM libraries and fails to linkrootcling_stage1
because of missingxxHash
symbols.This PR also fixes: its.cern.ch/jira/browse/ROOT-10537
This is somewhat related to #16285
and #8633