forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtimes] Fix parsing of LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS (llvm#67691
) Since 78d649a the recommended way to pass an executor is to use the _TEST_PARAMS variable, which means we now pass more complicated value (including ones that may contain multiple `=`) as part of this variable. However, the `REGEX REPLACE` being used has greedy matches so everything up to the last = becomes part of the variable name which results in invalid syntax in the generated lit config file. This was noticed due to builder failures for those using the CrossWinToARMLinux.cmake cache file. --------- Co-authored-by: Vladimir Vereschaka <vvereschaka@accesssoftek.com>
- Loading branch information
1 parent
5099dc3
commit e599422
Showing
5 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
macro(serialize_lit_param output_var param value) | ||
string(APPEND ${output_var} "config.${param} = ${value}\n") | ||
endmacro() | ||
|
||
macro(serialize_lit_string_param output_var param value) | ||
# Ensure that all quotes in the value are escaped for a valid python string. | ||
string(REPLACE "\"" "\\\"" _escaped_value "${value}") | ||
string(APPEND ${output_var} "config.${param} = \"${_escaped_value}\"\n") | ||
endmacro() | ||
|
||
macro(serialize_lit_params_list output_var list) | ||
foreach(param IN LISTS ${list}) | ||
string(FIND "${param}" "=" _eq_index) | ||
string(SUBSTRING "${param}" 0 ${_eq_index} name) | ||
string(SUBSTRING "${param}" ${_eq_index} -1 value) | ||
string(SUBSTRING "${value}" 1 -1 value) # strip the leading = | ||
serialize_lit_string_param("${output_var}" "${name}" "${value}") | ||
endforeach() | ||
endmacro() |