[commit: packages/Cabal] ghc-head: Ignore 'ghc-options' when parsing 'ghc --info' output. (7802fa0)

git at git.haskell.org git at git.haskell.org
Thu Aug 29 10:11:58 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=7802fa05a87a3c13f795c2c97669c79bb1967a95

>---------------------------------------------------------------

commit 7802fa05a87a3c13f795c2c97669c79bb1967a95
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Mon Aug 26 08:19:28 2013 +0200

    Ignore 'ghc-options' when parsing 'ghc --info' output.
    
    Fixes #1438.


>---------------------------------------------------------------

7802fa05a87a3c13f795c2c97669c79bb1967a95
 Cabal/Distribution/Simple/GHC.hs |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs
index 7c75bbc..c6c12dd 100644
--- a/Cabal/Distribution/Simple/GHC.hs
+++ b/Cabal/Distribution/Simple/GHC.hs
@@ -101,8 +101,8 @@ import Distribution.Simple.Program
          , ProgramLocation(..), ProgramSearchPath, ProgramSearchPathEntry(..)
          , rawSystemProgram
          , rawSystemProgramStdout, rawSystemProgramStdoutConf
-         , getProgramInvocationOutput
-         , requireProgramVersion, requireProgram, getProgramOutput
+         , getProgramOutput, getProgramInvocationOutput, suppressOverrideArgs
+         , requireProgramVersion, requireProgram
          , userMaybeSpecifyPath, programPath, lookupProgram, addKnownProgram
          , ghcProgram, ghcPkgProgram, hsc2hsProgram
          , arProgram, ranlibProgram, ldProgram
@@ -147,7 +147,8 @@ getGhcInfo verbosity ghcProg =
     case programVersion ghcProg of
     Just ghcVersion
      | ghcVersion >= Version [6,7] [] ->
-        do xs <- getProgramOutput verbosity ghcProg ["--info"]
+        do xs <- getProgramOutput verbosity (suppressOverrideArgs ghcProg)
+                 ["--info"]
            case reads xs of
                [(i, ss)]
                 | all isSpace ss ->
@@ -405,7 +406,7 @@ getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Flag)]
 getExtensions verbosity ghcProg
   | ghcVersion >= Version [6,7] [] = do
 
-    str <- rawSystemStdout verbosity (programPath ghcProg)
+    str <- getProgramOutput verbosity (suppressOverrideArgs ghcProg)
               ["--supported-languages"]
     let extStrs = if ghcVersion >= Version [7] []
                   then lines str





More information about the ghc-commits mailing list