@@ -810,15 +810,29 @@ namespace driver {
810
810
do {
811
811
using namespace std ::placeholders;
812
812
// Ask the TaskQueue to execute.
813
- TQ->execute (std::bind (&PerformJobsState::taskBegan, this ,
814
- _1, _2),
815
- std::bind (&PerformJobsState::taskFinished, this ,
816
- _1, _2, _3, _4, _5),
817
- std::bind (&PerformJobsState::taskSignalled, this ,
818
- _1, _2, _3, _4, _5, _6));
819
-
820
- // Returning from TaskQueue::execute should mean either an empty
821
- // TaskQueue or a failed subprocess.
813
+ if (TQ->execute (std::bind (&PerformJobsState::taskBegan, this ,
814
+ _1, _2),
815
+ std::bind (&PerformJobsState::taskFinished, this ,
816
+ _1, _2, _3, _4, _5),
817
+ std::bind (&PerformJobsState::taskSignalled, this ,
818
+ _1, _2, _3, _4, _5, _6))) {
819
+ if (Result == EXIT_SUCCESS) {
820
+ // FIXME: Error from task queue while Result == EXIT_SUCCESS most
821
+ // likely means some fork/exec or posix_spawn failed; TaskQueue saw
822
+ // "an error" at some stage before even calling us with a process
823
+ // exit / signal (or else a poll failed); unfortunately the task
824
+ // causing it was dropped on the floor and we have no way to recover
825
+ // it here, so we report a very poor, generic error.
826
+ Comp.Diags .diagnose (SourceLoc (), diag::error_unable_to_execute_command,
827
+ " <unknown>" );
828
+ Result = -2 ;
829
+ AnyAbnormalExit = true ;
830
+ return ;
831
+ }
832
+ }
833
+
834
+ // Returning without error from TaskQueue::execute should mean either an
835
+ // empty TaskQueue or a failed subprocess.
822
836
assert (!(Result == 0 && TQ->hasRemainingTasks ()));
823
837
824
838
// Task-exit callbacks from TaskQueue::execute may have unblocked jobs,
0 commit comments