HomePhabricator

[Wilds] Handle SIGINT (^C) in ArcanistRuntime in a more formal way

Authored by epriestley on Sep 24 2018, 3:14 PM.

Description

[Wilds] Handle SIGINT (^C) in ArcanistRuntime in a more formal way

Summary:
Ref T13098. Add ^C handling and some small bits:

  • Update arc weld.
  • Test that arc weld filen<tab> completes filename (it does).
  • Add a "workflow stack" -- I plan to make it easier for arc diff to call arc unit / arc lint as formal sub-workflows, etc., and make "workflow X delegates to workflow Y" a more formal thing.

On interrupts:

  • Workflows can do something when you press ^C.
  • If they do, press ^C twice quickly to exit.
  • Otherwise, we exit on the first ^C.

The major thing I'd like to do in the short-ish term is to make phage report status on interrupt, but some other workflows might make sense to have interrupt handlers (maybe long-running stuff like arc upload / arc download) and third parties may find creative uses for them.

Test Plan:

  • Added some sleep(...) to WeldWorkflow.
  • Interrupted, got program exit.
  • Added interrupt handlers and interrupted, got interrupt handling.
  • With interrupt handlers, interrupted twice. Got program exit.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13098

Differential Revision: https://secure.phabricator.com/D19703