-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Invalid variables in output names give confusing errors #2467
Comments
I would like to work on this issue. |
Can you provide some details on this? I was looking through ImplicitOutputsFunction.java. Is this the file which is related to this issue? @laurentlb @katre |
The problem is with invalid explicit (not implicit) outputs. I haven't looked into the code carefully enough to determine where, however. Thanks for investigating this! |
@katre While looking at another bug, I stumbled onto this. On investigating, it turns out that the problem is in the ImplicitOutputsFunction. The To show a sensible error here, we would have to throw an Exception from |
You're right, that looks like the cause. Throwing an exception there will be fine, but it needs to be a checked exception so we can fix all of the callers to handle it properly. |
Understood. Should I fix this and submit to Gerrit? |
I'll be happy to review a patch. |
Great, I'll get on this, then. One question, in the handling of this exception, the callers must further throw an exception, right? I mean, this is an error, right? |
Generally, yes, the exception should either be wrapped in whatever exceptions the caller is already throwing, or handled in another fashion. |
@katre I have fixed this and pushed to Gerrit for review(c9490), please review when you get the time. A couple of things to note:
Please tell me if any changes are required. Sorry for the long posts, this is my first code contribution to Bazel :). |
Please see the example reproduction at https://github.com/katre/invalid-output-name-test-case
If I define a rule with an output, which contains an invalid variable to expand, such as:
When I build that, I would expect an error telling me that the 'nonexistent' variable can't be expanded and this caused an error.
Instead, I get an error that the output 'bad_output' does not exist, which is very confusing.
The text was updated successfully, but these errors were encountered: