Adapt to work with GHC 6.12
- Adapted the package to work with GHC 6.12 - Plugins that depend on the old base3 are currently not correctly loaded as the plugin loaded misses the dependence on syb (leading to unresolved symbols) - Cleaned up most of the testsuite (there are still some outstanding failures, of which only one demonstrates a bug in the plugins library as far as I can see — see previous bullet point) - Cleaned out a little cruft (but more could be done)
This commit is contained in:
@ -13,7 +13,7 @@ REALBIN= ./Main
|
||||
API_OBJ= api/API.o
|
||||
|
||||
INCLUDES= -i$(TOP)/testsuite/$(TEST)/api
|
||||
GHCFLAGS= -Onot -cpp -fglasgow-exts
|
||||
GHCFLAGS= -O0 -cpp -fglasgow-exts
|
||||
|
||||
.SUFFIXES : .o .hs .hi .lhs .hc .s
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
module TestIO ( resource_dyn ) where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
import System.IO
|
||||
import System.Posix.Types ( ProcessID, Fd )
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data TestIO = TestIO {
|
||||
field :: IO String
|
||||
|
@ -1,7 +1,7 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
my_fun = plugin {
|
||||
equals = \x y -> (x /= y) -- a strange equals function :)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data Interface = Interface {
|
||||
equals :: forall t. Eq t => t -> t -> Bool
|
||||
|
@ -2,7 +2,7 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
v :: Int
|
||||
v = 0xdeadbeef
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data Interface = Interface {
|
||||
function :: String
|
||||
|
@ -5,7 +5,7 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
v :: Int -> Int
|
||||
v = \x -> 0xdeadbeef
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data Interface = Interface {
|
||||
function :: String
|
||||
|
@ -9,7 +9,7 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
import GHC.Base
|
||||
|
||||
v :: Int
|
||||
|
@ -3,7 +3,7 @@
|
||||
module Plugin ( resource_dyn ) where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
resource = plugin
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
import GHC.Base
|
||||
|
||||
data Interface = Interface {
|
||||
|
@ -9,7 +9,7 @@ module Plugin where
|
||||
|
||||
import API
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
import GHC.Base
|
||||
|
||||
v :: Int
|
||||
|
@ -3,7 +3,7 @@
|
||||
module Plugin ( resource_dyn ) where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
resource = plugin
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
import GHC.Base
|
||||
|
||||
data Interface = Interface {
|
||||
|
@ -2,7 +2,7 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
import AltData.Dynamic
|
||||
import Data.Dynamic
|
||||
|
||||
my_fun = plugin { function = "plugin says \"hello\"" }
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
module API where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data Interface = Interface {
|
||||
function :: String
|
||||
|
@ -1,7 +1,7 @@
|
||||
{-# OPTIONS -cpp -fglasgow-exts #-}
|
||||
module Poly where
|
||||
|
||||
import AltData.Typeable
|
||||
import Data.Typeable
|
||||
|
||||
data Fn = Fn {fn :: forall t. Eq t => t -> t -> Bool}
|
||||
|
||||
|
@ -9,8 +9,7 @@ import System.Plugins
|
||||
import API
|
||||
import Modules.Flags as Flags
|
||||
|
||||
|
||||
rec = Flags.FlagRec { Flags.f1 = 4, Flags.f2 = 10 }
|
||||
record = Flags.FlagRec { Flags.f1 = 4, Flags.f2 = 10 }
|
||||
|
||||
|
||||
main = do
|
||||
@ -18,4 +17,4 @@ main = do
|
||||
case status of
|
||||
LoadFailure _ -> error "load failed"
|
||||
LoadSuccess _ v -> do let func = dbFunc v
|
||||
print (func rec)
|
||||
print (func record)
|
||||
|
@ -36,7 +36,7 @@ main = do
|
||||
|
||||
() <- if (not $ all isJust ts)
|
||||
then putStrLn $ "mkstemp couldn't create all expected files"
|
||||
else putStrLn $ "mkstemp: created "++(show $ length $ catMaybes ts)++" files"
|
||||
else putStrLn $ "mkstemp: created "++(show $ length $ catMaybes ts)++" files"
|
||||
rmAll ts
|
||||
|
||||
------------------------------------------------------------------------
|
||||
@ -47,7 +47,7 @@ main = do
|
||||
_ -> return v ) [1..2000]
|
||||
() <- if (not $ all isJust ts)
|
||||
then putStrLn $ "mkstemps couldn't create all expected files"
|
||||
else putStrLn $ "mkstemps: created "++(show $ length $ catMaybes ts)++" files"
|
||||
else putStrLn $ "mkstemps: created "++(show $ length $ catMaybes ts)++" files"
|
||||
rmAll ts
|
||||
|
||||
------------------------------------------------------------------------
|
||||
@ -55,8 +55,8 @@ main = do
|
||||
--
|
||||
ts <- mapM (\_ -> mkdtemp "t/XXXXXXXXXX") [1..2000]
|
||||
() <- if (not $ all isJust ts)
|
||||
then putStrLn $ "mkdtemp: couldn't create all expected directories"
|
||||
else putStrLn $ "mkdtemp: created "++(show $ length $ catMaybes ts)++" directories"
|
||||
then putStrLn $ "mkdtemp: couldn't create all expected directories"
|
||||
else putStrLn $ "mkdtemp: created "++(show $ length $ catMaybes ts)++" directories"
|
||||
rmAllDirs ts
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
@ -1,5 +1,5 @@
|
||||
created 53 files
|
||||
correctly ran out of permutations
|
||||
mkstemp: created 10000 files
|
||||
mkstemps: created 2000 files
|
||||
mkdtemp: created 2000 directories
|
||||
mkstemp: created 10000 files
|
||||
mkstemps: created 2000 files
|
||||
mkdtemp: created 2000 directories
|
||||
|
@ -15,7 +15,7 @@ symbol = "resource"
|
||||
|
||||
evalWithStringResult :: FilePath -> String -> IO String
|
||||
evalWithStringResult srcFile s = do
|
||||
status <- make srcFile ["-Onot"]
|
||||
status <- make srcFile ["-O0"]
|
||||
case status of
|
||||
MakeFailure err -> putStrLn "error occured" >> return (show err)
|
||||
MakeSuccess _ obj -> load' obj
|
||||
|
@ -1,9 +1,11 @@
|
||||
module Plugin where
|
||||
|
||||
import Data.Typeable
|
||||
import Data.Generics.Aliases
|
||||
import Data.Generics.Schemes
|
||||
|
||||
import API
|
||||
|
||||
resource = rsrc {
|
||||
field = id listify
|
||||
field = id listify :: Typeable r => (r -> Bool) -> GenericQ [r]
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
GHCFLAGS= -Onot $(GHC_EXTRA_OPTS)
|
||||
GHCFLAGS= -O0 $(GHC_EXTRA_OPTS)
|
||||
PKGFLAGS= -package posix
|
||||
PKGFLAGS+= -package plugins
|
||||
|
||||
|
Reference in New Issue
Block a user