Add bazel query options setting #556
Conversation
b9cfd69 to
4d80964
Compare
| abortSignal?: AbortSignal; | ||
| } = {}, | ||
| ): Promise<blaze_query.QueryResult> { | ||
| const bazelConfig = vscode.workspace.getConfiguration("bazel"); |
There was a problem hiding this comment.
Once #552 is merged, please adapt and move to configuration.ts
cbandera
left a comment
There was a problem hiding this comment.
I wonder whether we shouldn't set the --keep_going flag by default, in order to be robust against temporary changes.
I.e. I keep seeing errors when I save my build file with partial changes and my build tree hence becomes temporarily corrupt....
54d4821 to
0c83368
Compare
0c83368 to
cb07a4b
Compare
@cbandera that might not be a bad idea tbh. I think that the custom query options setting is still helpful, but perhaps it would be better if we basically just encode "bazel.ignorePackageFailures": {
"type": "boolean",
"default": true,
"markdownDescription": "Whether to ignore failures in packages query (passes `--keep_going` to query command)."
},The only caveat is that if there are errors in the query output that result in the query not resolving the users' package, then users might be confused as to why their packages aren't showing up. |
480dcf0 to
d3532ec
Compare
|
@cbandera thoughts on my last comment and changes? |
|
If the scope of the problem that you are facing in your setup is really "just" the querying for packages (which is only used for the workspace-tree) then I would prefer to simply pass --keep_going for this specific query by default. Adding too many configuration options for the users that most of the devs wont ever use, just clutters the settings and makes it harder to use. I would also vote against coloring the workspace tree - that's too much added complexity. @cameron-martin do you have any thoughts on this PRs proposal? |
|
I agree that always passing |
Description
For very large bazel repos, git sparse checkout is commonly used to only pull a subset of directories in a repo. When this happens, the local version of the repo may not have all of the dependencies of all packages or tools required and this is expected.
Because the current
bazel querycall on extension startup passes...:*as the default query, the extension will automatically try to query all packages and will fail if any are missing, and will infinitely re-query and fail. This can be resolved by adding--keep_goingto the query command.This PR adds a
bazel query packages optionssetting to allow users to append custom parameters to the bazel query to support things such as sparse checkout.Related Issue
#198
Testing
Checklist
npm run test)