[Git][ghc/ghc][wip/toolchain-selection] Add check and log errors on error

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Tue May 30 19:09:55 UTC 2023



Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC


Commits:
0867fd34 by Rodrigo Mesquita at 2023-05-30T20:09:49+01:00
Add check and log errors on error

- - - - -


2 changed files:

- utils/ghc-toolchain/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Monad.hs


Changes:

=====================================
utils/ghc-toolchain/Main.hs
=====================================
@@ -5,6 +5,7 @@ module Main where
 
 import Control.Monad
 import Data.Char (toUpper)
+import Data.Maybe (isNothing)
 import System.Exit
 import System.Console.GetOpt
 import System.Environment
@@ -310,7 +311,8 @@ mkTarget opts = do
     nm <- findNm (optNm opts)
     mergeObjs <- optional $ findMergeObjs (optMergeObjs opts) cc ccLink nm
 
-    -- TODO: Either mergeObjs or -L capable ar
+    when (isNothing mergeObjs && not (arSupportsDashL ar)) $
+      throwE "Neither a merge object tool nor an ar that supports -L is available"
 
     -- Windows-specific utilities
     (windres, dllwrap) <-


=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Monad.hs
=====================================
@@ -63,6 +63,7 @@ data Error = Error { errorMessage :: String
 throwE :: String -> M a
 throwE msg = do
     e <- getEnv
+    logInfo msg
     let err = Error { errorMessage = msg
                     , errorLogContexts = logContexts e
                     }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0867fd34b691ae3dd357bdeb4df956ffe4571162

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0867fd34b691ae3dd357bdeb4df956ffe4571162
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230530/6b68dbdd/attachment-0001.html>


More information about the ghc-commits mailing list