Fixed bug with cquery not returning error code on failure#28790
Open
rdelfin wants to merge 2 commits intobazelbuild:masterfrom
Open
Fixed bug with cquery not returning error code on failure#28790rdelfin wants to merge 2 commits intobazelbuild:masterfrom
rdelfin wants to merge 2 commits intobazelbuild:masterfrom
Conversation
Contributor
Author
|
I've tested this with the example commands given in the issue both before and after this change: |
Contributor
Author
|
The previous CI failures seem to be legit, but to fix them I've had to add some logic to make sure we actually process all results. This seems better than just changing the test as making the actual output of failing cquery commands seems like breaking a legitimate expectation. However, let me know if this isn't an appropriate solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There is a bug in the cquery command where the command will exit with a 0 exit code even if the command fails at any step along the way (e.g. while fetching a dependency). In this PR, I override the
processfunction to throw a clear starlark eval error.Motivation
Fixes #21466. This will fix a bug in the cquery command. Currently the only way to detect a failure of a cquery command that uses
starlark:expris by parsing the stdout of the command and search for errors, which can be quite flaky.Build API Changes
No
Checklist
Release Notes
RELNOTES: Fixes a bug in cquery where
starlark:exprfailures were being ignored for the status code