[v636][cmake] Quote list-valued cache variable in root-config generation - #23027
Conversation
The loop that builds the `root-config --config` argument list guards each
cache variable with
if((var MATCHES "_(LIBRARIES|LIBRARY|INCLUDE|VERSION)") AND
(NOT ${${var}} STREQUAL "") AND
(NOT ${var} MATCHES "NOTFOUND"))
When the variable holds a list (e.g.
CLING_LIBRARIES=clingInterpreter;clingMetaProcessor;clingUtils) the
unquoted ${${var}} expands to several tokens, so the parenthesised
sub-expression `(NOT a b c STREQUAL "")` is malformed. CMake silently
accepted this until 4.4, which now propagates errors from parenthesised
if() sub-expressions (Kitware/CMake@240481490c, kitware/cmake#26424) and
fails configuration with "Unknown arguments specified".
Quote the expansion so the value is compared as a single string. Besides
fixing configuration with CMake >= 4.4, this restores the intended
behaviour: list-valued variables were previously dropped from
`root-config --config` (the malformed guard evaluated to false) and are
now included.
Signed-off-by: Chris Burr <christopher.burr@cern.ch>
|
/backport to 6.32 |
There was a problem hiding this comment.
Pull request overview
This PR updates ROOT’s top-level CMake configuration logic to remain compatible with CMake ≥ 4.4 when evaluating cache variables whose values may be CMake lists (semicolon-separated).
Changes:
- Quote the dereferenced cache-variable value in the
if()guard used while assemblingroot-config --configarguments, preventing malformedif()expressions when the value is list-valued.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 16 files 16 suites 2d 7h 37m 57s ⏱️ Results for commit 504af81. |
|
/backport to 6.32 |
|
Preparing to backport PR #23027 to branch 6.32 requested by pcanal |
|
This PR has been backported to branch 6.32: #23031 |
|
/backport to 6.28 |
|
Preparing to backport PR #23027 to branch 6.28 requested by pcanal |
|
This PR has been backported to branch 6.28: #23032 |
|
/backport to 6.30 |
|
Preparing to backport PR #23027 to branch 6.30 requested by pcanal |
|
This PR has been backported to branch 6.30: #23033 |
The loop that builds the
root-config --configargument list guards each cache variable withWhen the variable holds a list (e.g.
CLING_LIBRARIES=clingInterpreter;clingMetaProcessor;clingUtils) the unquoted ${${var}} expands to several tokens, so the parenthesised sub-expression
(NOT a b c STREQUAL "")is malformed. CMake silently accepted this until 4.4, which now propagates errors from parenthesised if() sub-expressions (Kitware/CMake@240481490c, kitware/cmake#26424) and fails configuration with "Unknown arguments specified".Quote the expansion so the value is compared as a single string. Besides fixing configuration with CMake >= 4.4, this restores the intended behaviour: list-valued variables were previously dropped from
root-config --config(the malformed guard evaluated to false) and are now included.Backport of #22790