Re: [hakyll] Installing Hakyll in Arch Linux from unofficial repositories

337 views
Skip to first unread message

Ian Ross

unread,
Oct 11, 2012, 2:26:26 PM10/11/12
to hak...@googlegroups.com
I'm also using Arch Linux on x86_64. I would strongly recommend *not*
using the Arch packages for most Haskell things. I use hsenv instead.
The arch-haskell effort is well-intentioned, but I'm not convinced
that it's the right way to go -- it's just too much work for a few
people to maintain Arch versions of all the Haskell packages.

To use hsenv, install just the Arch packages for ghc and cabal-install
(and happy too, in case it's needed for anything you use
subsequently), then do a cabal update, cabal install hsenv, and from
then on, do everything in hsenv sandboxes. For example, if your blog
code is in directory blog, you do something like:

# Create the hsenv sandbox.
cd blog
hsenv

# Activate the sandbox.
source .hsenv_blog/bin/activate

# Install Hakyll (and all its dependencies) in the sandbox.
cabal install hakyll

# Build your code.
cabal configure hakyllx
cabal install hakyllx

I went through quite a few rounds of "install GHC, install Cabal,
install lots of inconsistent packages until things are completely
screwed up, blow everything away, start again" before I discovered
hsenv. I suffer no more pain from Haskell dependency hell, which
leaves me much more free time to cause my own problems...

If you have any questions about hsenv, drop me a line.

Cheers,

Ian.


On 11 October 2012 20:15, <hx....@gmail.com> wrote:
> I can't install Hakyll in my computer using the cabal install method and I
> tried with the [haskell] and [haskell-extra] repositories.
> It seems like it works, but when I try to compile the file hakyll.hs in the
> brochure example, ghc can't link it.
> The cabal method doesn't work too, saying:
>
> $ cabal install hakyllx
> Resolving dependencies...
> In order, the following would be installed:
> pandoc-1.9.4.2 +blaze_html_0_5 (reinstall) changes: HTTP-4000.2.4 ->
> 4000.2.5,
> tagsoup-0.12.7 -> 0.12.8
> hakyll-3.4.2.1 (reinstall) changes: blaze-markup-0.5.1.1 -> 0.5.1.0,
> hamlet-1.0.1.4 -> 1.1.0.2, snap-core-0.9.2.1 -> 0.8.1, snap-server-0.9.2.3
> ->
> 0.8.1.1
> cabal: The following packages are likely to be broken by the reinstalls:
> hakyll-3.4.2.0
> hakyll-3.4.1.0
> gitit-0.10.0.1
> Use --force-reinstalls if you want to install anyway.
>
> I tried again with --force-reinstalls option:
> $ cabal install hakyll --force-reinstalls
> Resolving dependencies...
> Warning: The following packages are likely to be broken by the reinstalls:
> hakyll-3.4.2.0
> hakyll-3.4.1.0
> gitit-0.10.0.1
> Continuing even though the plan contains dangerous reinstalls.
> [1 of 1] Compiling Main (
> /tmp/pandoc-1.9.4.2-12598/pandoc-1.9.4.2/Setup.hs,
> /tmp/pandoc-1.9.4.2-12598/pandoc-1.9.4.2/dist/setup/Main.o )
>
> /tmp/pandoc-1.9.4.2-12598/pandoc-1.9.4.2/Setup.hs:1:1:
> Warning: In the use of `catch'
> (imported from Prelude, but defined in System.IO.Error):
> Deprecated: "Please use the new exceptions variant,
> Control.Exception.catch"
>
> /tmp/pandoc-1.9.4.2-12598/pandoc-1.9.4.2/Setup.hs:1:1:
> Warning: In the use of `runTests'
> (imported from Distribution.Simple, but defined in
> Distribution.Simple.UserHooks):
> Deprecated: "Please use the new testing interface instead!"
> Linking /tmp/pandoc-1.9.4.2-12598/pandoc-1.9.4.2/dist/setup/setup ...
> Configuring pandoc-1.9.4.2...
> Warning: This package indirectly depends on multiple versions of the same
> package. This is highly likely to cause a compile failure.
> package citeproc-hs-0.3.4 requires HTTP-4000.2.4
> package pandoc-1.9.4.2 requires HTTP-4000.2.5
> Building pandoc-1.9.4.2...
> Preprocessing executable 'pandoc' for pandoc-1.9.4.2...
>
> src/pandoc.hs:60:8:
> Could not find module `Text.CSL.Reference'
> There are files missing in the `citeproc-hs-0.3.4' package,
> try running 'ghc-pkg check'.
> Use -v to see a list of the files searched for.
> Failed to install pandoc-1.9.4.2
> cabal: Error: some packages failed to install:
> hakyll-3.4.2.1 depends on pandoc-1.9.4.2 which failed to install.
> pandoc-1.9.4.2 failed during the building phase. The exception was:
> ExitFailure 1
>
> This is the message that ghc returns when I try to compile hakyll.hs
>
> $ ghc --make hakyll.hs
>
> hakyll.hs:4:8:
> Could not find module `Hakyll'
> There are files missing in the `hakyll-3.4.2.0' package,
> try running 'ghc-pkg check'.
> Use -v to see a list of the files searched for.
>
> Running a ghc-pkg check returns a long, long output with missing files.
>
> I'm using ghc 7.4.2 from [haskell] repository, in [extra] ghc is in version
> 7.6.1. The package haskell-platform is not available since the update to
> 7.6.1, and I tried to build haskell-platform with the binary tarball. I
> couldn't. Compiling errors in some libraries.
>
> I think it's a problem with the ghc version, but I can't build ghc. When I
> do this, I get a output saying that I don't have libgmp.so and fails.
> For more details, I'm in ArchLinux x86_64. It seems like hakyll is the only
> package that fails, because I can run pandoc as always.
>
> Thanks.
>



--
Ian Ross Tel: +43(0)6804451378 i...@skybluetrades.net www.skybluetrades.net

Gerardo Morales

unread,
Oct 12, 2012, 1:06:04 PM10/12/12
to hakyll
Well, yesterday the [haskell] repositorie make available ghc 7.6.1,
and it's the same thing. I will try with hsenv until I delete every
package from the arch-haskell.
Thanks. I will post here if it works.

Bardur Arantsson

unread,
Oct 12, 2012, 3:14:39 PM10/12/12
to hak...@googlegroups.com
On 10/12/2012 07:06 PM, Gerardo Morales wrote:
> Well, yesterday the [haskell] repositorie make available ghc 7.6.1,
> and it's the same thing. I will try with hsenv until I delete every
> package from the arch-haskell.
> Thanks. I will post here if it works.
>

It won't. hsenv itself as of current git has problems with GHC 7.6.1,
but you'll also run into

https://bugs.archlinux.org/task/31864


Ian Ross

unread,
Oct 13, 2012, 5:53:59 AM10/13/12
to hak...@googlegroups.com
Here's what I did to have a sane Haskell development environment in
Arch x86_64 after the latest GHC upgrade didn't work:

- Remove the ghc and cabal-install Arch packages.

- Remove any ~/.cabal or ~/.ghc directories.

- Download the last known good packages from the Arch Rollback Machine:

http://arm.konnichi.com/extra/os/x86_64/ghc-7.4.2-1-x86_64.pkg.tar.xz
http://arm.konnichi.com/extra/os/x86_64/cabal-install-0.14.0-2-x86_64.pkg.tar.xz

- Install these packages using "pacman -U".

- cabal update

- cabal install hsenv

From then on, do everything using hsenv sandboxes (i.e. don't install
anything to your global or user-local Cabal directories). You can
install Arch packages for things like happy that don't have any
Haskell dependencies, but don't install any genuine Haskell packages
using pacman.

Note that if you do this, you have to be careful with pacman updates.
If you do "pacman -Su", pacman will try to upgrade the ghc and
cabal-install packages. You need to say "pacman -Su --ignore
ghc,cabal-install" instead.

It's not an ideal solution, and hopefully we can go back to using the
latest Arch packages soon, but this works and is pretty painless.

Cheers,

Ian.

On 13 October 2012 05:28, <hx....@gmail.com> wrote:
> You're right. I cloned the git repo in the morning and it did'nt work. I
> don't know what to do. Ideas?
> (I delete all haskell packages, arch-haskell repos, ~/.cabal dir and now I
> can't build pandoc as always. Dependency error)

Ian Ross

unread,
Oct 15, 2012, 4:51:04 AM10/15/12
to hak...@googlegroups.com
> 1. Can I install hakyll over hsenv in the hakyll-examples directory,
> activate the environment and run it from a subdirectory? It's a long install
> for all projects.

The way I think of it is this: if your set of projects is P with
elements p_i, 1 <= i <= n, partition S into sets S_j, 1 <= j <= m,
where all projects within each S_j have mutually compatible package
dependencies, and for all pairs of projects p_a \in S_a, p_b \in S_b,
a /= b, p_a and p_b have mutually incompatible package dependencies.
You then need at least m hsenv sandboxes. Within that constraint, you
can work how you like: one sandbox per project, or sandboxes shared
between multiple projects with mutually compatible package
dependencies. I'm still experimenting, but at the moment I have one
sandbox for Hakyll stuff, one for Yesod things, and one for
"everything else". It might be possible to work with less independent
sandboxes, but this setup suits the way I've been working recently.
The extreme case of using a separate sandbox for every project is
guaranteed to work all the time (assuming you don't have any mutually
incompatible package dependencies *within* your project!). In the
case you mention, since all of the Hakyll examples presumably have the
same package dependencies, you can use a single hsenv sandbox in the
way that you describe. Once you've activated a hsenv sandbox, any
cabal or ghc commands you run will use the sandboxed package database
until you deactivate the sandbox.

> 2. Is there a way to have comments without disqus? Even simpler, I just want
> text, nickname and date (optionally markdown support).

I would guess not, at least not in a simple way. Since the pages
generated by Hakyll are static, you need some JavaScript in there to
load dynamic content like comments and you need some server-side code
somewhere to store the comments and serve up the comments for a page.
That's what Disqus (or Livefyre or any of the other alternatives)
does. To do it yourself, you'd have to find or write some sort of
"comment server". Such things may already exist. I don't know. Is
there any particular reason you don't want to use Disqus?

Cheers,

Ian.
Reply all
Reply to author
Forward
0 new messages