Hello community,

here is the log from the commit of package ghc-cabal-doctest for 
openSUSE:Leap:15.2 checked in at 2020-02-19 18:38:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/ghc-cabal-doctest (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.ghc-cabal-doctest.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-cabal-doctest"

Wed Feb 19 18:38:05 2020 rev:11 rq:771250 version:1.0.8

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/ghc-cabal-doctest/ghc-cabal-doctest.changes    
2020-01-15 15:01:54.601793978 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.ghc-cabal-doctest.new.26092/ghc-cabal-doctest.changes
 2020-02-19 18:38:32.133958710 +0100
@@ -1,0 +2,23 @@
+Fri Nov  8 16:13:22 UTC 2019 - Peter Simons <[email protected]>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------
+Thu Oct  3 02:02:03 UTC 2019 - [email protected]
+
+- Update cabal-doctest to version 1.0.8.
+  Upstream has edited the change log file since the last release in
+  a non-trivial way, i.e. they did more than just add a new entry
+  at the top. You can review the file at:
+  http://hackage.haskell.org/package/cabal-doctest-1.0.8/src/ChangeLog.md
+
+-------------------------------------------------------------------
+Tue Aug 27 02:02:00 UTC 2019 - [email protected]
+
+- Update cabal-doctest to version 1.0.7.
+  # 1.0.7 -- 2019-??-??
+
+  * Make `Distribution.Extra.Doctest` `-Wall`-clean
+  * Support GHC-8.8, base-4.13, and Cabal-3.0
+
+-------------------------------------------------------------------

Old:
----
  cabal-doctest-1.0.6.tar.gz
  cabal-doctest.cabal

New:
----
  cabal-doctest-1.0.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-cabal-doctest.spec ++++++
--- /var/tmp/diff_new_pack.hHsYzc/_old  2020-02-19 18:38:32.453959380 +0100
+++ /var/tmp/diff_new_pack.hHsYzc/_new  2020-02-19 18:38:32.453959380 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-cabal-doctest
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,14 +18,12 @@
 
 %global pkg_name cabal-doctest
 Name:           ghc-%{pkg_name}
-Version:        1.0.6
+Version:        1.0.8
 Release:        0
 Summary:        A Setup.hs helper for doctests running
 License:        BSD-3-Clause
-Group:          Development/Libraries/Haskell
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-directory-devel
 BuildRequires:  ghc-filepath-devel
@@ -40,7 +38,6 @@
 
 %package devel
 Summary:        Haskell %{pkg_name} library development files
-Group:          Development/Libraries/Haskell
 Requires:       %{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
@@ -51,7 +48,6 @@
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ cabal-doctest-1.0.6.tar.gz -> cabal-doctest-1.0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-doctest-1.0.6/ChangeLog.md 
new/cabal-doctest-1.0.8/ChangeLog.md
--- old/cabal-doctest-1.0.6/ChangeLog.md        2018-01-28 16:56:55.000000000 
+0100
+++ new/cabal-doctest-1.0.8/ChangeLog.md        2001-09-09 03:46:40.000000000 
+0200
@@ -1,3 +1,13 @@
+# 1.0.8 -- 2019-10-02
+
+* Pass `-package-env=-` when compiler supports it
+* Amend examples to `unsetEnv "GHC_ENVIRONMENT"`
+
+# 1.0.7 -- 2019-08-26
+
+* Make `Distribution.Extra.Doctest` `-Wall`-clean
+* Support GHC-8.8, base-4.13, and Cabal-3.0
+
 # 1.0.6 -- 2018-01-28
 
 * Hook `haddock` build too. Fixes issue when `haddock` fails, as
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-doctest-1.0.6/README.md 
new/cabal-doctest-1.0.8/README.md
--- old/cabal-doctest-1.0.6/README.md   2018-01-28 16:56:55.000000000 +0100
+++ new/cabal-doctest-1.0.8/README.md   2001-09-09 03:46:40.000000000 +0200
@@ -49,16 +49,24 @@
 
 import Build_doctests (flags, pkgs, module_sources)
 import Data.Foldable (traverse_)
+import System.Environment.Compat (unsetEnv)
 import Test.DocTest (doctest)
 
 main :: IO ()
 main = do
     traverse_ putStrLn args -- optionally print arguments
+    unsetEnv "GHC_ENVIRONMENT" -- see 'Notes'; you may not need this
     doctest args
   where
     args = flags ++ pkgs ++ module_sources
 ```
 
+(The `System.Environment.Compat` module is from the `base-compat`
+package. That's already in the transitive closure of `doctest`'s
+dependencies. `System.Environment.unsetEnv` was added with GHC 7.8 so,
+if you don't need to support versions of GHC older than 7.8, you can
+use `System.Environment` from `base` instead.)
+
 Example with multiple .cabal components
 ---------------------------------------
 
@@ -86,6 +94,7 @@
 
 import Build_doctests (Component (..), components)
 import Data.Foldable (for_)
+import System.Environment.Compat (unsetEnv)
 import Test.DocTest (doctest)
 
 main :: IO ()
@@ -94,6 +103,7 @@
     putStrLn "----------------------------------------"
     let args = flags ++ pkgs ++ sources
     for_ args putStrLn
+    unsetEnv "GHC_ENVIRONMENT"
     doctest args
 ```
 
@@ -114,10 +124,12 @@
        (flags,            pkgs,            module_sources,
         flags_exe_my_exe, pkgs_exe_my_exe, module_sources_exe_my_exe)
 import Data.Foldable (traverse_)
+import System.Environment.Compat (unsetEnv)
 import Test.DocTest
 
 main :: IO ()
 main = do
+    unsetEnv "GHC_ENVRIONMENT"
     -- doctests for library
     traverse_ putStrLn libArgs
     doctest libArgs
@@ -192,7 +204,7 @@
   `defaultMainAutoconfWithDoctests` function to make custom `Setup.hs` script.
 
 * If you use the default `.` in `hs-source-dirs`, then running `doctests`
-  might fail with weird errors (ambigious module errors). Workaround is
+  might fail with weird errors (ambiguous module errors). Workaround is
   to move sources under `src/` or some non-top-level directory.
 
 * `extensions:` field isn't supported. Upgrade your `.cabal` file to use at 
least
@@ -221,6 +233,20 @@
         :: Language.Haskell.TH.Syntax.Name -> Language.Haskell.TH.Lib.ExpQ
 ```
 
+* From version 2, Stack sets the `GHC_ENVRIONMENT` variable, and GHC
+  (as invoked by `doctest`) will pick that up. This is undesirable:
+  `cabal-doctest` passes all the necessary information on the command
+  line already, and can lead to ambiguous module errors as GHC will
+  load the environment in addition to what `cabal-doctest` instructs
+  it to.
+
+  Hence, `cabal-doctest` tells GHC to ignore package environments
+  altogether on the command line. However, this is only possible since
+  GHC 8.2. If you are using `cabal-doctest` with Stack 2 and GHC 8.0
+  or earlier and seeing ambiguous module errors or other mysterious
+  failures, try manually unsetting `GHC_ENVIRONMENT` before invoking
+  `doctest`.
+
 Copyright
 ---------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-doctest-1.0.6/cabal-doctest.cabal 
new/cabal-doctest-1.0.8/cabal-doctest.cabal
--- old/cabal-doctest-1.0.6/cabal-doctest.cabal 2018-01-28 16:56:55.000000000 
+0100
+++ new/cabal-doctest-1.0.8/cabal-doctest.cabal 2001-09-09 03:46:40.000000000 
+0200
@@ -1,46 +1,46 @@
-name:                cabal-doctest
-version:             1.0.6
-synopsis:            A Setup.hs helper for doctests running
+name:               cabal-doctest
+version:            1.0.8
+synopsis:           A Setup.hs helper for doctests running
 description:
   Currently (beginning of 2017), there isn't @cabal doctest@
   command. Yet, to properly work doctest needs plenty of configuration.
   This library provides the common bits for writing custom Setup.hs
-
   See <https://github.com/haskell/cabal/issues/2327 Cabal/2327> for the 
progress
   of @cabal doctest@, i.e. whether this library is obsolete.
 
-homepage:            https://github.com/phadej/cabal-doctest
-license:             BSD3
-license-file:        LICENSE
-author:              Oleg Grenrus <[email protected]>
-maintainer:          Oleg Grenrus <[email protected]>
-copyright:           (c) 2017 Oleg Grenrus
-category:            Distribution
-build-type:          Simple
-cabal-version:       >=1.10
-extra-source-files:  ChangeLog.md README.md
-tested-with:
-  GHC==7.0.4,
-  GHC==7.2.2,
-  GHC==7.4.2,
-  GHC==7.6.3,
-  GHC==7.8.4,
-  GHC==7.10.3,
-  GHC==8.0.2,
-  GHC==8.2.2
+homepage:           https://github.com/phadej/cabal-doctest
+license:            BSD3
+license-file:       LICENSE
+author:             Oleg Grenrus <[email protected]>
+maintainer:         Oleg Grenrus <[email protected]>
+copyright:          (c) 2017 Oleg Grenrus
+category:           Distribution
+build-type:         Simple
+cabal-version:      >=1.10
+extra-source-files:
+  ChangeLog.md
+  README.md
+
+tested-with:        GHC ==8.8.1 || >=7.4 && <8.8 || ==7.2.2 || ==7.0.4
 
 source-repository head
   type:     git
   location: https://github.com/phadej/cabal-doctest
 
 library
-  exposed-modules:     Distribution.Extra.Doctest
+  exposed-modules:  Distribution.Extra.Doctest
   other-modules:
   other-extensions:
   build-depends:
-    base >=4.3 && <4.11,
-    Cabal >= 1.10 && <2.1,
-    filepath,
-    directory
-  hs-source-dirs:      src
-  default-language:    Haskell2010
+      base       >=4.3  && <4.14
+    , Cabal      >=1.10 && <3.1
+    , directory
+    , filepath
+
+  hs-source-dirs:   src
+  default-language: Haskell2010
+  ghc-options:      -Wall
+
+  if !impl(ghc >=7.2)
+    -- Work around a pattern-match coverage checking bug in GHC 7.0
+    ghc-options: -fno-warn-overlapping-patterns
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/cabal-doctest-1.0.6/src/Distribution/Extra/Doctest.hs 
new/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs
--- old/cabal-doctest-1.0.6/src/Distribution/Extra/Doctest.hs   2018-01-28 
16:56:55.000000000 +0100
+++ new/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs   2001-09-09 
03:46:40.000000000 +0200
@@ -46,51 +46,51 @@
 
 import Control.Monad
        (when)
+import Data.IORef
+       (modifyIORef, newIORef, readIORef)
 import Data.List
        (nub)
 import Data.Maybe
-       (maybeToList, mapMaybe)
+       (mapMaybe, maybeToList)
 import Data.String
        (fromString)
-import qualified Data.Foldable as F
-       (for_)
-import qualified Data.Traversable as T
-       (traverse)
-import qualified Distribution.ModuleName as ModuleName
-       (fromString)
-import Distribution.ModuleName
-       (ModuleName)
 import Distribution.Package
-       (InstalledPackageId)
-import Distribution.Package
-       (Package (..), PackageId, packageVersion)
+       (InstalledPackageId, Package (..))
 import Distribution.PackageDescription
-       (BuildInfo (..), Executable (..), Library (..), 
GenericPackageDescription,
-       PackageDescription (), TestSuite (..))
+       (BuildInfo (..), Executable (..), GenericPackageDescription,
+       Library (..), PackageDescription, TestSuite (..))
 import Distribution.Simple
-       (UserHooks (..), autoconfUserHooks, defaultMainWithHooks, 
simpleUserHooks)
-import Distribution.Simple.BuildPaths
-       (autogenModulesDir)
+       (UserHooks (..), autoconfUserHooks, defaultMainWithHooks,
+       simpleUserHooks)
 import Distribution.Simple.Compiler
-       (PackageDB (..), showCompilerId)
+       (CompilerFlavor (GHC), CompilerId (..), PackageDB (..), compilerId)
 import Distribution.Simple.LocalBuildInfo
-       (ComponentLocalBuildInfo (componentPackageDeps), LocalBuildInfo (),
+       (ComponentLocalBuildInfo (componentPackageDeps), LocalBuildInfo,
        compiler, withExeLBI, withLibLBI, withPackageDB, withTestLBI)
 import Distribution.Simple.Setup
-       (BuildFlags (buildDistPref, buildVerbosity), HaddockFlags 
(haddockDistPref, haddockVerbosity), fromFlag, emptyBuildFlags)
+       (BuildFlags (buildDistPref, buildVerbosity),
+       HaddockFlags (haddockDistPref, haddockVerbosity), emptyBuildFlags,
+       fromFlag)
 import Distribution.Simple.Utils
-       (createDirectoryIfMissingVerbose, findFile, rewriteFile)
+       (createDirectoryIfMissingVerbose, info)
 import Distribution.Text
-       (display, simpleParse)
+       (display)
 import System.FilePath
-       ((</>), (<.>), dropExtension)
+       ((</>))
 
-import Data.IORef (newIORef, modifyIORef, readIORef)
+import qualified Data.Foldable    as F
+                 (for_)
+import qualified Data.Traversable as T
+                 (traverse)
 
 #if MIN_VERSION_Cabal(1,25,0)
 import Distribution.Simple.BuildPaths
        (autogenComponentModulesDir)
+#else
+import Distribution.Simple.BuildPaths
+       (autogenModulesDir)
 #endif
+
 #if MIN_VERSION_Cabal(2,0,0)
 import Distribution.Types.MungedPackageId
        (MungedPackageId)
@@ -98,10 +98,31 @@
        (unUnqualComponentName)
 
 -- For amendGPD
-import Distribution.Types.GenericPackageDescription
-       (GenericPackageDescription (condTestSuites))
 import Distribution.PackageDescription
        (CondTree (..))
+import Distribution.Types.GenericPackageDescription
+       (GenericPackageDescription (condTestSuites))
+
+import Distribution.Version
+       (mkVersion)
+#else
+import Data.Version
+       (Version (..))
+import Distribution.Package
+       (PackageId)
+#endif
+
+#if MIN_VERSION_Cabal(3,0,0)
+import Distribution.Simple.Utils
+       (findFileEx)
+#else
+import Distribution.Simple.Utils
+       (findFile)
+#endif
+
+#if MIN_VERSION_Cabal(3,0,0)
+import Distribution.Types.LibraryName
+       (libraryNameString)
 #endif
 
 #if MIN_VERSION_directory(1,2,2)
@@ -120,6 +141,20 @@
     return $ cwd </> p
 #endif
 
+#if !MIN_VERSION_Cabal(3,0,0)
+findFileEx :: verbosity -> [FilePath] -> FilePath -> IO FilePath
+findFileEx _ = findFile
+#endif
+
+#if !MIN_VERSION_Cabal(2,0,0)
+mkVersion :: [Int] -> Version
+mkVersion ds = Version ds []
+#endif
+
+-------------------------------------------------------------------------------
+-- Mains
+-------------------------------------------------------------------------------
+
 -- | A default main with doctests:
 --
 -- @
@@ -216,9 +251,12 @@
   let verbosity = fromFlag (buildVerbosity flags)
   let distPref = fromFlag (buildDistPref flags)
 
-  -- Package DBs
+  -- Package DBs & environments
   let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> 
"package.conf.inplace" ]
   let dbFlags = "-hide-all-packages" : packageDbArgs dbStack
+  let envFlags
+        | ghcCanBeToldToIgnorePkgEnvs = [ "-package-env=-" ]
+        | otherwise = []
 
   withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString 
testSuiteName) $ do
 #if MIN_VERSION_Cabal(1,25,0)
@@ -233,6 +271,7 @@
 
     -- First, we create the autogen'd module Build_doctests.
     -- Initially populate Build_doctests with a simple preamble.
+    info verbosity $ "cabal-doctest: writing Build_doctests to " ++ 
buildDoctestsFile
     writeFile buildDoctestsFile $ unlines
       [ "module Build_doctests where"
       , ""
@@ -306,7 +345,7 @@
            -- even though the main-is module is named Main, its filepath might
            -- actually be Something.hs. To account for this possibility, we 
simply
            -- pass the full path to the main-is module instead.
-           mainIsPath <- T.traverse (findFile iArgsNoPrefix) (compMainIs comp)
+           mainIsPath <- T.traverse (findFileEx verbosity iArgsNoPrefix) 
(compMainIs comp)
 
            let all_sources = map display module_sources
                              ++ additionalModules
@@ -319,6 +358,7 @@
                   [ iArgs
                   , additionalDirs
                   , includeArgs
+                  , envFlags
                   , dbFlags
                   , cppFlags
                   , extensionArgs
@@ -334,8 +374,8 @@
     getBuildDoctests withExeLBI (NameExe . executableName) (const [])     
(Just . modulePath) buildInfo
 
     components <- readIORef componentsRef
-    F.for_ components $ \(Component name pkgs flags sources) -> do
-       let compSuffix          = nameToString name
+    F.for_ components $ \(Component cmpName cmpPkgs cmpFlags cmpSources) -> do
+       let compSuffix          = nameToString cmpName
            pkgs_comp           = "pkgs"           ++ compSuffix
            flags_comp          = "flags"          ++ compSuffix
            module_sources_comp = "module_sources" ++ compSuffix
@@ -344,13 +384,13 @@
        appendFile buildDoctestsFile $ unlines
          [ -- -package-id etc. flags
            pkgs_comp ++ " :: [String]"
-         , pkgs_comp ++ " = " ++ show pkgs
+         , pkgs_comp ++ " = " ++ show cmpPkgs
          , ""
          , flags_comp ++ " :: [String]"
-         , flags_comp ++ " = " ++ show flags
+         , flags_comp ++ " = " ++ show cmpFlags
          , ""
          , module_sources_comp ++ " :: [String]"
-         , module_sources_comp ++ " = " ++ show sources
+         , module_sources_comp ++ " = " ++ show cmpSources
          , ""
          ]
 
@@ -376,10 +416,14 @@
     parseComponentName _ = Nothing
 
     -- we do this check in Setup, as then doctests don't need to depend on 
Cabal
-    isOldCompiler = maybe False id $ do
-      a <- simpleParse $ showCompilerId $ compiler lbi
-      b <- simpleParse "7.5"
-      return $ packageVersion (a :: PackageId) < b
+    isNewCompiler = case compilerId $ compiler lbi of
+      CompilerId GHC v -> v >= mkVersion [7,6]
+      _                -> False
+
+    ghcCanBeToldToIgnorePkgEnvs :: Bool
+    ghcCanBeToldToIgnorePkgEnvs = case compilerId $ compiler lbi of
+      CompilerId GHC v -> v >= mkVersion [8,4,4]
+      _                -> False
 
     formatDeps = map formatOne
     formatOne (installedPkgId, pkgId)
@@ -396,8 +440,8 @@
 
     -- From Distribution.Simple.Program.GHC
     packageDbArgs :: [PackageDB] -> [String]
-    packageDbArgs | isOldCompiler = packageDbArgsConf
-                  | otherwise     = packageDbArgsDb
+    packageDbArgs | isNewCompiler = packageDbArgsDb
+                  | otherwise     = packageDbArgsConf
 
     -- GHC <7.6 uses '-package-conf' instead of '-package-db'.
     packageDbArgsConf :: [PackageDB] -> [String]
@@ -432,7 +476,9 @@
        isSpecific _                     = False
 
     mbLibraryName :: Library -> Name
-#if MIN_VERSION_Cabal(2,0,0)
+#if MIN_VERSION_Cabal(3,0,0)
+    mbLibraryName = NameLib . fmap unUnqualComponentName . libraryNameString . 
libName
+#elif MIN_VERSION_Cabal(2,0,0)
     -- Cabal-2.0 introduced internal libraries, which are named.
     mbLibraryName = NameLib . fmap unUnqualComponentName . libName
 #else
@@ -462,7 +508,7 @@
     -> GenericPackageDescription
     -> GenericPackageDescription
 #if !(MIN_VERSION_Cabal(2,0,0))
-amendGPD _ = id
+amendGPD _ gpd = gpd
 #else
 amendGPD testSuiteName gpd = gpd
     { condTestSuites = map f (condTestSuites gpd)


Reply via email to