jgm / gitit

A wiki using HAppS, pandoc, and git
GNU General Public License v2.0
2.15k stars 225 forks source link

0.12.3.2: Cabal install failure on Ubuntu 18.04.3 LTS #637

Closed nocko closed 4 years ago

nocko commented 4 years ago

All the dependencies build successfully, but gitit fails

wiki@mms-wiki:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
Resolving dependencies...
Configuring JuicyPixels-3.2.9.5...
Configuring aeson-1.2.4.0...
Building JuicyPixels-3.2.9.5...
Building aeson-1.2.4.0...
Installed JuicyPixels-3.2.9.5
Installed aeson-1.2.4.0
Downloading aeson-pretty-0.8.8...
Downloading doctemplates-0.2.2.1...
Downloading http-conduit-2.3.7.3...
Configuring aeson-pretty-0.8.8...
Downloading pandoc-types-1.17.6.1...
Configuring doctemplates-0.2.2.1...
Configuring http-conduit-2.3.7.3...
Downloading skylighting-core-0.7.7...
Configuring pandoc-types-1.17.6.1...
Downloading uri-bytestring-aeson-0.1.0.7...
Downloading yaml-0.8.32...
Building aeson-pretty-0.8.8...
Building doctemplates-0.2.2.1...
Building http-conduit-2.3.7.3...
Building pandoc-types-1.17.6.1...
Installed doctemplates-0.2.2.1
Configuring skylighting-core-0.7.7...
Configuring yaml-0.8.32...
Installed http-conduit-2.3.7.3
Configuring uri-bytestring-aeson-0.1.0.7...
Installed aeson-pretty-0.8.8
Building skylighting-core-0.7.7...
Building yaml-0.8.32...
Building uri-bytestring-aeson-0.1.0.7...
Installed uri-bytestring-aeson-0.1.0.7
Downloading hoauth2-1.8.7...
Configuring hoauth2-1.8.7...
Building hoauth2-1.8.7...
Installed hoauth2-1.8.7
Installed yaml-0.8.32
Installed skylighting-core-0.7.7
Downloading skylighting-0.7.7...
Configuring skylighting-0.7.7...
Building skylighting-0.7.7...
Installed pandoc-types-1.17.6.1
Downloading texmath-0.11.3...
Configuring texmath-0.11.3...
Building texmath-0.11.3...
Installed skylighting-0.7.7
Installed texmath-0.11.3
Downloading pandoc-2.2.1...
Configuring pandoc-2.2.1...
Building pandoc-2.2.1...
Installed pandoc-2.2.1
Downloading gitit-0.12.3.2...
Configuring gitit-0.12.3.2...
Building gitit-0.12.3.2...
Failed to install gitit-0.12.3.2
Build log ( /home/wiki/.cabal/logs/gitit-0.12.3.2.log ):
cabal: Entering directory '/tmp/cabal-tmp-1321/gitit-0.12.3.2'
Configuring gitit-0.12.3.2...
Building gitit-0.12.3.2...
Preprocessing library gitit-0.12.3.2...
[ 1 of 22] Compiling Paths_gitit      ( dist/build/autogen/Paths_gitit.hs, dist/build/Paths_gitit.o )
[ 2 of 22] Compiling Network.Gitit.Server ( src/Network/Gitit/Server.hs, dist/build/Network/Gitit/Server.o )
[ 3 of 22] Compiling Network.Gitit.Types ( src/Network/Gitit/Types.hs, dist/build/Network/Gitit/Types.o )

src/Network/Gitit/Types.hs:336:1: warning: [-Worphans]
    Orphan instance: instance FromData SessionKey
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.

src/Network/Gitit/Types.hs:373:1: warning: [-Worphans]
    Orphan instance: instance FromReqURI [String]
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
[ 4 of 22] Compiling Network.Gitit.State ( src/Network/Gitit/State.hs, dist/build/Network/Gitit/State.o )
[ 5 of 22] Compiling Network.Gitit.Util ( src/Network/Gitit/Util.hs, dist/build/Network/Gitit/Util.o )
[ 6 of 22] Compiling Network.Gitit.Rpxnow ( src/Network/Gitit/Rpxnow.hs, dist/build/Network/Gitit/Rpxnow.o )
[ 7 of 22] Compiling Network.Gitit.Plugins ( src/Network/Gitit/Plugins.hs, dist/build/Network/Gitit/Plugins.o )

src/Network/Gitit/Plugins.hs:41:5: warning: [-Wdeprecations]
    In the use of ‘defaultCleanupHandler’ (imported from GHC):
    Deprecated: "Cleanup is now done by runGhc/runGhcT"
[ 8 of 22] Compiling Network.Gitit.Page ( src/Network/Gitit/Page.hs, dist/build/Network/Gitit/Page.o )
[ 9 of 22] Compiling Network.Gitit.Framework ( src/Network/Gitit/Framework.hs, dist/build/Network/Gitit/Framework.o )
[10 of 22] Compiling Network.Gitit.Feed ( src/Network/Gitit/Feed.hs, dist/build/Network/Gitit/Feed.o )

src/Network/Gitit/Feed.hs:150:12: error:
    Not in scope: data constructor ‘First’

src/Network/Gitit/Feed.hs:151:12: error:
    Not in scope: data constructor ‘Second’

src/Network/Gitit/Feed.hs:152:12: error:
    Not in scope: data constructor ‘Both’
cabal: Leaving directory '/tmp/cabal-tmp-1321/gitit-0.12.3.2'
cabal: Error: some packages failed to install:
gitit-0.12.3.2 failed during the building phase. The exception was:
ExitFailure 1
wiki@mms-wiki:~$ cabal install gitit
Resolving dependencies...
Configuring gitit-0.12.3.2...
Building gitit-0.12.3.2...
Failed to install gitit-0.12.3.2
Build log ( /home/wiki/.cabal/logs/gitit-0.12.3.2.log ):
cabal: Entering directory '/tmp/cabal-tmp-4702/gitit-0.12.3.2'
Configuring gitit-0.12.3.2...
Building gitit-0.12.3.2...
Preprocessing library gitit-0.12.3.2...
[ 1 of 22] Compiling Paths_gitit      ( dist/build/autogen/Paths_gitit.hs, dist/build/Paths_gitit.o )
[ 2 of 22] Compiling Network.Gitit.Server ( src/Network/Gitit/Server.hs, dist/build/Network/Gitit/Server.o )
[ 3 of 22] Compiling Network.Gitit.Types ( src/Network/Gitit/Types.hs, dist/build/Network/Gitit/Types.o )

src/Network/Gitit/Types.hs:336:1: warning: [-Worphans]
    Orphan instance: instance FromData SessionKey
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.

src/Network/Gitit/Types.hs:373:1: warning: [-Worphans]
    Orphan instance: instance FromReqURI [String]
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
[ 4 of 22] Compiling Network.Gitit.State ( src/Network/Gitit/State.hs, dist/build/Network/Gitit/State.o )
[ 5 of 22] Compiling Network.Gitit.Util ( src/Network/Gitit/Util.hs, dist/build/Network/Gitit/Util.o )
[ 6 of 22] Compiling Network.Gitit.Rpxnow ( src/Network/Gitit/Rpxnow.hs, dist/build/Network/Gitit/Rpxnow.o )
[ 7 of 22] Compiling Network.Gitit.Plugins ( src/Network/Gitit/Plugins.hs, dist/build/Network/Gitit/Plugins.o )

src/Network/Gitit/Plugins.hs:41:5: warning: [-Wdeprecations]
    In the use of ‘defaultCleanupHandler’ (imported from GHC):
    Deprecated: "Cleanup is now done by runGhc/runGhcT"
[ 8 of 22] Compiling Network.Gitit.Page ( src/Network/Gitit/Page.hs, dist/build/Network/Gitit/Page.o )
[ 9 of 22] Compiling Network.Gitit.Framework ( src/Network/Gitit/Framework.hs, dist/build/Network/Gitit/Framework.o )
[10 of 22] Compiling Network.Gitit.Feed ( src/Network/Gitit/Feed.hs, dist/build/Network/Gitit/Feed.o )

src/Network/Gitit/Feed.hs:150:12: error:
    Not in scope: data constructor ‘First’

src/Network/Gitit/Feed.hs:151:12: error:
    Not in scope: data constructor ‘Second’

src/Network/Gitit/Feed.hs:152:12: error:
    Not in scope: data constructor ‘Both’
cabal: Leaving directory '/tmp/cabal-tmp-4702/gitit-0.12.3.2'
cabal: Error: some packages failed to install:
gitit-0.12.3.2 failed during the building phase. The exception was:
ExitFailure 1
wiki@mms-wiki:~$ ghc -v
Glasgow Haskell Compiler, Version 8.0.2, stage 2 booted by GHC version 8.0.2
nocko commented 4 years ago

Stack doesn't seem to even try on the same system:

root@mms-wiki:~# apt install haskell-stack    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  make
Suggested packages:
  make-doc
The following NEW packages will be installed:
  haskell-stack make
0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded.
Need to get 6921 kB of archives.
After this operation, 51.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 make amd64 4.1-9.1ubuntu1 [154 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 haskell-stack amd64 1.5.1-1 [6767 kB]
Fetched 6921 kB in 0s (40.7 MB/s)   
Selecting previously unselected package make.
(Reading database ... 72583 files and directories currently installed.)
Preparing to unpack .../make_4.1-9.1ubuntu1_amd64.deb ...
Unpacking make (4.1-9.1ubuntu1) ...
Selecting previously unselected package haskell-stack.
Preparing to unpack .../haskell-stack_1.5.1-1_amd64.deb ...
Unpacking haskell-stack (1.5.1-1) ...
Setting up make (4.1-9.1ubuntu1) ...
Setting up haskell-stack (1.5.1-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
root@mms-wiki:~# su - wiki
wiki@mms-wiki:~/devel$ git clone https://github.com/jgm/gitit.git
Cloning into 'gitit'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6881 (delta 0), reused 0 (delta 0), pack-reused 6877
Receiving objects: 100% (6881/6881), 2.03 MiB | 24.16 MiB/s, done.
Resolving deltas: 100% (4237/4237), done.
wiki@mms-wiki:~/devel$ cd gitit/   
wiki@mms-wiki:~/devel/gitit$ stack install
Downloaded lts-12.4 build plan.    
AesonException "Error in $.packages.cassava.constraints.flags['bytestring--lt-0_10_4']: Invalid flag name: \"bytestring--lt-0_10_4\""
nocko commented 4 years ago

I updated stack and it worked. I guess gitit 0.12.3.2 just cannot be built with ghc 8.0.2?

wiki@mms-wiki:~/devel/gitit$ stack ghc -- --version   
The Glorious Glasgow Haskell Compilation System, version 8.4.3

The haskell motto should perhaps be: Always bring everything with you and ensure you have a few spare hours.

jgm commented 4 years ago

This due to API change in the filestore package, which should have been marked by a major version bump but wasn't. If you constrain to Diff < 0.4 it should work.

jgm commented 4 years ago

I'm releasing a filestore update which should help with this.

nocko commented 4 years ago

Thank you for looking into it.

jgm commented 4 years ago

The current dev version of gitit should work with both stack and cabal.

capn-freako commented 4 years ago

@jgm , when you said this, above:

The current dev version of gitit should work with both stack and cabal.

Did you mean that, if I:

  1. clone the gitit repo (master branch),
  2. move into the resultant gitit directory, and
  3. execute the following commands, in order:

    1. cabal configure --ghc
    2. cabal build
    3. cabal install

that it should work?

I tried the above and got:

[10 of 22] Compiling Network.Gitit.Page ( src/Network/Gitit/Page.hs, /Users/dbanas/Documents/Projects/gitit/dist-newstyle/build/x86_64-osx/ghc-8.6.5/gitit-0.12.3.2/build/Network/Gitit/Page.o )
[11 of 22] Compiling Network.Gitit.Authentication.Github ( src/Network/Gitit/Authentication/Github.hs, /Users/dbanas/Documents/Projects/gitit/dist-newstyle/build/x86_64-osx/ghc-8.6.5/gitit-0.12.3.2/build/Network/Gitit/Authentication/Github.o )

src/Network/Gitit/Authentication/Github.hs:106:22: error:
    • Couldn't match type ‘BSL.ByteString’ with ‘OAuth2Error OA.Errors’
      Expected type: IO (OAuth2Result OA.Errors GithubUser)
        Actual type: IO (Either BSL.ByteString GithubUser)
    • In the expression: authGetJSON mgr token $ githubUri "/user"
      In an equation for ‘userInfo’:
          userInfo mgr token = authGetJSON mgr token $ githubUri "/user"
    |
106 | userInfo mgr token = authGetJSON mgr token $ githubUri "/user"
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Network/Gitit/Authentication/Github.hs:109:22: error:
    • Couldn't match type ‘BSL.ByteString’ with ‘OAuth2Error OA.Errors’
      Expected type: IO (OAuth2Result OA.Errors [GithubUserMail])
        Actual type: IO (Either BSL.ByteString [GithubUserMail])
    • In the expression:
        authGetJSON mgr token $ githubUri "/user/emails"
      In an equation for ‘mailInfo’:
          mailInfo mgr token
            = authGetJSON mgr token $ githubUri "/user/emails"
    |
109 | mailInfo mgr token = authGetJSON mgr token $ githubUri "/user/emails"
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Network/Gitit/Authentication/Github.hs:114:3: error:
    • Couldn't match type ‘BSL.ByteString’ with ‘OAuth2Error OA.Errors’
      Expected type: IO (OAuth2Result OA.Errors BSL.ByteString)
        Actual type: IO (Either BSL.ByteString BSL.ByteString)
    • In a stmt of a 'do' block: authGetBS mgr token url
      In the expression:
        do let url
                 = githubUri
                     $ "/orgs/" `BS.append` encodeUtf8 githubOrg `BS.append` "/members/"
                         `BS.append` encodeUtf8 gitLogin
           authGetBS mgr token url
      In an equation for ‘orgInfo’:
          orgInfo gitLogin githubOrg mgr token
            = do let url = ...
                 authGetBS mgr token url
    |
114 |   authGetBS mgr token url
    |   ^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build gitit-0.12.3.2 (which is required by exe:gitit from
gitit-0.12.3.2).
jgm commented 4 years ago

looking at our CI, cabal builds seem to be failing now but stack still works.

freiric commented 4 years ago

The cabal version use hoauth2 >= 1.9.0 and the stack -lts 14.14 used hoauth2 = 1.8.9, The type of authGetBS (from hoauth2) changes between these two versions. Having a look at it.

freiric commented 4 years ago

@capn-freako, I have been able to cabal install gitit by modifying in the file gitit.cabal the lines in the buil-depends section mentioning pandoc, hoauth2 and network:

 pandoc >= 2.8 && < 2.9,
  ...
 hoauth2 >= 1.3.0 && < 1.9,
 ...
 network >= 2.6 && < 2.7,

@jgm , if you think this work on the cabal build is worth a PR, I can submit one. ... There will be more work to upgrade the stack build...

capn-freako commented 4 years ago

@freiric , Thank you!

I am confirming that I was able to complete a cabal build/install, using the suggested modifications to gitit.cabal. -db

capn-freako commented 4 years ago

Oh, I spoke too soon. I'm getting the following run-time error, when I try to launch my newly built gitit executable:

$ /Users/dbanas/.cabal/bin/gitit -f wikidata/my.conf
Could not read mime types file: /etc/mime.types
/etc/mime.types: openFile: does not exist (No such file or directory)
Using defaults instead.
Loading plugin 'Network.Gitit.Plugin.Ordinal'...
gitit: Could not find module ‘Network.Gitit.Plugin.Ordinal’
Use -v to see a list of the files searched for.
Could not find module ‘Network.Gitit.Interface’
Use -v to see a list of the files searched for.

The Network.Gitit.Plugin.Ordinal module does appear to be missing from the build/... tree, but the Network.Gitit.Interface module is there.

jgm commented 4 years ago

@freiric - sure, PR welcome. (Or even better an upgrade to use the latest versions rather than setting an upper bound.) stack build works for me already though.

jgm commented 4 years ago

Network.Gitit.Plugin.Ordinal is not part of gitit. This must be a 3rd party plugin you're trying to use. Check your conf.

capn-freako commented 4 years ago

Apologies; you are correct. It (cabal-ified) is working fine. Thanks! :)

freiric commented 4 years ago

Should be fixed by #646

conal commented 4 years ago

I just installed GHC 8.8.3 and did "cabal update" followed by "cabal install gitit" and got the following failure:

bash-3.2$ which ghc
/usr/local/ghc-versions/8.8.3/bin/ghc
bash-3.2$ cabal update
Downloading the latest package list from hackage.haskell.org
To revert to previous state run:
    cabal v2-update 'hackage.haskell.org,2020-03-08T16:48:38Z'
bash-3.2$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
bash-3.2$ cabal install gitit
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: gitit-0.12.3.2 (user goal)
[__1] trying: zlib-0.6.2.1 (dependency of gitit)
[__2] trying: parsec-3.1.14.0/installed-3.1... (dependency of gitit)
[__3] next goal: pandoc-types (dependency of gitit)
[__3] rejecting: pandoc-types-1.20 (conflict: gitit => pandoc-types>=1.17.4.2
&& <1.18)
[__3] trying: pandoc-types-1.17.6.1
[__4] next goal: pandoc (dependency of gitit)
[__4] rejecting: pandoc-2.9.2, pandoc-2.9.1.1, pandoc-2.9.1, pandoc-2.9,
pandoc-2.8.1, pandoc-2.8.0.1, pandoc-2.8 (conflict: pandoc-types==1.17.6.1,
pandoc => pandoc-types>=1.20 && <1.21)
[__4] trying: pandoc-2.7.3
[__5] next goal: haddock-library (dependency of pandoc)
[__5] rejecting: haddock-library-1.8.0 (conflict: pandoc =>
haddock-library>=1.7 && <1.8)
[__5] rejecting: haddock-library-1.7.0 (conflict: parsec =>
base==4.13.0.0/installed-4.1..., haddock-library => base>=4.5 && <4.13)
[__5] rejecting: haddock-library-1.6.0, haddock-library-1.5.0.1,
haddock-library-1.4.5, haddock-library-1.4.4, haddock-library-1.4.3,
haddock-library-1.4.2, haddock-library-1.4.1, haddock-library-1.2.1,
haddock-library-1.2.0, haddock-library-1.1.1, haddock-library-1.1.0,
haddock-library-1.0.1, haddock-library-1.0.0, haddock-library-1.6.1 (conflict:
pandoc => haddock-library>=1.7 && <1.8)
[__5] fail (backjumping, conflict set: haddock-library, pandoc, parsec)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: pandoc, haddock-library, pandoc-types,
gitit, base, parsec, binary, zlib
Try running with --minimize-conflict-set to improve the error message.

bash-3.2$ cabal install gitit --minimize-conflict-set
Resolving dependencies...
cabal: Reached backjump limit while trying to minimize the conflict set to
create a better error message. Original error message:
Could not resolve dependencies:
[__0] trying: gitit-0.12.3.2 (user goal)
[__1] trying: zlib-0.6.2.1 (dependency of gitit)
[__2] trying: parsec-3.1.14.0/installed-3.1... (dependency of gitit)
[__3] next goal: pandoc-types (dependency of gitit)
[__3] rejecting: pandoc-types-1.20 (conflict: gitit => pandoc-types>=1.17.4.2
&& <1.18)
[__3] trying: pandoc-types-1.17.6.1
[__4] next goal: pandoc (dependency of gitit)
[__4] rejecting: pandoc-2.9.2, pandoc-2.9.1.1, pandoc-2.9.1, pandoc-2.9,
pandoc-2.8.1, pandoc-2.8.0.1, pandoc-2.8 (conflict: pandoc-types==1.17.6.1,
pandoc => pandoc-types>=1.20 && <1.21)
[__4] trying: pandoc-2.7.3
[__5] next goal: haddock-library (dependency of pandoc)
[__5] rejecting: haddock-library-1.8.0 (conflict: pandoc =>
haddock-library>=1.7 && <1.8)
[__5] rejecting: haddock-library-1.7.0 (conflict: parsec =>
base==4.13.0.0/installed-4.1..., haddock-library => base>=4.5 && <4.13)
[__5] rejecting: haddock-library-1.6.0, haddock-library-1.5.0.1,
haddock-library-1.4.5, haddock-library-1.4.4, haddock-library-1.4.3,
haddock-library-1.4.2, haddock-library-1.4.1, haddock-library-1.2.1,
haddock-library-1.2.0, haddock-library-1.1.1, haddock-library-1.1.0,
haddock-library-1.0.1, haddock-library-1.0.0, haddock-library-1.6.1 (conflict:
pandoc => haddock-library>=1.7 && <1.8)
[__5] fail (backjumping, conflict set: haddock-library, pandoc, parsec)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: pandoc, haddock-library, pandoc-types,
gitit, base, parsec, binary, zlib

Same (or similar) result from "cabal new-install" and with a current clone of the gitit repo.

Am I using the wrong build incantation? Or maybe too fresh a GHC 8.8.x?

jgm commented 4 years ago

Looks like it's failing on our GitHub Actions CI as well for GHC 8.8. This is unexpected, since the PR I merged claimed to be supporting 8.8. I'll comment over on #646

octalsrc commented 4 years ago

@conal Does running cabal build in the current clone of the gitit repo (if current, should show as gitit-0.13.0.0) complain about the library MissingH in its error message?

The inability to build MissingH using GHC 8.8.x is an outstanding problem for https://github.com/jgm/gitit/pull/646.

conal commented 4 years ago

@conal Does running cabal build in the current clone of the gitit repo (if current, should show as gitit-0.13.0.0) complain about the library MissingH in its error message?

Yes it does (with a fresh git pull).

jgm commented 4 years ago

Has anyone taken any steps to try to get MissingH fixed in Hackage so that it works with GHC 8.8.x? It's not a direct dependency of gitit -- which of our dependencies requires it?

EDIT: https://github.com/haskell-hvr/missingh/issues/52

octalsrc commented 4 years ago

There is also https://github.com/haskell-hvr/missingh/pull/51 which has been open with no response from the dev since November, and https://github.com/haskell-infra/hackage-trustees/issues/253.

Gitit depends on it through gitit -> ConfigFile -> MissingH.

jgm commented 4 years ago

Might be easier to rewrite Network.Gitit.Config to avoid the dependency than to get this fixed. I don't have time for this but maybe someone else would want to. Looks like https://hackage.haskell.org/package/ini does something similar to ConfigFile with saner dependencies.

octalsrc commented 4 years ago

MissingH has updated and released, so rerunning the gitit CI build now should have it succeed on GHC 8.8.

jgm commented 4 years ago

I'll rerun them.