-
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
Add failure_message to ctx.actions.run
#18555
Comments
P4 - because we should be conservative with new features / actions shouldn't be designed to fail cc @lberki who did a recent review on a PR that adds additional logging to the C++ actions and might think such a FR is P3 |
This isn't a case of "designed to fail" so much as "things will fail sometimes, and it's designed to have a good user experience when that does happen." What we'd imagine would be for the error message for whatever target fails to say "To debug this failure, you can execute Not having this means we either need to rely on people knowing the run whichever target failed's |
I feel similarly to #19302 : this looks like a reasonable feature for a build to have, but I don't see why it needs to be a feature of Bazel: the action is under your control, so it's possible to wrap the action in an Am I missing something? |
My only reasoning for this FR was that I didn't want to add the message into the action because if we change the message, it will cache bust all the actions. I understand it adds more surface area to the API, so feel free to close if you want. |
I started a separate thread about your use case (my mental model is that action cache entries are cheap to regenerate individually, they have value only "in bulk"), but assuming that's the model you settle on, I could imagine something like this:
This way, you can change (2) without losing the cache entries for (1). |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
Description of the feature request:
ctx.actions.run currently has a
progress_message
that gets printed when the action is running. I would like afailure_message
that will get printed if the action fails. I want to output a set of debug instructions so the user can fix their issue. I could pass in a failure message into my action, but I don't want it depending on that input since it won't affect the output.What underlying problem are you trying to solve with this feature?
Make debugging failures easier.
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?6.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: