Hello community,

here is the log from the commit of package ghc-conduit-extra for 
openSUSE:Factory checked in at 2016-07-12 23:52:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-conduit-extra (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-conduit-extra.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-conduit-extra"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-conduit-extra/ghc-conduit-extra.changes      
2016-04-03 23:07:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-conduit-extra.new/ghc-conduit-extra.changes 
2016-07-12 23:52:47.000000000 +0200
@@ -1,0 +2,6 @@
+Sun Jul 10 15:30:34 UTC 2016 - [email protected]
+
+- update to 1.1.13.2
+* Fix alignment issues on non-X86 archs
+
+-------------------------------------------------------------------

Old:
----
  conduit-extra-1.1.13.1.tar.gz

New:
----
  conduit-extra-1.1.13.2.tar.gz

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

Other differences:
------------------
++++++ ghc-conduit-extra.spec ++++++
--- /var/tmp/diff_new_pack.ITs311/_old  2016-07-12 23:52:48.000000000 +0200
+++ /var/tmp/diff_new_pack.ITs311/_new  2016-07-12 23:52:48.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-conduit-extra
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 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
@@ -21,7 +21,7 @@
 %bcond_with tests
 
 Name:           ghc-conduit-extra
-Version:        1.1.13.1
+Version:        1.1.13.2
 Release:        0
 Summary:        Batteries included conduit: adapters for common libraries
 License:        MIT

++++++ conduit-extra-1.1.13.1.tar.gz -> conduit-extra-1.1.13.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-extra-1.1.13.1/ChangeLog.md 
new/conduit-extra-1.1.13.2/ChangeLog.md
--- old/conduit-extra-1.1.13.1/ChangeLog.md     2016-04-02 19:35:12.000000000 
+0200
+++ new/conduit-extra-1.1.13.2/ChangeLog.md     2016-07-04 08:32:33.000000000 
+0200
@@ -1,3 +1,7 @@
+## 1.1.13.2
+
+* Fix alignment issues on non-X86 archs
+
 ## 1.1.13.1
 
 * Fix an incorrect comment
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-extra-1.1.13.1/Data/Conduit/Binary.hs 
new/conduit-extra-1.1.13.2/Data/Conduit/Binary.hs
--- old/conduit-extra-1.1.13.1/Data/Conduit/Binary.hs   2016-04-02 
19:35:12.000000000 +0200
+++ new/conduit-extra-1.1.13.2/Data/Conduit/Binary.hs   2016-07-04 
08:32:33.000000000 +0200
@@ -76,6 +76,10 @@
 import Control.Monad.Catch (MonadThrow (..))
 import Control.Exception (Exception)
 import Data.Typeable (Typeable)
+import Foreign.Ptr (Ptr)
+#ifndef ALLOW_UNALIGNED_ACCESS
+import Foreign.Marshal (alloca, copyBytes)
+#endif
 
 -- | Stream the contents of a file as binary data.
 --
@@ -501,7 +505,14 @@
 
     -- Given a bytestring of exactly the correct size, grab the value
     process bs = return $! wrap $! inlinePerformIO $!
-        unsafeUseAsCString bs (peek . castPtr)
+        unsafeUseAsCString bs (safePeek undefined . castPtr)
+
+    safePeek :: a -> Ptr a -> IO a
+#ifdef ALLOW_UNALIGNED_ACCESS
+    safePeek _ = peek
+#else
+    safePeek val ptr = alloca (\t -> copyBytes t ptr (sizeOf val) >> peek t)
+#endif
 {-# INLINE sinkStorableHelper #-}
 
 data SinkStorableException = SinkStorableInsufficientBytes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/conduit-extra-1.1.13.1/conduit-extra.cabal 
new/conduit-extra-1.1.13.2/conduit-extra.cabal
--- old/conduit-extra-1.1.13.1/conduit-extra.cabal      2016-04-02 
19:35:12.000000000 +0200
+++ new/conduit-extra-1.1.13.2/conduit-extra.cabal      2016-07-04 
08:32:33.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                conduit-extra
-Version:             1.1.13.1
+Version:             1.1.13.2
 Synopsis:            Batteries included conduit: adapters for common libraries.
 Description:
     The conduit package itself maintains relative small dependencies. The 
purpose of this package is to collect commonly used utility functions wrapping 
other library dependencies, without depending on heavier-weight dependencies. 
The basic idea is that this package should only depend on haskell-platform 
packages and conduit.
@@ -33,6 +33,10 @@
   if !os(windows)
       Exposed-modules: Data.Conduit.Network.Unix
 
+  if arch(x86_64) || arch(i386)
+      -- These architectures are able to perform unaligned memory accesses
+      cpp-options: -DALLOW_UNALIGNED_ACCESS
+
   Build-depends:       base                     >= 4.5          && < 5
                      , conduit                  >= 1.1          && < 1.3
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/conduit-extra-1.1.13.1/test/Data/Conduit/BinarySpec.hs 
new/conduit-extra-1.1.13.2/test/Data/Conduit/BinarySpec.hs
--- old/conduit-extra-1.1.13.1/test/Data/Conduit/BinarySpec.hs  2016-04-02 
19:35:12.000000000 +0200
+++ new/conduit-extra-1.1.13.2/test/Data/Conduit/BinarySpec.hs  2016-07-04 
08:32:33.000000000 +0200
@@ -20,9 +20,11 @@
 import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
 import Test.QuickCheck.Gen (Gen, oneof)
 import Data.Word (Word8)
-import Foreign.Storable (Storable, sizeOf, pokeByteOff)
+import Foreign.Storable (Storable, sizeOf, pokeByteOff, alignment)
 import Data.Typeable (Typeable)
-import Data.ByteString.Internal (unsafeCreate)
+import Data.ByteString.Internal (createAndTrim')
+import Foreign.Ptr (alignPtr, minusPtr)
+import System.IO.Unsafe (unsafePerformIO)
 import Control.Applicative ((<$>), (<*>))
 
 spec :: Spec
@@ -277,19 +279,19 @@
                  -> b
 withSomeStorable (SomeStorable x) f = f x
 
-someStorables :: [SomeStorable] -> S.ByteString
-someStorables stores0 =
-    unsafeCreate size start
+someStorable :: SomeStorable -> S.ByteString
+someStorable store =
+    fst $ unsafePerformIO $ createAndTrim' (size + align) start
   where
-    size = sum $ map (\x -> withSomeStorable x sizeOf) stores0
+    size = withSomeStorable store sizeOf
+    align = withSomeStorable store alignment
+    start ptr = do
+        let off = minusPtr ptr (alignPtr ptr align)
+        withSomeStorable store (pokeByteOff ptr off)
+        return (off, size, ())
 
-    start ptr =
-        go stores0 0
-      where
-        go [] _ = return ()
-        go (x:rest) off = do
-            withSomeStorable x (pokeByteOff ptr off)
-            go rest (off + withSomeStorable x sizeOf)
+someStorables :: [SomeStorable] -> S.ByteString
+someStorables = S.concat . map someStorable
 
 it' :: String -> IO () -> Spec
 it' = it


Reply via email to