-
Notifications
You must be signed in to change notification settings - Fork 59
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
Auto --query-driver #539
Comments
Yes I totally agree on making this smoother via I believe the conditions you mentioned are definitely the cases that users want this to automagically work. I would even go one step further and relax the first condition to I believe we didn't have the |
#654 morphed into a duplicate of this issue. Definitely think there's a need here. The main point raised (x2) there but not mentioned here: Query driver being default off may well not really provide the security benefit anticipated. For example, in VSCode, one could just set the flag in the Project/.vscode/settings.json and invoke it on startup. (Discussion evolved after I'd raised just turning the query driver on by default.) Coincidentally, just noticed that a missing --query-driver is currently breaking Google's Bazel<->IntelliJ/Android Studio integration. Was able to spot that thanks to Sam's great explanations! |
A new vscode update I happened to see: There's now a popup when you open a directory, asking if you trust the code to execute files ("workspace trust") |
For anyone reading, looking to get query-driver to run automatically: |
You have to mention that it isn't very secure. |
I mean, no more or less secure in the VSCode case, right, since the flag can be specified in a settings file in the project directory--all gated behind a trust prompt? (As above/linked). More generally, presumably they're going to run the driver anyway to build the code and (in most cases) to work around the header flag issues. Seems worth it to me to have things work out of the box! We need --query-driver pretty often over on the Bazel-adapter side of things to pierce wrapper scripts. Though obviously super happy if there's a better solution. |
clangd/vscode-clangd#318 also talks about "workspace trust" feature. |
there could be a simple approach : if the executable match a *gcc *clangd *cc *c++ ... and so on (there aren't a lot of compilers, intel, gcc, clang... and anyway, you have to adapt to compiler specificities like -dM -E to get builtin defines, even if compilers tends to be more and more interchangeable) then treat it as the corresponding compiler (*gcc -> gcc...) and if you want to add safety :
|
Because clangd does not automatically query the driver (see clangd/clangd#539), must explicitly give it permission to call the underlying compiler. Even though that compiler had just been executed anyways, and clangd is running under the exact same user permissions as would be able to execute the actual compiler.
Lots of people seem to need --query-driver and have trouble understanding how/when to use it.
We also have people expecting it to work in situations where it won't. Can we automate some of this?
If:
Then:
window/showMessagePrompt
)window/showMessage
)Not sure if we'll get to this soon, but it's a fun idea... @kadircet
The text was updated successfully, but these errors were encountered: