[commit: ghc] : Fix build of plugin code, write script for installing it inplace (for testing) (8db5e67)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/8db5e6781ce9c0138a399e84abe57ced7152f24c

>---------------------------------------------------------------

commit 8db5e6781ce9c0138a399e84abe57ced7152f24c
Author: Max Bolingbroke <[email protected]>
Date:   Wed Jun 29 19:03:21 2011 +0100

    Fix build of plugin code, write script for installing it inplace (for testing)

>---------------------------------------------------------------

 compiler/supercompile/.gitignore             |    2 ++
 compiler/supercompile/CHSC.hs                |    6 ++++--
 compiler/supercompile/chsc-plugin.cabal      |   13 +++++++++++--
 compiler/supercompile/install-plugin-inplace |    8 ++++++++
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/compiler/supercompile/.gitignore b/compiler/supercompile/.gitignore
new file mode 100644
index 0000000..1c20c83
--- /dev/null
+++ b/compiler/supercompile/.gitignore
@@ -0,0 +1,2 @@
+# Ignore directory created by install-plugin-inplace
+dist/
diff --git a/compiler/supercompile/CHSC.hs b/compiler/supercompile/CHSC.hs
index 1063c4d..c617de8 100644
--- a/compiler/supercompile/CHSC.hs
+++ b/compiler/supercompile/CHSC.hs
@@ -3,7 +3,9 @@ module CHSC (Supercompile(..), plugin) where
 import Supercompile
 import GhcPlugins
 
-import Data.List (nub)
+import Data.Data     (Data)
+import Data.Typeable (Typeable)
+import Data.List     (nub)
 
 
 -- The supercomplier behaves as follows:
@@ -33,7 +35,7 @@ pass unconditional guts = do
     should_sc <- case unconditional of
         True  -> return (const True)
         False -> do
-            anns <- getFirstAnnotations deserializeWithData guts
+            anns :: UniqFM Supercompile <- getFirstAnnotations deserializeWithData guts
             mod <- getModule
             return $ if mod `elemUFM` anns
                       then const True
diff --git a/compiler/supercompile/chsc-plugin.cabal b/compiler/supercompile/chsc-plugin.cabal
index a8b5a53..752a33b 100644
--- a/compiler/supercompile/chsc-plugin.cabal
+++ b/compiler/supercompile/chsc-plugin.cabal
@@ -35,6 +35,15 @@ Library
         Supercompile.Termination.TagBag
         Supercompile.Utilities
         Supercompile
+    Extensions:
+        CPP,
+        PatternGuards,
+        ExistentialQuantification,
+        ScopedTypeVariables,
+        FlexibleInstances,
+        RankNTypes,
+        DeriveDataTypeable
     Build-Depends:
-        base >= 4,
-        ghc >= 7.1
+        base >= 4.3 && < 4.4,
+        containers >= 0.4 && < 0.5,
+        ghc >= 7.1 && < 7.2
diff --git a/compiler/supercompile/install-plugin-inplace b/compiler/supercompile/install-plugin-inplace
new file mode 100755
index 0000000..d226fec
--- /dev/null
+++ b/compiler/supercompile/install-plugin-inplace
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+SCRIPT_DIR=$(cd $(dirname "$0"); pwd)
+INPLACE_DIR="$SCRIPT_DIR/../../inplace"
+
+# NB: this script relies on the installed Cabal (presumably from the bootstrapping compiler)
+# actually understanding the package metadata used by the in-tree Cabal. Risky, but works for now.
+cabal install --disable-library-profiling --user --with-ghc=$INPLACE_DIR/bin/ghc-stage2 --with-ghc-pkg=$INPLACE_DIR/bin/ghc-pkg --package-db=$INPLACE_DIR/lib/package.conf.d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.