@@ -56,6 +56,10 @@ subroutine build_model(model, settings, package, error)
56
56
call model% deps% add(package, error)
57
57
if (allocated (error)) return
58
58
59
+ ! Update dependencies where needed
60
+ call model% deps% update(error)
61
+ if (allocated (error)) return
62
+
59
63
! build/ directory should now exist
60
64
if (.not. exists(" build/.gitignore" )) then
61
65
call filewrite(join_path(" build" , " .gitignore" ),[" *" ])
@@ -435,7 +439,7 @@ subroutine cmd_run(settings,test)
435
439
type (string_t), allocatable :: executables(:)
436
440
type (build_target_t), pointer :: exe_target
437
441
type (srcfile_t), pointer :: exe_source
438
- integer :: run_scope
442
+ integer :: run_scope,firsterror
439
443
integer , allocatable :: stat(:)
440
444
character (len= :),allocatable :: line
441
445
logical :: toomany
@@ -580,10 +584,12 @@ subroutine cmd_run(settings,test)
580
584
if (any (stat /= 0 )) then
581
585
do i= 1 ,size (stat)
582
586
if (stat(i) /= 0 ) then
583
- write (stderr,' (*(g0:,1x))' ) ' <ERROR> Execution failed for object "' ,basename(executables(i)% s),' "'
587
+ write (stderr,' (*(g0:,1x))' ) ' <ERROR> Execution for object "' ,basename(executables(i)% s),&
588
+ ' " returned exit code ' ,stat(i)
584
589
end if
585
590
end do
586
- call fpm_stop(1 ,' *cmd_run*: Stopping due to failed executions' )
591
+ firsterror = findloc(stat/= 0 ,value= .true. ,dim= 1 )
592
+ call fpm_stop(stat(firsterror),' *cmd_run*:stopping due to failed executions' )
587
593
end if
588
594
589
595
endif
0 commit comments