New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.6.7.1 does not build with GHC 7.10.1 #340

Closed
FranklinChen opened this Issue Mar 29, 2015 · 18 comments

Comments

Projects
None yet
10 participants
@FranklinChen

FranklinChen commented Mar 29, 2015

cabal install hakyll
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: hakyll-4.6.7.1 (user goal)
trying: process-1.2.3.0/installed-6c5... (dependency of hakyll-4.6.7.1)
trying: pandoc-citeproc-0.6 (dependency of hakyll-4.6.7.1)
trying: xml-conduit-1.2.3.3 (dependency of pandoc-citeproc-0.6)
trying: conduit-extra-1.1.7.1 (dependency of xml-conduit-1.2.3.3)
trying: streaming-commons-0.1.10.0/installed-c3a... (dependency of
conduit-extra-1.1.7.1)
next goal: pandoc (dependency of hakyll-4.6.7.1)
rejecting: pandoc-1.13.2, 1.13.1 (conflict: process =>
filepath==1.4.0.0/installed-40d..., pandoc => filepath>=1.1 && <1.4)
rejecting: pandoc-1.13.0.1, 1.13, 1.12.4.2, 1.12.4 (conflict:
streaming-commons => network==2.6.0.2/installed-d4c..., pandoc => network>=2
&& <2.6)
rejecting: pandoc-1.12.3.3, 1.12.3.2, 1.12.3.1, 1.12.3, 1.12.2.1, 1.12.2,
1.12.1, 1.12.0.2, 1.12.0.1, 1.12, 1.11.1, 1.11, 1.10.1, 1.10.0.5, 1.10.0.4,
1.10.0.3, 1.10.0.2, 1.10.0.1, 1.10, 1.9.4.5, 1.9.4.4, 1.9.4.3, 1.9.4.2,
1.9.4.1, 1.9.4, 1.9.3, 1.9.2, 1.9.1.2, 1.9.1.1, 1.9.1, 1.9.0.5, 1.9.0.4,
1.9.0.3, 1.9.0.2, 1.9, 1.8.2.1, 1.8.2, 1.8.1.2, 1.8.1.1, 1.8.1, 1.8.0.3,
1.8.0.2, 1.8.0.1, 1.8, 1.6.0.1, 1.6, 1.5.1.1, 1.5.1, 1.5.0.1, 1.5, 1.4, 1.3,
1.2.1, 1.2, 1.1, 1.0.0.1, 1.0, 0.46, 0.45, 0.44, 0.43, 0.42, 0.41, 0.4
(conflict: hakyll => pandoc>=1.12.4 && <1.14)
Backjump limit reached (change with --max-backjumps).
@redllamas

This comment has been minimized.

Show comment
Hide comment
@redllamas

redllamas Apr 1, 2015

Also having the same problem since the upgrade.
Using ghc-7.10.1 installed via homebrew.

It looks like a pandoc dependency issue so I tried installing pandoc alone, no luck so far.

redllamas commented Apr 1, 2015

Also having the same problem since the upgrade.
Using ghc-7.10.1 installed via homebrew.

It looks like a pandoc dependency issue so I tried installing pandoc alone, no luck so far.

@silky

This comment has been minimized.

Show comment
Hide comment
@silky

silky Apr 8, 2015

yeah, after blindly changing the bounds on the cabal file i get the following error

src/Hakyll/Web/CompressCss.hs:11:1: Warning:
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
[38 of 47] Compiling Hakyll.Web.Html.RelativizeUrls ( src/Hakyll/Web/Html/RelativizeUrls.hs, dist/build/Hakyll/Web/Html/RelativizeUrls.o )
[39 of 47] Compiling Hakyll.Web.Pandoc ( src/Hakyll/Web/Pandoc.hs, dist/build/Hakyll/Web/Pandoc.o )

src/Hakyll/Web/Pandoc.hs:49:34:
    Couldn't match type ‘Either Text.Pandoc.Error.PandocError Pandoc’
                   with ‘Pandoc’
    Expected type: String -> Pandoc
      Actual type: String
                   -> Either Text.Pandoc.Error.PandocError Pandoc
    In the first argument of ‘fmap’, namely
      ‘(reader ropt (itemFileType item))’
    In the expression: fmap (reader ropt (itemFileType item)) item

so some minor changes are needed i guess.

one can change the suggested function to just error out the "Left PandocError" case, and continue as it does for the "Right b" case, if one was interested in a very quick and lazy hack.

silky commented Apr 8, 2015

yeah, after blindly changing the bounds on the cabal file i get the following error

src/Hakyll/Web/CompressCss.hs:11:1: Warning:
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
[38 of 47] Compiling Hakyll.Web.Html.RelativizeUrls ( src/Hakyll/Web/Html/RelativizeUrls.hs, dist/build/Hakyll/Web/Html/RelativizeUrls.o )
[39 of 47] Compiling Hakyll.Web.Pandoc ( src/Hakyll/Web/Pandoc.hs, dist/build/Hakyll/Web/Pandoc.o )

src/Hakyll/Web/Pandoc.hs:49:34:
    Couldn't match type ‘Either Text.Pandoc.Error.PandocError Pandoc’
                   with ‘Pandoc’
    Expected type: String -> Pandoc
      Actual type: String
                   -> Either Text.Pandoc.Error.PandocError Pandoc
    In the first argument of ‘fmap’, namely
      ‘(reader ropt (itemFileType item))’
    In the expression: fmap (reader ropt (itemFileType item)) item

so some minor changes are needed i guess.

one can change the suggested function to just error out the "Left PandocError" case, and continue as it does for the "Right b" case, if one was interested in a very quick and lazy hack.

@jaspervdj

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Apr 8, 2015

Owner

The latest release should build fine with GHC 7.10.

Owner

jaspervdj commented Apr 8, 2015

The latest release should build fine with GHC 7.10.

@jaspervdj jaspervdj closed this Apr 8, 2015

@pbrisbin

This comment has been minimized.

Show comment
Hide comment
@pbrisbin

pbrisbin Apr 8, 2015

The latest release should build fine with GHC 7.10.

I don't know that that's true. I still run into this specifically:

rejecting: pandoc-1.13.2, 1.13.1 (conflict: process =>
filepath==1.4.0.0/installed-40d..., pandoc => filepath>=1.1 && <1.4)

Pandoc is already fixed to allow filepath-1.4, but that change doesn't seem to be on Hackage yet.

I'm not sure if there even is a workaround for this. I'm just mentioning it since this Issue is a top Google result for "pandoc 7.10".

pbrisbin commented Apr 8, 2015

The latest release should build fine with GHC 7.10.

I don't know that that's true. I still run into this specifically:

rejecting: pandoc-1.13.2, 1.13.1 (conflict: process =>
filepath==1.4.0.0/installed-40d..., pandoc => filepath>=1.1 && <1.4)

Pandoc is already fixed to allow filepath-1.4, but that change doesn't seem to be on Hackage yet.

I'm not sure if there even is a workaround for this. I'm just mentioning it since this Issue is a top Google result for "pandoc 7.10".

@othercriteria

This comment has been minimized.

Show comment
Hide comment
@othercriteria

othercriteria Apr 9, 2015

Confirming that @pbrisbin's situation is not unique. I see the same error under a fresh Homebrew install of ghc (7.10.1) and cabal-install.

othercriteria commented Apr 9, 2015

Confirming that @pbrisbin's situation is not unique. I see the same error under a fresh Homebrew install of ghc (7.10.1) and cabal-install.

@othercriteria

This comment has been minimized.

Show comment
Hide comment
@othercriteria

othercriteria Apr 10, 2015

The install now advances to the following conflict with haddock-library:

rejecting: haddock-library-1.2.0 (conflict: pandoc => haddock-library>=1.1 && <1.2)
rejecting: haddock-library-1.1.1, 1.1.0 (conflict: base==4.8.0.0/installed-901..., haddock-library => base>=4.3 && <4.8)
rejecting: haddock-library-1.0.1, 1.0.0 (conflict: pandoc => haddock-library>=1.1 && <1.2)

othercriteria commented Apr 10, 2015

The install now advances to the following conflict with haddock-library:

rejecting: haddock-library-1.2.0 (conflict: pandoc => haddock-library>=1.1 && <1.2)
rejecting: haddock-library-1.1.1, 1.1.0 (conflict: base==4.8.0.0/installed-901..., haddock-library => base>=4.3 && <4.8)
rejecting: haddock-library-1.0.1, 1.0.0 (conflict: pandoc => haddock-library>=1.1 && <1.2)
@ilpianista

This comment has been minimized.

Show comment
Hide comment
@ilpianista

ilpianista Apr 10, 2015

@othercriteria try with cabal install hakyll --allow-newer=haddock-library

ilpianista commented Apr 10, 2015

@othercriteria try with cabal install hakyll --allow-newer=haddock-library

@othercriteria

This comment has been minimized.

Show comment
Hide comment
@othercriteria

othercriteria Apr 10, 2015

@ilpianista Gave it a try, and pandoc-1.13.2 gets chosen, and then fails to build at:

[25 of 69] Compiling Text.Pandoc.Templates
...
cabal: Error: some packages failed to install:
hakyll-4.6.8.1 depends on pandoc-1.13.2 which failed to install.
pandoc-1.13.2 failed during the building phase. The exception was:
ExitFailure 1
pandoc-citeproc-0.6 depends on pandoc-1.13.2 which failed to install.

These errors seem to involve the compiler not knowing how to deal with type ambiguity for string literals. That is, they don't seem like something that can be fixed just by bumping version numbers?

othercriteria commented Apr 10, 2015

@ilpianista Gave it a try, and pandoc-1.13.2 gets chosen, and then fails to build at:

[25 of 69] Compiling Text.Pandoc.Templates
...
cabal: Error: some packages failed to install:
hakyll-4.6.8.1 depends on pandoc-1.13.2 which failed to install.
pandoc-1.13.2 failed during the building phase. The exception was:
ExitFailure 1
pandoc-citeproc-0.6 depends on pandoc-1.13.2 which failed to install.

These errors seem to involve the compiler not knowing how to deal with type ambiguity for string literals. That is, they don't seem like something that can be fixed just by bumping version numbers?

@ilpianista

This comment has been minimized.

Show comment
Hide comment
@ilpianista

ilpianista Apr 10, 2015

Yes, pandoc on hackage does not build with GHC 7.10.1, you need pandoc from git.

ilpianista commented Apr 10, 2015

Yes, pandoc on hackage does not build with GHC 7.10.1, you need pandoc from git.

@duk3luk3

This comment has been minimized.

Show comment
Hide comment
@duk3luk3

duk3luk3 Apr 10, 2015

Can you say which specific version of pandoc and pandoc-citeproc need to be built? The current master of pandoc doesn't seem to be compatible with hakyll 4.6.7.1. (or hakyll 4.6.8.1)

duk3luk3 commented Apr 10, 2015

Can you say which specific version of pandoc and pandoc-citeproc need to be built? The current master of pandoc doesn't seem to be compatible with hakyll 4.6.7.1. (or hakyll 4.6.8.1)

@ilpianista

This comment has been minimized.

Show comment
Hide comment
@ilpianista

ilpianista Apr 11, 2015

You are right, build fails with pandoc 1.14:

src/Hakyll/Web/Pandoc.hs:49:34:
    Couldn't match type ‘Either Text.Pandoc.Error.PandocError Pandoc’
                   with ‘Pandoc’
    Expected type: String -> Pandoc
      Actual type: String
                   -> Either Text.Pandoc.Error.PandocError Pandoc
    In the first argument of ‘fmap’, namely
      ‘(reader ropt (itemFileType item))’
    In the expression: fmap (reader ropt (itemFileType item)) item

ilpianista commented Apr 11, 2015

You are right, build fails with pandoc 1.14:

src/Hakyll/Web/Pandoc.hs:49:34:
    Couldn't match type ‘Either Text.Pandoc.Error.PandocError Pandoc’
                   with ‘Pandoc’
    Expected type: String -> Pandoc
      Actual type: String
                   -> Either Text.Pandoc.Error.PandocError Pandoc
    In the first argument of ‘fmap’, namely
      ‘(reader ropt (itemFileType item))’
    In the expression: fmap (reader ropt (itemFileType item)) item
@jaspervdj

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Apr 12, 2015

Owner

I can't switch Hakyll over to 1.14 before it goes on Hackage though...

Owner

jaspervdj commented Apr 12, 2015

I can't switch Hakyll over to 1.14 before it goes on Hackage though...

@pbrisbin

This comment has been minimized.

Show comment
Hide comment
@pbrisbin

pbrisbin Apr 12, 2015

I was able to get Hakyll bulding on 7.10 (albeit with many redundant import warnings) with this:

diff --git i/hakyll.cabal w/hakyll.cabal
index 53c89bc..a8b9721 100644
--- i/hakyll.cabal
+++ w/hakyll.cabal
@@ -158,8 +158,8 @@ Library
     network-uri        >= 2.6     && < 2.7,
     old-locale         >= 1.0     && < 1.1,
     old-time           >= 1.0     && < 1.2,
-    pandoc             >= 1.12.4  && < 1.14,
-    pandoc-citeproc    >= 0.4     && < 0.7,
+    pandoc             >= 1.12.4  && < 1.15,
+    pandoc-citeproc    >= 0.4     && < 0.8,
     parsec             >= 3.0     && < 3.2,
     process            >= 1.0     && < 1.3,
     random             >= 1.0     && < 1.2,
diff --git i/src/Hakyll/Web/Pandoc.hs w/src/Hakyll/Web/Pandoc.hs
index a1b8903..1159d6d 100644
--- i/src/Hakyll/Web/Pandoc.hs
+++ w/src/Hakyll/Web/Pandoc.hs
@@ -1,5 +1,6 @@
 --------------------------------------------------------------------------------
 -- | Module exporting convenient pandoc bindings
+{-# LANGUAGE CPP #-}
 module Hakyll.Web.Pandoc
     ( -- * The basic building blocks
       readPandoc
@@ -46,7 +47,14 @@ readPandoc = readPandocWith defaultHakyllReaderOptions
 readPandocWith :: ReaderOptions  -- ^ Parser options
                -> Item String    -- ^ String to read
                -> Item Pandoc    -- ^ Resulting document
-readPandocWith ropt item = fmap (reader ropt (itemFileType item)) item
+readPandocWith ropt item =
+    let convert = reader ropt (itemFileType item)
+#if MIN_VERSION_pandoc(1,14,0)
+    in fmap (either (error . show) id . convert) item
+#else
+    in fmap convert item
+#endif
+
   where
     reader ro t = case t of
         DocBook            -> readDocBook ro

(and the current git versions of pandoc and pandoc-citeproc available to the sandbox)

AFAICT this supports both versions and could be released today without making anything worse. Then, once the pandoc packages do release (or for those of us add-sourceing them), it'll just start working.

pbrisbin commented Apr 12, 2015

I was able to get Hakyll bulding on 7.10 (albeit with many redundant import warnings) with this:

diff --git i/hakyll.cabal w/hakyll.cabal
index 53c89bc..a8b9721 100644
--- i/hakyll.cabal
+++ w/hakyll.cabal
@@ -158,8 +158,8 @@ Library
     network-uri        >= 2.6     && < 2.7,
     old-locale         >= 1.0     && < 1.1,
     old-time           >= 1.0     && < 1.2,
-    pandoc             >= 1.12.4  && < 1.14,
-    pandoc-citeproc    >= 0.4     && < 0.7,
+    pandoc             >= 1.12.4  && < 1.15,
+    pandoc-citeproc    >= 0.4     && < 0.8,
     parsec             >= 3.0     && < 3.2,
     process            >= 1.0     && < 1.3,
     random             >= 1.0     && < 1.2,
diff --git i/src/Hakyll/Web/Pandoc.hs w/src/Hakyll/Web/Pandoc.hs
index a1b8903..1159d6d 100644
--- i/src/Hakyll/Web/Pandoc.hs
+++ w/src/Hakyll/Web/Pandoc.hs
@@ -1,5 +1,6 @@
 --------------------------------------------------------------------------------
 -- | Module exporting convenient pandoc bindings
+{-# LANGUAGE CPP #-}
 module Hakyll.Web.Pandoc
     ( -- * The basic building blocks
       readPandoc
@@ -46,7 +47,14 @@ readPandoc = readPandocWith defaultHakyllReaderOptions
 readPandocWith :: ReaderOptions  -- ^ Parser options
                -> Item String    -- ^ String to read
                -> Item Pandoc    -- ^ Resulting document
-readPandocWith ropt item = fmap (reader ropt (itemFileType item)) item
+readPandocWith ropt item =
+    let convert = reader ropt (itemFileType item)
+#if MIN_VERSION_pandoc(1,14,0)
+    in fmap (either (error . show) id . convert) item
+#else
+    in fmap convert item
+#endif
+
   where
     reader ro t = case t of
         DocBook            -> readDocBook ro

(and the current git versions of pandoc and pandoc-citeproc available to the sandbox)

AFAICT this supports both versions and could be released today without making anything worse. Then, once the pandoc packages do release (or for those of us add-sourceing them), it'll just start working.

@duk3luk3

This comment has been minimized.

Show comment
Hide comment
@duk3luk3

duk3luk3 Apr 17, 2015

Plain cabal install hakyll works now. It seems pandoc has caught up.

duk3luk3 commented Apr 17, 2015

Plain cabal install hakyll works now. It seems pandoc has caught up.

@srid

This comment has been minimized.

Show comment
Hide comment
@srid

srid Apr 24, 2015

I'm seeing this in CircleCI.com (which appears to use ghc 7.8):

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: www-srid-ca-0.1.0.0 (user goal)
trying: hakyll-4.6.8.1 (dependency of www-srid-ca-0.1.0.0)
trying: text-1.2.0.4 (dependency of hakyll-4.6.8.1)
trying: pandoc-citeproc-0.6.0.1 (dependency of hakyll-4.6.8.1)
trying: xml-conduit-1.2.4 (dependency of pandoc-citeproc-0.6.0.1)
trying: conduit-extra-1.1.7.2 (dependency of xml-conduit-1.2.4)
trying: streaming-commons-0.1.12 (dependency of conduit-extra-1.1.7.2)
trying: zlib-0.6.1.0 (dependency of streaming-commons-0.1.12)
next goal: pandoc (dependency of hakyll-4.6.8.1)
rejecting: pandoc-1.13.2.1, 1.13.2 (conflict: zlib==0.6.1.0, pandoc =>
zlib>=0.5 && <0.6)
rejecting: pandoc-1.13.1, 1.13.0.1, 1.13, 1.12.4.2, 1.12.4 (conflict:
text==1.2.0.4, pandoc => text>=0.11 && <1.2)
rejecting: pandoc-1.12.3.3, 1.12.3.2, 1.12.3.1, 1.12.3, 1.12.2.1, 1.12.2,
1.12.1, 1.12.0.2, 1.12.0.1, 1.12, 1.11.1, 1.11, 1.10.1, 1.10.0.5, 1.10.0.4,
1.10.0.3, 1.10.0.2, 1.10.0.1, 1.10, 1.9.4.5, 1.9.4.4, 1.9.4.3, 1.9.4.2,
1.9.4.1, 1.9.4, 1.9.3, 1.9.2, 1.9.1.2, 1.9.1.1, 1.9.1, 1.9.0.5, 1.9.0.4,
1.9.0.3, 1.9.0.2, 1.9, 1.8.2.1, 1.8.2, 1.8.1.2, 1.8.1.1, 1.8.1, 1.8.0.3,
1.8.0.2, 1.8.0.1, 1.8, 1.6.0.1, 1.6, 1.5.1.1, 1.5.1, 1.5.0.1, 1.5, 1.4, 1.3,
1.2.1, 1.2, 1.1, 1.0.0.1, 1.0, 0.46, 0.45, 0.44, 0.43, 0.42, 0.41, 0.4
(conflict: hakyll => pandoc>=1.12.4 && <1.14)
Backjump limit reached (change with --max-backjumps).

srid commented Apr 24, 2015

I'm seeing this in CircleCI.com (which appears to use ghc 7.8):

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: www-srid-ca-0.1.0.0 (user goal)
trying: hakyll-4.6.8.1 (dependency of www-srid-ca-0.1.0.0)
trying: text-1.2.0.4 (dependency of hakyll-4.6.8.1)
trying: pandoc-citeproc-0.6.0.1 (dependency of hakyll-4.6.8.1)
trying: xml-conduit-1.2.4 (dependency of pandoc-citeproc-0.6.0.1)
trying: conduit-extra-1.1.7.2 (dependency of xml-conduit-1.2.4)
trying: streaming-commons-0.1.12 (dependency of conduit-extra-1.1.7.2)
trying: zlib-0.6.1.0 (dependency of streaming-commons-0.1.12)
next goal: pandoc (dependency of hakyll-4.6.8.1)
rejecting: pandoc-1.13.2.1, 1.13.2 (conflict: zlib==0.6.1.0, pandoc =>
zlib>=0.5 && <0.6)
rejecting: pandoc-1.13.1, 1.13.0.1, 1.13, 1.12.4.2, 1.12.4 (conflict:
text==1.2.0.4, pandoc => text>=0.11 && <1.2)
rejecting: pandoc-1.12.3.3, 1.12.3.2, 1.12.3.1, 1.12.3, 1.12.2.1, 1.12.2,
1.12.1, 1.12.0.2, 1.12.0.1, 1.12, 1.11.1, 1.11, 1.10.1, 1.10.0.5, 1.10.0.4,
1.10.0.3, 1.10.0.2, 1.10.0.1, 1.10, 1.9.4.5, 1.9.4.4, 1.9.4.3, 1.9.4.2,
1.9.4.1, 1.9.4, 1.9.3, 1.9.2, 1.9.1.2, 1.9.1.1, 1.9.1, 1.9.0.5, 1.9.0.4,
1.9.0.3, 1.9.0.2, 1.9, 1.8.2.1, 1.8.2, 1.8.1.2, 1.8.1.1, 1.8.1, 1.8.0.3,
1.8.0.2, 1.8.0.1, 1.8, 1.6.0.1, 1.6, 1.5.1.1, 1.5.1, 1.5.0.1, 1.5, 1.4, 1.3,
1.2.1, 1.2, 1.1, 1.0.0.1, 1.0, 0.46, 0.45, 0.44, 0.43, 0.42, 0.41, 0.4
(conflict: hakyll => pandoc>=1.12.4 && <1.14)
Backjump limit reached (change with --max-backjumps).
@jarandaf

This comment has been minimized.

Show comment
Hide comment
@jarandaf

jarandaf Jul 13, 2015

I'm still having trouble trying to install it with ghc 7.10.1 and cabal 1.22.3.0 in a fresh box. I tried to install it with different ghc/cabal versions and got a different compile error every time.

jarandaf commented Jul 13, 2015

I'm still having trouble trying to install it with ghc 7.10.1 and cabal 1.22.3.0 in a fresh box. I tried to install it with different ghc/cabal versions and got a different compile error every time.

@jaspervdj

This comment has been minimized.

Show comment
Hide comment
@jaspervdj

jaspervdj Jul 14, 2015

Owner

Any luck with the new pandoc 1.15?

Owner

jaspervdj commented Jul 14, 2015

Any luck with the new pandoc 1.15?

@jarandaf

This comment has been minimized.

Show comment
Hide comment
@jarandaf

jarandaf Jul 16, 2015

Hi @jaspervdj, I was finally able to install it with Stackage. I had other issues with my small VPS I had to face though: having 1G of RAM seems not enough when compiling hakyll and was always getting OOM errors. I finally was able to solve it by increasing the swap space.

jarandaf commented Jul 16, 2015

Hi @jaspervdj, I was finally able to install it with Stackage. I had other issues with my small VPS I had to face though: having 1G of RAM seems not enough when compiling hakyll and was always getting OOM errors. I finally was able to solve it by increasing the swap space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment