-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[llvm-config] Quote and escape paths #97305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If any of the printed paths by `llvm-config` contains quotes, spaces, backslashes or dollar sign characters, these paths will be quoted and the corresponding characters will be escaped. Following discussion in llvm#76304 Fixes llvm#28117
It seems the "if necessary" part was not implemented, because it now quotes even when quotes are not necessary, which is likely to break a ton of things. Edit: examples:
|
Example of subtle breakage: cctools-port ld64's support for LTO breaks for some reason because of this change. |
Are you able to debug what is wrong there? Maybe because they are collating path components to an already quoted path, and the bintools don't like that? (this works on Windows with cl.exe and clang-cl.exe at least). I think that if we don't introduce a breaking change with LLVM 19 in this regards (quoted strings emitted by Any other suggestions? |
I gave one subtle example, but here's another one less subtle: https://github.com/AFLplusplus/AFLplusplus/blob/stable/GNUmakefile.llvm#L420 this simple straightforward use breaks completely (can't find includes when compiling). |
Can you please revert the change while investigating a fix? Our downstream ToT builder is broken because of this change. |
Reverted. @kongy do you have a reproducer that I could test locally by chance? |
Our build script invokes
|
If any of the printed paths by `llvm-config` contains quotes, spaces, backslashes or dollar sign characters, these paths will be quoted and the corresponding characters will be escaped. Following discussion in llvm#76304 Fixes llvm#28117
This reverts commit e8c9414.
While we could avoid unnecessary escaping for the libraries above, escaping paths in general (like this patch does) would need some modifications (I think) in scripts using What do you all think about adding a new flag such as |
Another approach would have been to only add quotes when there is a space in the path. If old tooling relied on such things, it was broken anyways (there is no way of correctly splitting unless we add some hard assumptions). But |
Please see #103397 |
If any of the printed paths by
llvm-config
contains quotes, spaces, backslashes or dollar sign characters, these paths will be quoted and the corresponding characters will be escaped.Following discussion in #76304
Fixes #28117