Skip to content

Fix paths with spaces in lit check updater - #9376

Open
Rodri5449 wants to merge 1 commit into
WebAssembly:mainfrom
Rodri5449:fix/lit-checks-paths-with-spaces
Open

Rodri5449 wants to merge 1 commit into
WebAssembly:mainfrom
Rodri5449:fix/lit-checks-paths-with-spaces

Conversation

@Rodri5449

Copy link
Copy Markdown

update_lit_checks.py expanded %s/%S/%t before parsing foreach and
didn't quote them for the shell, so paths with spaces broke the updater.
This parses foreach first and quotes expanded paths.

Added test/unit/test_update_lit_checks_paths.py (real updater + wasm-opt
in a directory with spaces): 4 of 5 variants fail before the fix, all pass
after. Tested on Ubuntu (WSL) only.

@Rodri5449
Rodri5449 requested a review from a team as a code owner November 9, 2026 16:18

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates scripts/update_lit_checks.py to properly handle and escape paths containing spaces (such as %s, %S, and %t) when executing shell commands, using platform-appropriate quoting (shlex.quote or subprocess.list2cmdline). It also updates the foreach parsing logic to support arguments with spaces and introduces a new unit test suite in test/unit/test_update_lit_checks_paths.py to verify these changes across various scenarios. There are no review comments, and I have no additional feedback to provide.

@tlively tlively left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we have lit tests with spaces where this matters? If not, it might be better to just add a TODO comment and save the complexity of making this more robust for now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants