khajavi / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

Problem compiling 1.2.1 on Jaunty with GHC 6.10.1 #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to compile version pandoc 1.2.1 on Jaunty.  I'm using GHC 6.10.1
installed via cabal (which might be part of the problem).

I've downloaded the tarball and unpacked it.  The build first failed
because of pandoc's dependency on the old Haskell time module System.Time.
 I fixed this with the following patch:

diff -ru pandoc-1.2.1/Setup.hs pandoc-1.2.1_/Setup.hs
--- pandoc-1.2.1/Setup.hs       2009-07-18 16:32:41.000000000 -0400
+++ pandoc-1.2.1_/Setup.hs      2009-08-19 09:53:19.000000000 -0400
@@ -6,7 +6,7 @@
 import System.Directory
 import System.IO ( stderr, openTempFile )
 import System.Exit
-import System.Time
+import Time
 import System.IO.Error ( isDoesNotExistError )
 import Data.Maybe ( fromJust, isNothing, catMaybes )
 import Data.List ( isInfixOf )
@@ -51,12 +51,14 @@
 modifiedDependencies file dependencies = do
   fileModTime <- catch (getModificationTime file) $
                  \e -> if isDoesNotExistError e
-                          then return (TOD 0 0)   -- the minimum ClockTime
+                          then return zeroTime   -- the minimum ClockTime
                           else ioError e
   depModTimes <- mapM getModificationTime dependencies
   let modified = zipWith (\dep time -> if time > fileModTime then Just dep
else Nothing) dependencies depModTimes
   return $ catMaybes modified

+zeroTime = toClockTime $ CalendarTime 0 January 0 0 0 0 0 Sunday 0 "UDT" 0
False
+
 -- | Perform an IO action in a directory.
 inDirectory :: FilePath -> IO a -> IO a
 inDirectory dir action = do

However, I'm now getting stuck with link errors:

1031)~/pandoc-1.2.1% make
ghc -package Cabal Setup.hs -o ./setup
Setup.o: In function `s1FT_info':
(.text+0x3c9): undefined reference to
`filepathzm1zi1zi0zi2_SystemziFilePathziPosix_zlzszg_closure'

I get about a dozen of these errors, but they're all link errors against
the same reference.

Is pandoc known to not compile against current versions of Haskell?

This is happening on Ubuntu Jaunty with kernel 2.6.31.

Original issue reported on code.google.com by seanerussell on 19 Aug 2009 at 2:09

GoogleCodeExporter commented 9 years ago
Pandoc compiles just fine with GHC 6.10.x.  You shouldn't need to alter the 
code.

Can you revert your changes to the code, and send me the output of
ghc-pkg list?

Your problem with the time module might be related to:
http://code.google.com/p/pandoc/issues/detail?id=159

Original comment by fiddloso...@gmail.com on 19 Aug 2009 at 7:35

GoogleCodeExporter commented 9 years ago
Sure.  With the changes reverted, I get the following:

===============
1180)~/pandoc-1.2.1% make
ghc -package Cabal Setup.hs -o ./setup

Setup.hs:54:39:
    Couldn't match expected type `old-time-1.0.0.1:System.Time.ClockTime'
           against inferred type `ClockTime'
    In the first argument of `return', namely `(TOD 0 0)'
    In the expression: return (TOD 0 0)
    In the expression:
        if isDoesNotExistError e then return (TOD 0 0) else ioError e
make: *** [setup] Error 1
===============

This is because Directory.getModificationTime returns a Time.ClockTime, but TOD 
is
from the old-time package.

The output from ghc-pkg list is:

===============
1178)~/pandoc-1.2.1% ghc-pkg list
/usr/lib/ghc-6.10.1/./package.conf:
    Cabal-1.6.0.1, array-0.2.0.0, base-3.0.3.0, base-4.0.0.0,
    bytestring-0.9.1.4, containers-0.2.0.0, directory-1.0.0.2,
    editline-0.2.1.0, filepath-1.1.0.1, (ghc-6.10.1), ghc-prim-0.1.0.0,
    haskell98-1.0.1.0, hpc-0.5.0.2, integer-0.1.0.0, mtl-1.1.0.2,
    old-locale-1.0.0.1, old-time-1.0.0.1, packedstring-0.1.0.1,
    pretty-1.0.1.0, process-1.0.1.0, random-1.0.0.1, rts-1.0,
    syb-0.1.0.0, template-haskell-2.3.0.0, unix-2.3.1.0,
    xhtml-3000.2.0.1
