[commit: packages/Cabal] ghc-head: Clarify what the arguments of 'mappendSomeSavedFlags' are. (741e712)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:27:02 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=741e7122377756d3ace81ed828b8654b4cb87eb3

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

commit 741e7122377756d3ace81ed828b8654b4cb87eb3
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Sun Jun 9 01:10:14 2013 +0200

    Clarify what the arguments of 'mappendSomeSavedFlags' are.
    
    Also add 'configProgramArgs' and 'configProgramPaths' to the set of
    special-cased flags.


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

741e7122377756d3ace81ed828b8654b4cb87eb3
 cabal-install/Distribution/Client/Sandbox.hs |   43 ++++++++++++++------------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 7296662..18de4c1 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -647,8 +647,9 @@ maybeReinstallAddSourceDeps verbosity numJobsFlag configFlags' globalFlags' = do
 
       -- Actually reinstall the modified add-source deps.
       let config         = pkgEnvSavedConfig pkgEnv
-          configFlags    = mappendSomeSavedFlags configFlags' $
-                           savedConfigureFlags config
+          configFlags    = savedConfigureFlags config
+                           `mappendSomeSavedFlags`
+                           configFlags'
           configExFlags  = defaultConfigExFlags
                            `mappend` savedConfigureExFlags config
           installFlags'  = defaultInstallFlags
@@ -669,24 +670,28 @@ maybeReinstallAddSourceDeps verbosity numJobsFlag configFlags' globalFlags' = do
 
   where
 
-    -- NOTE: we can't simply `mappend` configFlags' because we don't want to
-    -- auto-enable things like 'library-profiling' for all add-source
-    -- dependencies even if the user has passed '--enable-library-profiling' to
-    -- 'cabal configure'. These options are supposed to be set in
-    -- 'cabal.config'.
+    -- NOTE: we can't simply do @sandboxConfigFlags `mappend` savedFlags@
+    -- because we don't want to auto-enable things like 'library-profiling' for
+    -- all add-source dependencies even if the user has passed
+    -- '--enable-library-profiling' to 'cabal configure'. These options are
+    -- supposed to be set in 'cabal.config'.
     mappendSomeSavedFlags :: ConfigFlags -> ConfigFlags -> ConfigFlags
-    mappendSomeSavedFlags savedFlags configFlags =
-      configFlags {
-        configHcFlavor   = configHcFlavor configFlags
-                           `mappend` configHcFlavor savedFlags,
-        configHcPath     = configHcPath configFlags
-                           `mappend` configHcPath savedFlags,
-        configHcPkg      = configHcPkg configFlags
-                           `mappend` configHcPkg savedFlags,
-        -- NOTE: since configPackageDBs is a list instead of a flag, we override
-        -- instead of mappending. We know that the list is not empty since it
-        -- was passed to us from 'configure' (see 'setPackageDB' in 'Main.hs').
-        configPackageDBs = configPackageDBs savedFlags
+    mappendSomeSavedFlags sandboxConfigFlags savedFlags =
+      sandboxConfigFlags {
+        configHcFlavor     = configHcFlavor sandboxConfigFlags
+                             `mappend` configHcFlavor savedFlags,
+        configHcPath       = configHcPath sandboxConfigFlags
+                             `mappend` configHcPath savedFlags,
+        configHcPkg        = configHcPkg sandboxConfigFlags
+                             `mappend` configHcPkg savedFlags,
+        configProgramPaths = configProgramPaths sandboxConfigFlags
+                             `mappend` configProgramPaths savedFlags,
+        configProgramArgs  = configProgramArgs sandboxConfigFlags
+                             `mappend` configProgramArgs savedFlags,
+        -- NOTE: We don't touch the @configPackageDBs@ field because
+        -- @sandboxConfigFlags@ contains the sandbox location which was set when
+        -- creating @cabal.sandbox.config at .
+        -- FIXME: Is this compatible with the 'inherit' feature?
         }
 
 --





More information about the ghc-commits mailing list