-
Notifications
You must be signed in to change notification settings - Fork 533
Description
Problem
Currently, the process_wrapper forwards the exit code of a given child process. As a result, if the child process fails, so will the process_wrapper, and the action running it.
This makes it impossible to do things like post-processing linter outputs.
Specifically, I want to call rust_clippy_action from my own rules (rules_lint). I want to do some post-processing to clippy's output in a further action down the line (e.g. to generate reports in a different format). Clippy may generate both warnings and errors, and return with a non-zero code if there is at least one error.
Imagine my code has one warning and one error. I have two options:
- Let the entire build fail because there was one error, or
- Demote all errors to warnings so that clippy succeeds, which loses me information about which problems were actually errors.
Proposal
I'd like to add two arguments to process_wrapper:
--forward-exit-code (boolean): If set, the process_wrapper will exit with the same exit code as the subprocess if it had no internal errors.--exit-code-file (String): If set, the exit code of the child process will be written to this file. Unset by default.
This allows callers a lot more control over how they want to treat errors, and should be an invisible change for existing users.
However, it touches a fundamental API ( the process_wrapper), so I thought better to ask first: Would this be an acceptable change?