Bash interperets the '?' character as matching an arbitrary character.
On systems that have a file or directory with exactly one character in
their root directory, '/?' gets reinterpreted into that pathname, which
fails to match the expected Help text for llvm-rc.
This patch quotes the '/?' to avoid that edge case.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I'm not sure off the top of my head if this works the same on Windows' cmd.exe. If someone can check this on a Windows box that would be useful.
I believe this is not the case in cmd.exe, since most commands use /? to display the help text.
Anyways, this explains some of the failures I've seen running help text tests.
It seems that single-quotes fail on Windows ('/h' is considered a whole argument, including the quotes). Double-quotes should work, though.
We don't actually use cmd to run tests on Windows, so the single quotes should work. We use lit's internal shell, which is effectively a limited implementation of bash.
test/tools/llvm-rc/helpmsg.test | ||
---|---|---|
1 ↗ | (On Diff #108144) | nit: you don't need to quote this, but only '?' |
We have hit this corner case in our internal Windows bot! I can confirm that your fix, fixes it on our bot, so please submit it when you can!