[commit: haddock] master: Build executable with '-threaded' (fixes #399) (2b467a7)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:39:09 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/2b467a747df246090d1fd0270ea9bd4192ebe3df

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

commit 2b467a747df246090d1fd0270ea9bd4192ebe3df
Author: Emanuel Borsboom <manny at fpcomplete.com>
Date:   Sat May 23 04:56:18 2015 -0700

    Build executable with '-threaded' (fixes #399)


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

2b467a747df246090d1fd0270ea9bd4192ebe3df
 haddock.cabal                                |  2 +-
 html-test/ref/{Bug253.html => Threaded.html} | 47 +++++++++++++---------------
 html-test/src/Threaded.hs                    | 10 ++++++
 html-test/src/Threaded_TH.hs                 | 13 ++++++++
 4 files changed, 45 insertions(+), 27 deletions(-)

diff --git a/haddock.cabal b/haddock.cabal
index 03bb28a..ed570f5 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -42,7 +42,7 @@ executable haddock
   default-language:     Haskell2010
   main-is:              Main.hs
   hs-source-dirs:       driver
-  ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2
+  ghc-options:          -funbox-strict-fields -Wall -fwarn-tabs -O2 -threaded
 
   build-depends:
     base >= 4.3 && < 4.9
diff --git a/html-test/ref/Bug253.html b/html-test/ref/Threaded.html
similarity index 68%
copy from html-test/ref/Bug253.html
copy to html-test/ref/Threaded.html
index 0802d91..95a1893 100644
--- a/html-test/ref/Bug253.html
+++ b/html-test/ref/Threaded.html
@@ -3,13 +3,13 @@
 ><head
   ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
      /><title
-    >Bug253</title
+    >Threaded</title
     ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
      /><script src="haddock-util.js" type="text/javascript"
     ></script
     ><script type="text/javascript"
     >//<![CDATA[
-window.onload = function () {pageLoad();setSynopsis("mini_Bug253.html");};
+window.onload = function () {pageLoad();setSynopsis("mini_Threaded.html");};
 //]]>
 </script
     ></head
@@ -35,26 +35,20 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug253.html");};
 	  ><th
 	    >Safe Haskell</th
 	    ><td
-	    >Safe</td
+	    >None</td
 	    ></tr
 	  ></table
 	><p class="caption"
-	>Bug253</p
+	>Threaded</p
 	></div
       ><div id="description"
       ><p class="caption"
 	>Description</p
 	><div class="doc"
 	><p
-	  >This module tests that if we're trying to link to a <em
-	    >qualified</em
-	    >
- identifier that's not in scope, we get an anchor as if it was a
- variable. Previous behaviour was to treat it as a type constructor
- so issue like #253 arose. Also see <code
-	    >rename</code
-	    > function comments in
- source.</p
+	  >Ensures haddock built with <code
+	    >-threaded</code
+	    >.</p
 	  ></div
 	></div
       ><div id="synopsis"
@@ -62,9 +56,11 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug253.html");};
 	>Synopsis</p
 	><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
 	><li class="src short"
-	  ><a href="#v:foo"
-	    >foo</a
-	    > :: ()</li
+	  ><a href="#v:f"
+	    >f</a
+	    > :: <a href=" ${pkgroot}/../../share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer"
+	    >Integer</a
+	    ></li
 	  ></ul
 	></div
       ><div id="interface"
@@ -72,18 +68,17 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug253.html");};
 	>Documentation</h1
 	><div class="top"
 	><p class="src"
-	  ><a name="v:foo" class="def"
-	    >foo</a
-	    > :: ()</p
+	  ><a name="v:f" class="def"
+	    >f</a
+	    > :: <a href=" ${pkgroot}/../../share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer"
+	    >Integer</a
+	    ></p
 	  ><div class="doc"
 	  ><p
-	    >This link should generate <code
-	      >#v</code
-	      > anchor: <code
-	      ><a href="DoesNotExist.html#v:fakeFakeFake"
-		>fakeFakeFake</a
-		></code
-	      ></p
+	    ><code
+	      >$(forkTH)</code
+	      > fails at compile time if haddock isn't using the
+ threaded RTS.</p
 	    ></div
 	  ></div
 	></div
diff --git a/html-test/src/Threaded.hs b/html-test/src/Threaded.hs
new file mode 100644
index 0000000..7f3073a
--- /dev/null
+++ b/html-test/src/Threaded.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+-- | Ensures haddock built with @-threaded at .
+module Threaded where
+
+import Threaded_TH
+
+-- | @$(forkTH)@ fails at compile time if haddock isn't using the
+-- threaded RTS.
+f = $(forkTH)
diff --git a/html-test/src/Threaded_TH.hs b/html-test/src/Threaded_TH.hs
new file mode 100644
index 0000000..53e5a39
--- /dev/null
+++ b/html-test/src/Threaded_TH.hs
@@ -0,0 +1,13 @@
+-- | Imported by 'Threaded', since a TH splice can't be used in the
+-- module where it is defined.
+module Threaded_TH where
+
+import Control.Concurrent (forkOS)
+import Language.Haskell.TH.Syntax (Exp (LitE), Lit (IntegerL), Q, runIO)
+
+-- | forkOS requires the threaded RTS, so this TH fails if haddock was
+-- built without @-threaded at .
+forkTH :: Q Exp
+forkTH = do
+  _ <- runIO (forkOS (return ()))
+  return (LitE (IntegerL 0))



More information about the ghc-commits mailing list