Skip to content

[CMake] Deal with semicolons in ENV passed to RootTestDriver#21074

Merged
guitargeek merged 3 commits intoroot-project:masterfrom
guitargeek:roottestdriverenv
Jan 30, 2026
Merged

[CMake] Deal with semicolons in ENV passed to RootTestDriver#21074
guitargeek merged 3 commits intoroot-project:masterfrom
guitargeek:roottestdriverenv

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

The processing of the environment variables in the RootTestDriver used excessive CMake string-to-list parsing, and the semicolons would have to be escaped for each of these parsings. That means the RootTestDriver command needed to include a magic number amount of escape characters to propagate semicolons to the final environment variables.

The fix is to escape semicolons once in the beginning, and then re-escape them after each step that involves list parsing.

Like this, the command can contain just bare semicolons without having to escape anything.

In a next step, one can consider giving the same treatment to the ROOT_ADD_TEST macro, which also does excessive list parsing. Then we don't need tricks like the $<SEMICOLON> generator expression anymore to propagate semicolons into the final command.

Follows up on a comment by @pcanal: #21056 (comment)

Copy link
Copy Markdown
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 29, 2026

Test Results

    22 files      22 suites   3d 10h 14m 33s ⏱️
 3 775 tests  3 775 ✅ 0 💤 0 ❌
75 079 runs  75 079 ✅ 0 💤 0 ❌

Results for commit fc60d55.

♻️ This comment has been updated with latest results.

The processing of the environment variables in the RootTestDriver used
excessive CMake string-to-list parsing, and the semicolons would have to
be escaped for each of these parsings. That means the RootTestDriver
command needed to include a magic number amount of escape characters to
propagate semicolons to the final environment variables.

The fix is to escape semicolons once in the beginning, and then
re-escape them after each step that involves list parsing.

Like this, the command can contain just bare semicolons without having
to escape anything.

In a next step, one can consider giving the same treatment to the
`ROOT_ADD_TEST` macro, which also does excessive list parsing. Then we
don't need tricks like the `$<SEMICOLON>` generator expression anymore
to propagate semicolons into the final command.
@guitargeek guitargeek merged commit 29df407 into root-project:master Jan 30, 2026
51 of 53 checks passed
@guitargeek guitargeek deleted the roottestdriverenv branch January 30, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants