Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-rio-orphans for openSUSE:Factory
checked in at 2021-04-10 15:27:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-rio-orphans (Old)
and /work/SRC/openSUSE:Factory/.ghc-rio-orphans.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-rio-orphans"
Sat Apr 10 15:27:21 2021 rev:5 rq:883524 version:0.1.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-rio-orphans/ghc-rio-orphans.changes
2020-12-22 11:45:37.325822108 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-rio-orphans.new.2401/ghc-rio-orphans.changes
2021-04-10 15:28:24.350451050 +0200
@@ -1,0 +2,8 @@
+Mon Apr 5 14:46:20 UTC 2021 - [email protected]
+
+- Update rio-orphans to version 0.1.2.0.
+ ## 0.1.2.0
+
+ * Add an instance for `MonadLoggerIO` typeclass, from the `monad-logger`
library
+
+-------------------------------------------------------------------
Old:
----
rio-orphans-0.1.1.0.tar.gz
New:
----
rio-orphans-0.1.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-rio-orphans.spec ++++++
--- /var/tmp/diff_new_pack.Q5E88i/_old 2021-04-10 15:28:24.770451544 +0200
+++ /var/tmp/diff_new_pack.Q5E88i/_new 2021-04-10 15:28:24.774451549 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-rio-orphans
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name rio-orphans
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.1.0
+Version: 0.1.2.0
Release: 0
Summary: Orphan instances for the RIO type in the rio package
License: MIT
@@ -34,6 +34,7 @@
BuildRequires: ghc-rio-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-transformers-base-devel
+BuildRequires: ghc-unliftio-core-devel
ExcludeArch: %{ix86}
%if %{with tests}
BuildRequires: ghc-hspec-devel
++++++ rio-orphans-0.1.1.0.tar.gz -> rio-orphans-0.1.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/rio-orphans-0.1.1.0/ChangeLog.md
new/rio-orphans-0.1.2.0/ChangeLog.md
--- old/rio-orphans-0.1.1.0/ChangeLog.md 2018-05-23 14:03:46.000000000
+0200
+++ new/rio-orphans-0.1.2.0/ChangeLog.md 2021-04-03 21:32:33.000000000
+0200
@@ -1,5 +1,9 @@
# Changelog for rio-orphans
+## 0.1.2.0
+
+* Add an instance for `MonadLoggerIO` typeclass, from the `monad-logger`
library
+
## 0.1.1.0
* Add an instance for `MonadLogger` typeclass, from the `monad-logger` library
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/rio-orphans-0.1.1.0/README.md
new/rio-orphans-0.1.2.0/README.md
--- old/rio-orphans-0.1.1.0/README.md 2018-03-18 09:09:39.000000000 +0100
+++ new/rio-orphans-0.1.2.0/README.md 2021-04-03 21:31:45.000000000 +0200
@@ -2,7 +2,8 @@
Provides orphan instances for the `RIO` data type. Currently supports:
-* `MonadCatch` and `MonadMask` from `exceptions`
* `MonadBase` from `transformers-base`
* `MonadBaseControl` from `monad-control`
+* `MonadCatch` and `MonadMask` from `exceptions`
+* `MonadLogger` from `monad-logger`
* `MonadResource` from `resourcet`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/rio-orphans-0.1.1.0/rio-orphans.cabal
new/rio-orphans-0.1.2.0/rio-orphans.cabal
--- old/rio-orphans-0.1.1.0/rio-orphans.cabal 2018-05-24 13:49:43.000000000
+0200
+++ new/rio-orphans-0.1.2.0/rio-orphans.cabal 2021-04-03 21:33:03.000000000
+0200
@@ -1,11 +1,13 @@
--- This file has been generated from package.yaml by hpack version 0.28.2.
+cabal-version: 1.12
+
+-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
--- hash: 77de0e86872a5e0ec50e213804741ac79e8f08b768bec53e0d190ae09cc14b40
+-- hash: 73b0abe6a63aaeca941c08d21e429b2221d75c0121c5d65d2dcd362f0beb6f2e
name: rio-orphans
-version: 0.1.1.0
+version: 0.1.2.0
synopsis: Orphan instances for the RIO type in the rio package
description: See README and Haddocks at
<https://www.stackage.org/package/rio-orphans>
category: Control
@@ -16,10 +18,9 @@
license: MIT
license-file: LICENSE
build-type: Simple
-cabal-version: >= 1.10
extra-source-files:
- ChangeLog.md
README.md
+ ChangeLog.md
source-repository head
type: git
@@ -33,7 +34,7 @@
hs-source-dirs:
src
build-depends:
- base >=4.9 && <10
+ base >=4.10 && <10
, exceptions
, fast-logger
, monad-control
@@ -41,6 +42,7 @@
, resourcet
, rio
, transformers-base
+ , unliftio-core
default-language: Haskell2010
test-suite rio-orphans-test
@@ -53,7 +55,7 @@
test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
- base >=4.9 && <10
+ base >=4.10 && <10
, exceptions
, fast-logger
, hspec
@@ -63,4 +65,5 @@
, rio
, rio-orphans
, transformers-base
+ , unliftio-core
default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/rio-orphans-0.1.1.0/src/RIO/Orphans.hs
new/rio-orphans-0.1.2.0/src/RIO/Orphans.hs
--- old/rio-orphans-0.1.1.0/src/RIO/Orphans.hs 2018-05-24 20:32:56.000000000
+0200
+++ new/rio-orphans-0.1.2.0/src/RIO/Orphans.hs 2021-04-03 21:32:33.000000000
+0200
@@ -16,12 +16,13 @@
import RIO
import Control.Monad.Catch (MonadCatch, MonadMask)
import Control.Monad.Base (MonadBase)
+import Control.Monad.IO.Unlift (askRunInIO)
import Control.Monad.Trans.Resource.Internal (MonadResource (..), ReleaseMap,
ResourceT (..))
import Control.Monad.Trans.Resource (runResourceT)
import Control.Monad.Trans.Control (MonadBaseControl (..))
import qualified Control.Monad.Logger as LegacyLogger
-import Control.Monad.Logger (MonadLogger (..), LogStr)
+import Control.Monad.Logger (MonadLogger (..), MonadLoggerIO (..), LogStr)
import System.Log.FastLogger (fromLogStr)
import qualified GHC.Stack as GS
@@ -48,24 +49,39 @@
-- | @since 0.1.1.0
instance HasLogFunc env => MonadLogger (RIO env) where
monadLoggerLog loc source level msg =
- let ?callStack = GS.fromCallSiteList [("", GS.SrcLoc
- { GS.srcLocPackage = LegacyLogger.loc_package loc
- , GS.srcLocModule = LegacyLogger.loc_module loc
- , GS.srcLocFile = LegacyLogger.loc_filename loc
- , GS.srcLocStartLine = fst $ LegacyLogger.loc_start loc
- , GS.srcLocStartCol = snd $ LegacyLogger.loc_start loc
- , GS.srcLocEndLine = fst $ LegacyLogger.loc_end loc
- , GS.srcLocEndCol = snd $ LegacyLogger.loc_end loc
- })]
- in logGeneric source rioLogLevel (display $ LegacyLogger.toLogStr msg)
- where
- rioLogLevel =
- case level of
- LegacyLogger.LevelDebug -> LevelDebug
- LegacyLogger.LevelInfo -> LevelInfo
- LegacyLogger.LevelWarn -> LevelWarn
- LegacyLogger.LevelError -> LevelError
- LegacyLogger.LevelOther name -> LevelOther name
+ let ?callStack = rioCallStack loc
+ in logGeneric source (rioLogLevel level) (display $
LegacyLogger.toLogStr msg)
+
+-- | Do not let the generated function escape its RIO context. This may lead
+-- to log-related cleanup running /before/ the function is called.
+--
+-- @since 0.1.2.0
+instance HasLogFunc env => MonadLoggerIO (RIO env) where
+ askLoggerIO = do
+ runInIO <- askRunInIO
+ pure $ \loc source level str ->
+ let ?callStack = rioCallStack loc
+ in runInIO (logGeneric source (rioLogLevel level) (display str))
+
+rioLogLevel :: LegacyLogger.LogLevel -> LogLevel
+rioLogLevel level =
+ case level of
+ LegacyLogger.LevelDebug -> LevelDebug
+ LegacyLogger.LevelInfo -> LevelInfo
+ LegacyLogger.LevelWarn -> LevelWarn
+ LegacyLogger.LevelError -> LevelError
+ LegacyLogger.LevelOther name -> LevelOther name
+
+rioCallStack :: LegacyLogger.Loc -> CallStack
+rioCallStack loc = GS.fromCallSiteList [("", GS.SrcLoc
+ { GS.srcLocPackage = LegacyLogger.loc_package loc
+ , GS.srcLocModule = LegacyLogger.loc_module loc
+ , GS.srcLocFile = LegacyLogger.loc_filename loc
+ , GS.srcLocStartLine = fst $ LegacyLogger.loc_start loc
+ , GS.srcLocStartCol = snd $ LegacyLogger.loc_start loc
+ , GS.srcLocEndLine = fst $ LegacyLogger.loc_end loc
+ , GS.srcLocEndCol = snd $ LegacyLogger.loc_end loc
+ })]
-- | A collection of all of the registered resource cleanup actions.
--