Skip to content

Commit

Permalink
Make clear messages come from mcabal
Browse files Browse the repository at this point in the history
  • Loading branch information
augustss committed Nov 19, 2024
1 parent d67830b commit 4c74229
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/MicroCabal/Backend/MHS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ mhsBuildExe env _ (Section _ name flds) = do
let args = unwords $ stdArgs ++
["-a."
,"-o" ++ bin, mainIs']
when (verbose env >= 0) $
putStrLn $ "Build " ++ bin ++ " with mhs"
--putStrLn $ "mhs " ++ args
message env 0 $ "Build " ++ bin ++ " with mhs"
mhs env args

mhs :: Env -> String -> IO ()
Expand Down Expand Up @@ -164,8 +162,8 @@ mhsBuildLib env (Section _ _ glob) (Section _ name flds) = do
pkgmdls <- words . unlines . filter isMdl . lines <$> mhsOut env ("-L" ++ pkgfn)
let bad = pkgmdls \\ (mdls ++ omdls)
when (not (null bad)) $ do
putStrLn "Warning: package modules not mentioned in exposed-modules nor other-modules"
mapM_ putStrLn bad
message env (-1) "Warning: package modules not mentioned in exposed-modules nor other-modules"
mapM_ (message env (-1)) bad

mhsInstallExe :: Env -> Section -> Section -> IO ()
mhsInstallExe env (Section _ _ _glob) (Section _ name _) = do
Expand Down
2 changes: 1 addition & 1 deletion src/MicroCabal/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ backendNameVers :: Backend -> (String, Version)
backendNameVers b = (compilerName b, compilerVersion b)

message :: Env -> Int -> String -> IO ()
message env level msg | verbose env >= level = putStrLn $ replicate (2 * depth env) ' ' ++ msg
message env level msg | verbose env >= level = putStrLn $ "mcabal: " ++ replicate (2 * depth env) ' ' ++ msg
| otherwise = return ()

pathModuleDir :: Env -> FilePath
Expand Down

0 comments on commit 4c74229

Please sign in to comment.