[Haskell-cafe] Plugins on ghc 7.2: GHC does not export defaultCallbacks

Brian Victor gmane at brianhv.org
Sat Dec 31 01:35:47 CET 2011


For anyone interested, here's a patch I came up with that seems to fix 
the build failure. I'm trying now to reach the relevant parties to get 
this included in the package.

diff -rN -u old-hs-plugins/src/System/Plugins/Load.hs 
new-hs-plugins/src/System/Plugins/Load.hs
--- old-hs-plugins/src/System/Plugins/Load.hs	2011-12-30 
17:52:37.000000000 -0500
+++ new-hs-plugins/src/System/Plugins/Load.hs	2011-12-30 
17:52:37.000000000 -0500
@@ -84,7 +84,9 @@
  import System.Directory         ( doesFileExist, removeFile )
  import Foreign.C.String         ( CString, withCString, peekCString )

+#if !MIN_VERSION_ghc(7,2,0)
  import GHC                      ( defaultCallbacks )
+#endif
  import GHC.Ptr                  ( Ptr(..), nullPtr )
  import GHC.Exts                 ( addrToHValue# )
  import GHC.Prim                 ( unsafeCoerce# )
@@ -99,7 +101,12 @@
  readBinIface' :: FilePath -> IO ModIface
  readBinIface' hi_path = do
      -- kludgy as hell
+#if MIN_VERSION_ghc(7,2,0)
+    e <- newHscEnv undefined
+#else
      e <- newHscEnv defaultCallbacks undefined
+#endif
+
      initTcRnIf 'r' e undefined undefined (readBinIface IgnoreHiWay 
QuietBinIFaceReading hi_path)

  -- TODO need a loadPackage p package.conf :: IO () primitive
@@ -679,7 +686,11 @@

                  -- and find some packages to load, as well.
                  let ps = dep_pkgs ds
+#if MIN_VERSION_ghc(7,2,0)
+                ps' <- filterM loaded . map packageIdString . nub $ map 
fst ps
+#else
                  ps' <- filterM loaded . map packageIdString . nub $ ps
+#endif

  #if DEBUG
                  when (not (null ps')) $

On 12/30/11 4:32 PM, Brian Victor wrote:
> Hi all,
>
> As a getting-my-feet-wet project I was starting to look into using
> plugins-auto with the yesod devel server, but I was quickly stymied
> because the plugins package isn't building on GHC 7.2. The error I get
> locally is the same as the one reported by hackage[1]. In short,
> defaultCallbacks seems to be gone from 7.2.
>
> It doesn't look like that function has simply been moved. So can someone
> give me an idea about how to proceed?
>
> Thanks!
>
> [1]
> http://hackage.haskell.org/packages/archive/plugins/1.5.1.4/logs/failure/ghc-7.2
>
>





More information about the Haskell-Cafe mailing list