By the way, this was with hs-plugins-1.0-rc1. I appear to be unable to
install hs-plugins-0.9.10 now (perhaps because of 1.0-rc1). In case it
helps this is the not so pretty output from doing a "make check" in
1.0rc1:
=== testing testsuite/conf/simple                              ... ===
testing testsuite/dynload/io                               ... ===
testing testsuite/dynload/poly                             ... ===
testing testsuite/dynload/should_fail                      ... ===
testing testsuite/dynload/should_fail_1                    ... ===
testing testsuite/dynload/should_fail_2                    ... ===
testing testsuite/dynload/should_fail_3                    ... ===
testing testsuite/dynload/simple                           ... ===
testing testsuite/eval/eval1                               ... ===
testing testsuite/eval/eval2                               ... ===
testing testsuite/eval/eval3                               ... ===
testing testsuite/eval/eval_                               ... ===
testing testsuite/eval/eval_fn                             ... ===
testing testsuite/eval/eval_fn1                            ... ===
testing testsuite/eval/foreign_eval                        ...
ignored.
=== testing testsuite/eval/foreign_eval1                       ... ignored.
=== testing testsuite/eval/foreign_should_fail                 ... ignored.
=== testing testsuite/eval/foreign_should_fail_illtyped        ... ignored.
=== testing testsuite/eval/unsafeidir                          ... ===
testing testsuite/hier/hier1                               ... ===
testing testsuite/hier/hier2                               ... ===
testing testsuite/hier/hier3                               ... ===
testing testsuite/hier/hier4                               ... ===
testing testsuite/iface/null                               ... ===
testing testsuite/load/io                                  ... ===
testing testsuite/load/load_0                              ... ===
testing testsuite/load/loadpkg                             ... ===
testing testsuite/load/null                                ... ===
testing testsuite/load/thiemann0                           ... ===
testing testsuite/load/thiemann2                           ... ===
testing testsuite/load/unloadpkg                           ... ===
testing testsuite/loadCLib/null                            ... ===
testing testsuite/make/makeall001                          ... ===
testing testsuite/make/null                                ... ===
testing testsuite/make/o                                   ... ===
testing testsuite/make/odir                                ... ===
testing testsuite/make/remake001                           ... ===
testing testsuite/make/remake001_should_fail               ... ===
testing testsuite/make/simple                              ... ===
testing testsuite/makewith/global_pragma                   ... ===
testing testsuite/makewith/io                              ... ===
testing testsuite/makewith/merge00                         ... ===
testing testsuite/makewith/mergeto0                        ... ===
testing testsuite/makewith/module_name                     ... ===
testing testsuite/makewith/multi_make                      ... ===
testing testsuite/makewith/should_fail_0                   ... ===
testing testsuite/makewith/tiny                            ... ===
testing testsuite/makewith/unsafeio                        ... ===
testing testsuite/misc/mkstemps                            ... ===
testing testsuite/multi/3plugins                           ... ===
testing testsuite/objc/expression_parser                   ...
ignored.
=== testing testsuite/pdynload/badint                          ... ===
testing testsuite/pdynload/bayley1                         ... ===
testing testsuite/pdynload/null                            ... ===
testing testsuite/pdynload/numclass                        ... ===
testing testsuite/pdynload/poly                            ... ===
testing testsuite/pdynload/poly1                           ... ===
testing testsuite/pdynload/should_fail0                    ... ===
testing testsuite/pdynload/should_fail1                    ... ===
testing testsuite/pdynload/small                           ... ===
testing testsuite/pdynload/spj1                            ...
ignored.
=== testing testsuite/pdynload/spj2                            ... ===
testing testsuite/pdynload/spj3                            ... ===
testing testsuite/pdynload/spj4                            ... ===
testing testsuite/pdynload/typealias                       ... ===
testing testsuite/pdynload/univquant                       ... ===
testing testsuite/pkgconf/null                             ...
ignored.
=== testing testsuite/plugs/plugs                              ... failed with:
  / .___/_/\__,_/\__, /____/       Type :? for help
 /_/            /____/
-Loading package base ... linking ... plugs> plugs> done
-453973694165307953197296969697410619233826
+Loading package base ... linking ... plugs> let fibs = 1 : 1 :
zipWith (+) fibs (tail fibs) in fibs !! 200
+plugs:
+unknown symbol `_base_GHCziList_znzn_closure'
+done
+plugs: user error (resolvedObjs failed.)
+
=== testing testsuite/plugs/runplugs                           ... ===
testing testsuite/reload/null                              ... ===
testing testsuite/shell/shell                              ...
ignored.
=== testing testsuite/shell/simple                             ... ignored.
=== testing testsuite/unload/null                              ... ===
testing testsuite/unload/sjwtrap                           ... ===
testing testsuite/unloadAll/null                           ...
On 10/1/07, Björn Buckwalter 
Dear all,
I'm getting a rather unfriendly error when trying to load a plugin with hs-plugins:
my_program: Ix{Int}.index: Index (65536) out of range ((0,7))
The exact numbers in the message vary depending on what I'm trying to do. I'm using GHC-6.6.1 on MacOS X. Here are three files that exhibit the behaviour for me:
API.lhs =======
module API where data Config = Config { param :: String }
Main.lhs ========
module Main where import System (getArgs) import System.Plugins import API
getConfig :: [String] -> IO Config getConfig [file] = do status <- make file [] obj <- case status of MakeSuccess _ o -> return o MakeFailure es -> mapM_ putStrLn es >> error "make failed" putStrLn $ "### loading " ++ file m_v <- load_ obj ["."] "config" putStrLn $ "### checking " ++ file val <- case m_v of LoadSuccess _ v -> return v LoadFailure es -> mapM_ putStrLn es >> error "load failed" return val
main = getArgs >>= getConfig >>= putStrLn . param
CustomConfig.hs ===============
module CustomConfig where import API config = Config { param = "Doomed to fail!" }
I compile the above with "ghc --make -o my_program PluginTest.lhs" and execute with "./my_program CustomConfig.lhs".
Any hints welcome. Thanks, Bjorn Buckwalter