Failed arc patch does not return non-zero exit code

Hello,

We use arc patch in a CI job as part of a merge queue of sorts. If the patch fails against master (for example, due to merge conflicts) then we want the build to fail.

This used to work until a few weeks ago, when we upgraded Arcanist. It looks like it’s due to the arc patch command returning an exit code 0 even on error. /scripts/arcanist.php returns an exit code 1, but this seems to be swallowed up by ArcanistRuntime or somewhere else up the stack.

My hunch is that it stopped working after https://secure.phabricator.com/D20990.

Reproduction Instructions

  • Try to patch an unpatchable diff against a repository (e.g. an outdated diff, one that has been closed, or one that was created for a different repository).
  • An error message should be shown, but the exit code will be 0.

Phabricator/Arcanist Version
arcanist 1b97f8b4086dba6ce52b11d8601e03987581e3f7 (26 Feb 2020)

Thanks, see https://secure.phabricator.com/D21037.