summaryrefslogtreecommitdiff
path: root/dev-haskell/chaselev-deque
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-30 09:09:34 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-30 09:09:34 +0100
commitad0412d0cafb8c04ce98024155cf99a4cc27db44 (patch)
treec34688ab389c18775a322de6cd4cfd957cbe8014 /dev-haskell/chaselev-deque
parentcdb747b791914a30c287a3a8e33d1b635e431707 (diff)
gentoo auto-resync : 30:07:2022 - 09:09:33
Diffstat (limited to 'dev-haskell/chaselev-deque')
-rw-r--r--dev-haskell/chaselev-deque/Manifest3
-rw-r--r--dev-haskell/chaselev-deque/chaselev-deque-0.5.0.5.ebuild6
-rw-r--r--dev-haskell/chaselev-deque/files/bd458b66e1b28c249628e282ff42e8468646c557.patch281
3 files changed, 287 insertions, 3 deletions
diff --git a/dev-haskell/chaselev-deque/Manifest b/dev-haskell/chaselev-deque/Manifest
index 7ebf828cd43e..417fb85c58e7 100644
--- a/dev-haskell/chaselev-deque/Manifest
+++ b/dev-haskell/chaselev-deque/Manifest
@@ -1,3 +1,4 @@
+AUX bd458b66e1b28c249628e282ff42e8468646c557.patch 9457 BLAKE2B 2aae3ec4feb1c421152efb7f27f692ae964b5e2c72287b3852e47eb32afda190a9d2256684dd7f357346841a24ecf784a9c21d8e6fd57294a58c5a457c06b558 SHA512 4c94292ceffd1496e79d96c8019d552cb1cb836fe0852c43f60d267d65ef1c9d0a4ff65181aaae3d54e258d7844b2d8674633e54e677af560c65f024762df0cd
DIST chaselev-deque-0.5.0.5.tar.gz 12451 BLAKE2B 79ee460eb84286bbbe0dcd58431d5ab0b7aef1d0d186c2c919b566c6b169ab4069917a61e8bb800af3857c7e3cca09c6f698c6f9a6b5d8efdbdd5902a7042310 SHA512 1561208ec92d7765b126684677cab02ee71bd1f7d2cdc6f2acac065972c241d085a538e14f51c87555f464aadbac2795c64f9063075acdf29217fb2d70a47dfd
-EBUILD chaselev-deque-0.5.0.5.ebuild 984 BLAKE2B 8202a3aaf229d49d99da2a648481d75446ac09803c100c55877b03b1bad20954d94b85a7f70bf4166763eeb57bb6e9424050377341db7ba9b2121e182168f7ba SHA512 b327c20c82ad3096dd4e2feb52b51d04af2ffd07ff751e589eedd9721de3ac89815fae031aed980b0661b9266f6fa46dc910171b608688ce4ae77df274d5fe0d
+EBUILD chaselev-deque-0.5.0.5.ebuild 1065 BLAKE2B 5fe6c9ab48417fb79efef6351486574c4d5c00d957ae86472a9b280020166a367fa2bee08ea3af5ad28ae9a3f876f935c74191a580bf63bc122d41a322d3fb9b SHA512 2d3cdec87e33e9ee5fedf7a1a7262893de6b7cb7726a4c5d988fd7fa0c99b0b77a02fddd7125c7cc2f29d65ce0e362f42da28396469f8583fa19efaa46cfec68
MISC metadata.xml 657 BLAKE2B 7acba95edb6e6574d0ee2ab578e355096b2945dc59fffb8544275e09425b4508fe3dc5feff107bf86258f0e65b2efe11aa0c18413b33428cac1121d6fe0f7df9 SHA512 96e06d5b5bd8f96066c5ecb8c0259019e7a0ed32ea345ae3f229e88a6ea13f58f7b1994deba482448f0d94b6e4a60f3faf70a360541b84263247c42f46083626
diff --git a/dev-haskell/chaselev-deque/chaselev-deque-0.5.0.5.ebuild b/dev-haskell/chaselev-deque/chaselev-deque-0.5.0.5.ebuild
index 6d2416322a90..5777bebfaf85 100644
--- a/dev-haskell/chaselev-deque/chaselev-deque-0.5.0.5.ebuild
+++ b/dev-haskell/chaselev-deque/chaselev-deque-0.5.0.5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -14,9 +14,11 @@ SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0/${PV}"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~ppc64 ~x86"
IUSE="debug"
+PATCHES=( "${FILESDIR}/bd458b66e1b28c249628e282ff42e8468646c557.patch" )
+
RDEPEND=">=dev-haskell/abstract-deque-0.3:=[profile?] <dev-haskell/abstract-deque-0.4:=[profile?]
>=dev-haskell/atomic-primops-0.5.0.2:=[profile?]
dev-haskell/vector:=[profile?]
diff --git a/dev-haskell/chaselev-deque/files/bd458b66e1b28c249628e282ff42e8468646c557.patch b/dev-haskell/chaselev-deque/files/bd458b66e1b28c249628e282ff42e8468646c557.patch
new file mode 100644
index 000000000000..25b2b732f5dd
--- /dev/null
+++ b/dev-haskell/chaselev-deque/files/bd458b66e1b28c249628e282ff42e8468646c557.patch
@@ -0,0 +1,281 @@
+From bd458b66e1b28c249628e282ff42e8468646c557 Mon Sep 17 00:00:00 2001
+From: Ryan Scott <ryan.gl.scott@gmail.com>
+Date: Mon, 24 Feb 2020 10:22:38 -0500
+Subject: [PATCH] Import unsafeCoerce# from GHC.Exts, not GHC.Prim
+
+`atomic-primops` and `chaselev-deque` fail to build on GHC HEAD
+(8.11) since `unsafeCoerce#` can no longer be imported from
+`GHC.Prim` (see
+https://gitlab.haskell.org/ghc/ghc/commit/74ad75e87317196c600dfabc61aee1b87d95c214).
+Luckily, `GHC.Exts` provides a backwards-compatible way to import
+`unsafeCoerce#`, so we can simply import it from there instead.
+
+diff --git a/CHANGELOG.md a/CHANGELOG.md
+new file mode 100644
+index 0000000..c0a4b4b
+--- /dev/null
++++ a/CHANGELOG.md
+@@ -0,0 +1,25 @@
++## next [????.??.??]
++* Allow building with `base-4.15`.
++
++## 0.5.0.4
++* bugfix
++
++## 0.5.0.3
++* minor bump to change abstract-deque dep.
++
++## 0.5.0.2
++* bump to go along with MAJOR bugfix in atomic-primops 0.5.0.2
++
++## 0.4
++* bump to go along with atomic-primops 0.4
++
++## 0.3
++* bump to go along with atomic-primops 0.3
++
++## 0.1.3
++* small release to fix version deps before atomic-primops api change
++
++## 0.1.2
++
++## 0.1.1
++* bump for fixing bugs! First release candidate.
+diff --git a/Data/Concurrent/Deque/ChaseLev.hs a/Data/Concurrent/Deque/ChaseLev.hs
+index 7ec2ff0..baf0843 100644
+--- a/Data/Concurrent/Deque/ChaseLev.hs
++++ a/Data/Concurrent/Deque/ChaseLev.hs
+@@ -39,8 +39,7 @@ import Data.Atomics.Counter
+ import System.IO.Unsafe (unsafePerformIO)
+ import Text.Printf (printf)
+ import System.Mem.StableName (makeStableName, hashStableName)
+-import GHC.Exts (Int(I#))
+-import GHC.Prim (reallyUnsafePtrEquality#, unsafeCoerce#)
++import GHC.Exts (Int(I#), reallyUnsafePtrEquality#, unsafeCoerce#)
+
+ --------------------------------------------------------------------------------
+ -- Instances
+diff --git a/Data/Concurrent/Deque/ChaseLevUnboxed.hs a/Data/Concurrent/Deque/ChaseLevUnboxed.hs
+index 2817f7a..e1d2fe5 100644
+--- a/Data/Concurrent/Deque/ChaseLevUnboxed.hs
++++ a/Data/Concurrent/Deque/ChaseLevUnboxed.hs
+@@ -3,7 +3,7 @@
+ -- TEMPORARY: An experiment in duplicating ChaseLev.hs to support unboxed queue contents.
+
+ -- | Chase-Lev work stealing Deques
+---
++--
+ -- This implementation derives directly from the pseudocode in the 2005 SPAA paper:
+ --
+ -- http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1097&rep=rep1&type=pdf
+@@ -15,7 +15,7 @@ module Data.Concurrent.Deque.ChaseLevUnboxed
+ -- The convention here is to directly provide the concrete
+ -- operations as well as providing the class instances.
+ ChaseLevDeque(), newQ, nullQ, pushL, tryPopL, tryPopR,
+- approxSize,
++ approxSize,
+ dbgInspectCLD
+ )
+ where
+@@ -41,14 +41,13 @@ import Data.Atomics.Counter
+ import System.IO.Unsafe (unsafePerformIO)
+ import Text.Printf (printf)
+ import System.Mem.StableName (makeStableName, hashStableName)
+-import GHC.Exts (Int(I#))
+-import GHC.Prim (reallyUnsafePtrEquality#, unsafeCoerce#)
++import GHC.Exts (Int(I#), reallyUnsafePtrEquality#, unsafeCoerce#)
+
+ --------------------------------------------------------------------------------
+ -- Instances
+
+ {-
+-instance PC.DequeClass ChaseLevDeque where
++instance PC.DequeClass ChaseLevDeque where
+ newQ = newQ
+ nullQ = nullQ
+ pushL = pushL
+@@ -57,7 +56,7 @@ instance PC.DequeClass ChaseLevDeque where
+ leftThreadSafe _ = False
+ rightThreadSafe _ = True
+
+-instance PC.PopL ChaseLevDeque where
++instance PC.PopL ChaseLevDeque where
+ tryPopL = tryPopL
+ -}
+
+@@ -93,7 +92,7 @@ dbgInspectCLD CLD{top,bottom,activeArr} = do
+ | isInfixOf "uninitialised element" (show e) -> return "<uninit>"
+ | otherwise -> return$ "<"++ show e ++">"
+ Right val' -> return (show val')
+-
++
+
+
+ --------------------------------------------------------------------------------
+@@ -108,7 +107,7 @@ dbgInspectCLD CLD{top,bottom,activeArr} = do
+ {-# INLINE slc #-}
+ #ifndef DEBUGCL
+ dbg = False
+-nu a = MV.unsafeNew a
++nu a = MV.unsafeNew a
+ rd a b = MV.unsafeRead a b
+ wr a b c = MV.unsafeWrite a b c
+ slc a b c = MV.unsafeSlice a b c
+@@ -116,13 +115,13 @@ cpy a b = MV.unsafeCopy a b
+ #else
+ #warning "Activating DEBUGCL!"
+ dbg = True
+-nu a = MV.new a
++nu a = MV.new a
+ rd a b = MV.read a b
+ wr a b c = MV.write a b c
+ slc a b c = MV.slice a b c
+ cpy a b = MV.copy a b
+ -- Temp, debugging: Our own bounds checking, better error:
+--- wr v i x =
++-- wr v i x =
+ -- if i >= MV.length v
+ -- then error (printf "ERROR: Out of bounds of top of vector index %d, vec length %d\n" i (MV.length v))
+ -- else MV.write v i x
+@@ -131,8 +130,8 @@ cpy a b = MV.copy a b
+
+ #ifdef DEBUGCL
+ -- This simply localizes exceptions better:
+-tryit msg action = Control.Exception.catch action
+- (\e -> do putStrLn$ "ERROR inside "++msg++" "++ show e
++tryit msg action = Control.Exception.catch action
++ (\e -> do putStrLn$ "ERROR inside "++msg++" "++ show e
+ throw (e::SomeException))
+ #else
+ {-# INLINE tryit #-}
+@@ -145,9 +144,9 @@ tryit msg action = action
+
+ -- TODO: make a "grow" that uses memcpy.
+ growCirc :: V.Unbox a => Int -> Int -> MV.IOVector a -> IO (MV.IOVector a)
+-growCirc !strt !end !oldarr = do
++growCirc !strt !end !oldarr = do
+ -- let len = MV.length oldarr
+- -- strtmod = strt`mod` len
++ -- strtmod = strt`mod` len
+ -- endmod = end `mod` len
+ -- newarr <- nu (len + len)
+ -- if endmod < strtmod then do
+@@ -165,7 +164,7 @@ growCirc !strt !end !oldarr = do
+ -- return newarr
+ ----------------------------------------
+ -- Easier version first:
+- ----------------------------------------
++ ----------------------------------------
+ let len = MV.length oldarr
+ elems = end - strt
+ when dbg $ putStrLn$ "Grow to size "++show (len+len)++", copying over "++show elems
+@@ -176,8 +175,8 @@ growCirc !strt !end !oldarr = do
+ ++" had only initialized "++show elems++" elems: "
+ ++show(strt`mod`(len+len),end`mod`(len+len))))
+ -- Strictly matches what's in the paper:
+- for_ strt end $ \ind -> do
+- x <- getCirc oldarr ind
++ for_ strt end $ \ind -> do
++ x <- getCirc oldarr ind
+ evaluate x
+ putCirc newarr ind x
+ return $! newarr
+@@ -206,7 +205,7 @@ copyOffset !from !to !iFrom !iTo !len =
+ newQ :: V.Unbox elt => IO (ChaseLevDeque elt)
+ newQ = do
+ -- Arbitrary Knob: We start as size 32 and double from there:
+- v <- MV.new 32
++ v <- MV.new 32
+ r1 <- newCounter 0
+ r2 <- newCounter 0
+ r3 <- newIORef v
+@@ -217,8 +216,8 @@ nullQ :: ChaseLevDeque elt -> IO Bool
+ nullQ CLD{top,bottom} = do
+ -- This should get a LOWER bound on size at some point in logic time, right?
+ b <- readCounter bottom
+- t <- readCounter top
+- let size = b - t
++ t <- readCounter top
++ let size = b - t
+ return $! size <= 0
+
+ {-# INLINE approxSize #-}
+@@ -226,7 +225,7 @@ nullQ CLD{top,bottom} = do
+ approxSize :: ChaseLevDeque elt -> IO Int
+ approxSize CLD{top,bottom} = do
+ b <- readCounter bottom
+- t <- readCounter top
++ t <- readCounter top
+ return $! b - t
+
+ {-# INLINE pushL #-}
+@@ -237,12 +236,12 @@ pushL CLD{top,bottom,activeArr} obj = tryit "pushL" $ do
+ b <- readCounter bottom
+ t <- readCounter top
+ arr <- readIORef activeArr
+- let len = MV.length arr
++ let len = MV.length arr
+ size = b - t
+
+ -- when (dbg && size < 0) $ error$ "pushL: INVARIANT BREAKAGE - bottom, top: "++ show (b,t)
+
+- arr' <- if (size >= len - 1) then do
++ arr' <- if (size >= len - 1) then do
+ arr' <- growCirc t b arr -- Double in size, don't change b/t.
+ -- Only a single thread will do this!:
+ writeIORef activeArr arr'
+@@ -268,7 +267,7 @@ pushL CLD{top,bottom,activeArr} obj = tryit "pushL" $ do
+ tryPopR :: V.Unbox elt => ChaseLevDeque elt -> IO (Maybe elt)
+ tryPopR CLD{top,bottom,activeArr} = tryit "tryPopR" $ do
+ -- NB. these loads must be ordered, otherwise there is a race
+- -- between steal and pop.
++ -- between steal and pop.
+ tt <- readCounterForCAS top
+ loadLoadBarrier
+ b <- readCounter bottom
+@@ -277,14 +276,14 @@ tryPopR CLD{top,bottom,activeArr} = tryit "tryPopR" $ do
+
+ let t = peekCTicket tt
+ size = b - t
+- if size <= 0 then
++ if size <= 0 then
+ return Nothing
+- else do
++ else do
+ obj <- getCirc arr t
+ (b,_) <- casCounter top tt (t+1)
+- if b then
++ if b then
+ return $! Just obj
+- else
++ else
+ return Nothing -- Someone beat us, abort
+
+ {-# INLINE tryPopL #-}
+@@ -298,14 +297,14 @@ tryPopL CLD{top,bottom,activeArr} = tryit "tryPopL" $ do
+ -- very important that the following read of q->top does not occur
+ -- before the earlier write to q->bottom.
+ storeLoadBarrier
+-
++
+ tt <- readCounterForCAS top
+ -- when (dbg && b < t) $ error$ "tryPopL: INVARIANT BREAKAGE - bottom < top: "++ show (b,t)
+
+ let t = peekCTicket tt
+- size = b - t
++ size = b - t
+ if size < 0 then do
+- writeCounter bottom t
++ writeCounter bottom t
+ return Nothing
+ else do
+ obj <- getCirc arr b
+@@ -315,7 +314,7 @@ tryPopL CLD{top,bottom,activeArr} = tryit "tryPopL" $ do
+ (b,ol) <- casCounter top tt (t+1)
+ writeCounter bottom (t+1)
+ if b then return $! Just obj
+- else return $ Nothing
++ else return $ Nothing
+
+ ------------------------------------------------------------
+