avoid interleaving command stages with Concurrency 1
authorJoey Hess <joeyh@joeyh.name>
Wed, 16 Sep 2020 16:10:45 +0000 (12:10 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 16 Sep 2020 16:10:45 +0000 (12:10 -0400)
commitb6642dde8a49f34d7983a40e99bf7032a731c964
tree4dbb0b2c577f3ffefc7bd5b47dd03481bb51406c
parent877ef84a1be4f3dbc0f6ed9d3838bb97515432d2
avoid interleaving command stages with Concurrency 1

Before, -J1 was different than no -J: It makes concurrent-output be used
for display, and it actually can run concurrent jobs in some situations.
Eg, a perform stage and a cleanup stage can both run.

dupState is used in several places, and changes NonConcurrent to
Concurrent 1. My concern is that this might, in some case, enable
that concurrent behavior. And in particular, that it might get enabled in
--batch mode, when the user is not expecting concurrent output because
they did not pass -J.

While I don't have a test case where that happens and causes out of
order output, it looks like it could, and so prudent to make this change.
CmdLine/Action.hs