on master help sign in
include mains outside of src/ when reporting number of compiled modules

There are many error cases where the module is not counted in the current code though. So this code also removes a BDone from another error case. The count goes really fast even with ~1000 modules, so this seems like an okay meaning for the number.

commit90bf99c566b4cb3a29fb688f9543ea1563aa2c38 authorEvan Czaplicki <evancz@users.noreply.github.com> dateTue 2 Jul 2019, 17:15 (7 years ago) parenta5febad
1 file changed+9−10
builder/src/Build.hs+9−10
builder/src/Build.hs+9−10
@@ -685,9 +685,8 @@ compile (Env key root pkg _ _ _) docsNeed local@(Details.Local path time _ _) so
685685 return (RNew local iface objects docs)
686686
687687 Left err ->
688− do Reporting.report key Reporting.BDone
689− return $ RProblem $
690− Error.Module (Src.getName modul) path time source err
688+ return $ RProblem $
689+ Error.Module (Src.getName modul) path time source err
691690
692691
693692
@@ -1077,13 +1076,13 @@ checkMain env@(Env _ root _ _ _ _) results pendingMain =
10771076 do depsStatus <- checkDeps root results deps
10781077 case depsStatus of
10791078 DepsChange ifaces ->
1080− return $ compileOutside env local source ifaces modul
1079+ compileOutside env local source ifaces modul
10811080
10821081 DepsSame same cached ->
10831082 do maybeLoaded <- loadInterfaces root same cached
10841083 case maybeLoaded of
10851084 Nothing -> return ROutsideBlocked
1086− Just ifaces -> return $ compileOutside env local source ifaces modul
1085+ Just ifaces -> compileOutside env local source ifaces modul
10871086
10881087 DepsBlock ->
10891088 return ROutsideBlocked
@@ -1093,18 +1092,18 @@ checkMain env@(Env _ root _ _ _ _) results pendingMain =
10931092 Error.BadImports (toImportErrors env results imports problems)
10941093
10951094
1096−compileOutside :: Env -> Details.Local -> B.ByteString -> Map.Map ModuleName.Raw I.Interface -> Src.Module -> MainResult
1097−compileOutside (Env _ _ pkg _ _ _) (Details.Local path time _ _) source ifaces modul =
1095+compileOutside :: Env -> Details.Local -> B.ByteString -> Map.Map ModuleName.Raw I.Interface -> Src.Module -> IO MainResult
1096+compileOutside (Env key _ pkg _ _ _) (Details.Local path time _ _) source ifaces modul =
10981097 let
10991098 name = Src.getName modul
11001099 in
11011100 case Compile.compile pkg ifaces modul of
11021101 Right (Compile.Artifacts canonical annotations objects) ->
1103− ROutsideOk name (I.fromModule pkg canonical annotations) objects
1102+ do Reporting.report key Reporting.BDone
1103+ return $ ROutsideOk name (I.fromModule pkg canonical annotations) objects
11041104
11051105 Left errors ->
1106− ROutsideErr $
1107− Error.Module name path time source errors
1106+ return $ ROutsideErr $ Error.Module name path time source errors
11081107
11091108
11101109