[commit: ghc] master: Document the perplexing reversed nature of extraPkgConfs and friends. (40b65db)

git at git.haskell.org git at git.haskell.org
Tue Mar 21 01:18:22 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/40b65db4cd34c3566b9f6c53c086d53e97574217/ghc

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

commit 40b65db4cd34c3566b9f6c53c086d53e97574217
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sun Mar 19 16:06:55 2017 -0700

    Document the perplexing reversed nature of extraPkgConfs and friends.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

40b65db4cd34c3566b9f6c53c086d53e97574217
 compiler/main/DynFlags.hs | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index f80f9a7..057c2c0 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -805,16 +805,26 @@ data DynFlags = DynFlags {
   --  Package flags
   extraPkgConfs         :: [PkgConfRef] -> [PkgConfRef],
         -- ^ The @-package-db@ flags given on the command line, in the order
-        -- they appeared.
+        -- they appeared.  In *reverse* order that they're specified
+        -- on the command line.  This is intended to be applied with the
+        -- list of "initial" package databases derived from @GHC_PACKAGE_PATH@;
+        -- see 'getPackageConfRefs'; this is a function because 'extraPkgConfs'
+        -- maybe configured to filter out certain flags from *either* the
+        -- user command line, or the base command; see for example
+        -- 'removeUserPkgConf'.
 
   ignorePackageFlags    :: [IgnorePackageFlag],
-        -- ^ The @-ignore-package@ flags from the command line
+        -- ^ The @-ignore-package@ flags from the command line.
+        -- In *reverse* order that they're specified on the command line.
   packageFlags          :: [PackageFlag],
-        -- ^ The @-package@ and @-hide-package@ flags from the command-line
+        -- ^ The @-package@ and @-hide-package@ flags from the command-line.
+        -- In *reverse* order that they're specified on the command line.
   pluginPackageFlags    :: [PackageFlag],
-        -- ^ The @-plugin-package-id@ flags from command line
+        -- ^ The @-plugin-package-id@ flags from command line.
+        -- In *reverse* order that they're specified on the command line.
   trustFlags            :: [TrustFlag],
-        -- ^ The @-trust@ and @-distrust@ flags
+        -- ^ The @-trust@ and @-distrust@ flags.
+        -- In *reverse* order that they're specified on the command line.
   packageEnv            :: Maybe FilePath,
         -- ^ Filepath to the package environment file (if overriding default)
 



More information about the ghc-commits mailing list