/home/ser/.ghc/i386-linux-6.10.1/package.conf:
    HUnit-1.2.0.3, HaXml-1.13.3, X11-1.4.5, X11-xft-0.3,
    binary-0.5.0.1, csv-0.1.1, curl-1.3.5, digest-0.0.0.5,
    filepath-1.1.0.2, haskell98-1.0.1.0, hinotify-0.2, hxt-8.3.0,
    network-2.2.1, network-2.2.1.3, old-time-1.0.0.2, parallel-1.1.0.1,
    parsec-2.1.0.1, process-1.0.1.1, random-1.0.0.1, stm-2.1.1.2,
    tagsoup-0.6, utf8-string-0.3.4, xmonad-0.8.1, xmonad-contrib-0.8.1,
    zip-archive-0.1.1.3, zlib-0.5.2.0
===============

Thanks!

--- SER

Original comment by seanerussell on 19 Aug 2009 at 10:02

GoogleCodeExporter commented 9 years ago
Dur.  I responded to this before looking at the other issue, so the ClockTime 
thing
is a non-issue -- aside from the fact that *something* depended on it, and 
it'll be
fun tracking that issue down when I run into it again.

I'm uninstalling old-time, and will report back if the link issues disappear.

Original comment by seanerussell on 19 Aug 2009 at 10:06

GoogleCodeExporter commented 9 years ago
Ah.  xmonad-contrib depends on it old-time.  I've 'ghc-pkg hide'n it, and now a
freshly unpacked (from the source tarball) pandoc build goes straight to the 
link
errors.  They're both in filepath (there are about a dozen errors, but they're 
all to
two functions):

filepathzm1zi1zi0zi2_SystemziFilePathziPosix_zlzszg_closure
__stginit_filepathzm1zi1zi0zi2_SystemziFilePath_

It looks like there are two Cabal-installed filepath versions -- 1.1.0.1 and 
1.1.0.2.
 I don't know ghc-pkg well enough to know which it would choose when building, or if
that would make a difference.

Original comment by seanerussell on 19 Aug 2009 at 10:14

GoogleCodeExporter commented 9 years ago
I alternately hid the two versions of file path, and got the link errors on 
both. 
Don't know if that helps.

Original comment by seanerussell on 19 Aug 2009 at 10:19

GoogleCodeExporter commented 9 years ago
I used to run into this kind of problem when mixing the Ubuntu-installed 
packages
with locally installed ones.  Eventually you get a situation where the Ubuntu 
stuff
is linked with one version of a package and your locally installed packages are
linked with another, and in some cases this can lead to link errors.

Since Ubuntu Haskell packages are fairly far behind, I don't use them at all.  
You
could try this if you want to use up-to-date Haskell stuff.  Remove all your 
haskell
packages.  Then follow the instructions on
http://gitit.johnmacfarlane.net/Gitit%20on%20Ubuntu
(except you can skip the gitit-specific part).

This will also give you the cabal install tool, which you can use to install any
Haskell library foo using just 'cabal install foo'.  (Yes, xmonad too.)

I don't know why Cabal isn't more robust when there are multiple versions of 
the same
library.

Original comment by fiddloso...@gmail.com on 20 Aug 2009 at 2:23

GoogleCodeExporter commented 9 years ago
Ok, I'll give that a shot.  Almost all of my Haskell stuff is installed via 
cabal as
it is (including xmonad); GHC is the only package installed via deb.  I'll 
report
back when I'm done.

Hey... it's just like being back on Gentoo!  ;-)

Original comment by seanerussell on 20 Aug 2009 at 10:00

GoogleCodeExporter commented 9 years ago
I uninstalled every Haskell related deb and installed GHC as per the gitit
instructions, and pandoc 1.2.1 built and installed via cabal. AFAIC, you can 
close
this ticket.

Thanks for your help.

Original comment by seanerussell on 20 Aug 2009 at 1:28

GoogleCodeExporter commented 9 years ago
Good to hear!

Original comment by fiddloso...@gmail.com on 20 Aug 2009 at 6:05