-
Notifications
You must be signed in to change notification settings - Fork 64
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
Shell expansion is not supported in compile_commands.json #670
Comments
@Lassebq We can't reproduce your question Based on the information you provided, can you answer the following question? It would be very helpful for us to investigate this question. Thank you very much!
|
@Lassebq Is this essentially a feature request for us to recognize the command within your Makefile, execute it, and then replace the content when we drop it in your compile_commands.json? Is the current functionality not working for you? (i.e. Intellisense isn't working) |
|
@gcampbell-msft |
Works as expected with |
But if you don't set it then the output is invalid. At least warn user about backtick commands being used in makefile. I was pulling my hair out trying to figure out what's wrong. |
@Lassebq The output of what is invalid? I would expect that the output is the same as it was before this support was added, we simply don't replace the command invocation. We log into the output channel the message `"Commands must be marked as safe before they will be executed in the shell.". Is there more of a notification that you are expecting? Thanks for testing. |
I thought it was clear what's input and what's output in this context let me quote this, regarding why the "output" (compile_commands.json) is invalid if you don't evaluate backtick commands:
source: https://clang.llvm.org/docs/JSONCompilationDatabase.html |
@Lassebq Okay, understood, so it wasn't that the output was worse than before, but it's still "invalid" in the llvm docs context. Got it, that makes sense. As for the notification, we can add an error warning so that people aren't surprised by this and it'll be more obvious. Thanks for the feedback. |
@Lassebq Keeping you updated, I've pushed a commit that adds a vscode notification rather than only a message in the Makefile Tools output pane. |
As per https://clang.llvm.org/docs/JSONCompilationDatabase.html neither "command" nor "arguments" key support shell expansion but makefile tools extension generates backticked shell commands regardless.
Example input makefile:
Output compile database:
The text was updated successfully, but these errors were encountered: