Installing pandoc, pandoc-citeproc-preamble, etc.
Describes my adventures of installing pandoc and tools
The following lines document how I tried to upgrade pandoc and some people might encounter the same issues as me. No value for anyone else.
I use pandoc, which is a pain to install manually. For the desparate stumbler upon my page and to jump right to a conclusion, I do not use cabal, but stack, as outlined here: https://pandoc.org/installing.html, I also use https://github.com/lierdakil/pandoc-crossref, which I cloned and in there I ran stack setup;stack install: it takes ages.
After I tried to use pandoc-citeproc-preamble, I ran into some serious version mismatches and ended up deep in the haskell toolchain. I decided to (try to) redo the installation. The following lines document my journey.
apt-get install haskell-platform
As a result, cabal seems to work. Hence, I tried to update cabal:
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal update
Downloading the latest package list from hackage.haskell.org
ustaudinger@stormtrader:~/Sync/webserver/managementletters$
Ok, next I tried to install pandoc through cabal:
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal install pandoc --enable-tests --force-reinstalls
Resolving dependencies...
Warning: The following packages are likely to be broken by the reinstalls:
texmath-0.9.4.4
http-client-0.5.7.0
HTTP-4000.3.7
regex-compat-0.95.1
resourcet-1.1.9
Continuing even though the plan contains dangerous reinstalls.
Downloading Diff-0.3.4...
Downloading ansi-terminal-0.6.3.1...
Downloading executable-path-0.0.3.1...
Configuring JuicyPixels-3.2.8.3...
Configuring blaze-html-0.8.1.3...
Failed to install JuicyPixels-3.2.8.3
Build log ( /home/ustaudinger/.cabal/logs/JuicyPixels-3.2.8.3.log ):
Downloading hostname-1.0...
Configuring haddock-library-1.4.3...
Configuring pem-0.2.2...
Configuring regex-base-0.93.2...
Downloading tagsoup-0.14.2...
...
... downloading and building even more packages
...
Installed texmath-0.8.6.7
cabal: Error: some packages failed to install:
JuicyPixels-3.2.8.3 failed during the configure step. The exception was:
user error (The package 'JuicyPixels' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
asn1-encoding-0.9.5 depends on memory-0.14.8 which failed to install.
asn1-parse-0.9.4 depends on memory-0.14.8 which failed to install.
asn1-types-0.3.2 depends on memory-0.14.8 which failed to install.
connection-0.2.8 depends on memory-0.14.8 which failed to install.
cryptonite-0.24 depends on memory-0.14.8 which failed to install.
filemanip-0.3.6.3 depends on unix-compat-0.5.0.1 which failed to install.
haddock-library-1.4.3 failed during the final install step. The exception was:
/tmp/pkgConf-haddock-library-1.427424.3: hGetContents: invalid argument
(invalid byte sequence)
hslua-0.3.13 failed during the final install step. The exception was:
/tmp/pkgConf-hslua-0.327424.13: hGetContents: invalid argument (invalid byte
sequence)
http-client-tls-0.3.5.1 depends on memory-0.14.8 which failed to install.
memory-0.14.8 failed during the configure step. The exception was:
user error (The package 'memory' requires Cabal library version -any && >=1.18
but no suitable version is installed.)
pandoc-1.17.2 depends on memory-0.14.8 which failed to install.
tagsoup-0.14.2 failed during the configure step. The exception was:
user error (The package 'tagsoup' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
tls-1.3.10 depends on memory-0.14.8 which failed to install.
unix-compat-0.5.0.1 failed during the final install step. The exception was:
/tmp/pkgConf-unix-compat-0.5.027424.1: hGetContents: invalid argument (invalid
byte sequence)
x509-1.7.0 depends on memory-0.14.8 which failed to install.
x509-store-1.6.3 depends on memory-0.14.8 which failed to install.
x509-system-1.6.6 depends on memory-0.14.8 which failed to install.
x509-validation-1.6.8 depends on memory-0.14.8 which failed to install.
ustaudinger@stormtrader:~/Sync/webserver/managementletters$
As you can see, this failed. So I googled for the error message and found a github posting. The posting suggests that this failure might be related to a failing test. So, next try without enabling tests.
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal install pandoc --force-reinstallsResolving dependencies...
Warning: The following packages are likely to be broken by the reinstalls:
regex-posix-0.95.2
test-framework-0.8.1.1
test-framework-quickcheck2-0.3.0.4
test-framework-hunit-0.3.0.2
regex-compat-0.95.1
ansi-wl-pprint-0.6.8.1
Continuing even though the plan contains dangerous reinstalls.
Configuring haddock-library-1.4.3...
Configuring JuicyPixels-3.2.8.3...
Configuring memory-0.14.8...
Failed to install JuicyPixels-3.2.8.3
Build log ( /home/ustaudinger/.cabal/logs/JuicyPixels-3.2.8.3.log ):
Configuring pem-0.2.2...
Failed to install memory-0.14.8
Build log ( /home/ustaudinger/.cabal/logs/memory-0.14.8.log ):
Configuring regex-base-0.93.2...
Configuring parsec-3.1.11...
...
This indicated that JuicyPixels failed already. So I tried to install JuicyPixels alone.
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal install JuicyPixels
Resolving dependencies...
Configuring JuicyPixels-3.2.8.3...
Failed to install JuicyPixels-3.2.8.3
Build log ( /home/ustaudinger/.cabal/logs/JuicyPixels-3.2.8.3.log ):
cabal: Error: some packages failed to install:
JuicyPixels-3.2.8.3 failed during the configure step. The exception was:
user error (The package 'JuicyPixels' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
But I have cabal, I thought! This lead me to another github post, suggesting I need to install Cabal (mind the capital ‘C’). So, I do use cabal, but lacked library Cabal. Goodness. Next go.
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal install Cabal
Resolving dependencies...
Downloading Cabal-2.0.1.1...
Configuring Cabal-2.0.1.1...
Building Cabal-2.0.1.1...
Warning: /tmp/pkgConf-Cabal-2.0.125371.1: Unrecognized field abi-depends on
line 138
/tmp/pkgConf-Cabal-2.0.125371.1: Unrecognized field data-dir on line 123
/tmp/pkgConf-Cabal-2.0.125371.1: Unrecognized field abi on line 118
/tmp/pkgConf-Cabal-2.0.125371.1: Unrecognized field indefinite on line 20
/tmp/pkgConf-Cabal-2.0.125371.1: Unrecognized field key on line 4
Installed Cabal-2.0.1.1
ustaudinger@stormtrader:~/Sync/webserver/managementletters$
Ok, now let’s try to install JuicyPixels (whatever that is). Note, everything takes ages with haskell, cabal and ghc. It’s so bad that I googled for haskell compiler performance and found dozens of posts complaining about the very poor compile time performance of haskell. Yep, I can agree. I wouldn’t touch haskell and ghc with a ten-feet pole because of compile time issues, just because of these issues!
Well, 35 minutes (!!) later, cabal failed with some other message. Now the culprit is unix-compat. Same story like before, very generic error message (invalid byte sequence). Failing due to some locale not set properly? In fifteen years with Linux, I have never seen this error - never (github post). Next culprit, hslua … and hadock-library. Each of these I installed individually to get to the root cause of their failure. Ok, so all of these libs failed because of some invalid byte sequences in some of their source files. And apparently haskell takes the system variable LANG into some consideration.
Now, let’s retry installing pandoc …
ustaudinger@stormtrader:~/Sync/webserver/managementletters$ cabal install pandoc
Resolving dependencies...
In order, the following will be installed:
filemanip-0.3.6.3 (new package)
haddock-library-1.4.3 (reinstall) changes: bytestring-0.10.8.2 -> 0.10.0.2
hslua-0.3.13 (latest: 0.9.3) (new version)
pandoc-1.17.2 (latest: 2.0.6) +old-locale (new package)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Downloading filemanip-0.3.6.3...
Configuring haddock-library-1.4.3...
Configuring hslua-0.3.13...
Configuring filemanip-0.3.6.3...
Building hslua-0.3.13...
Building haddock-library-1.4.3...
Building filemanip-0.3.6.3...
Warning: /tmp/pkgConf-filemanip-0.3.617819.3: Unrecognized field abi-depends
on line 34
/tmp/pkgConf-filemanip-0.3.617819.3: Unrecognized field data-dir on line 25
/tmp/pkgConf-filemanip-0.3.617819.3: Unrecognized field abi on line 20
/tmp/pkgConf-filemanip-0.3.617819.3: Unrecognized field indefinite on line 16
/tmp/pkgConf-filemanip-0.3.617819.3: Unrecognized field key on line 4
Installed filemanip-0.3.6.3
Warning: /tmp/pkgConf-hslua-0.317819.13: Unrecognized field abi-depends on
line 32
/tmp/pkgConf-hslua-0.317819.13: Unrecognized field data-dir on line 27
/tmp/pkgConf-hslua-0.317819.13: Unrecognized field abi on line 22
/tmp/pkgConf-hslua-0.317819.13: Unrecognized field indefinite on line 19
/tmp/pkgConf-hslua-0.317819.13: Unrecognized field key on line 4
Installed hslua-0.3.13
Warning: /tmp/pkgConf-haddock-library-1.417819.3: Unrecognized field
abi-depends on line 42
/tmp/pkgConf-haddock-library-1.417819.3: Unrecognized field data-dir on line
35
/tmp/pkgConf-haddock-library-1.417819.3: Unrecognized field abi on line 30
/tmp/pkgConf-haddock-library-1.417819.3: Unrecognized field indefinite on line
19
/tmp/pkgConf-haddock-library-1.417819.3: Unrecognized field key on line 4
Installed haddock-library-1.4.3
Downloading pandoc-1.17.2...
Configuring pandoc-1.17.2...
Failed to install pandoc-1.17.2
Build log ( /home/ustaudinger/.cabal/logs/pandoc-1.17.2.log ):
cabal: Error: some packages failed to install:
pandoc-1.17.2 failed during the configure step. The exception was:
user error (
/tmp/pandoc-1.17.2-17819/pandoc-1.17.2/dist/setup/setup.hs:49:39:
Not in scope: data constructor `FlagName'
)
ustaudinger@stormtrader:~/Sync/webserver/managementletters$
Not in scope: data constructor `FlagName’ ??? Ok, github posting says something about cabal version .. let’s try upgrading cabal: cabal install cabal-install. Goodness. 20 minutes later. Ok … I gave up for today.
Next day.
After careful reflection, I decided to download the latest ghc from the Glasgow Haskell Compiler. Of course, just unpacking and following the manual didn’t work, what else would one expect from Haskell? To be precise, grab a release .tar.gz archive and unpack it. Several folders will be empty, hence the boot command won’t work. Anyway, so deep into this story, I decided to clone the git repository. En voila, that pulled in these empty folders, because the ghc repository contained cross-links/tags to other libraries’ git repository. That’s quite smart, I must admit. Anyway, not as written in the manual. Next, boot, configure, and make succeeded.
In the meantime, I decided to try stack instead of cabal and surprise, surprise, stack decided to install pandoc-citeproc-preamble without any complaints. What a waste of time.