As a haskell package, git-annex can be installed using cabal.

This involves building a lot of haskell packages from source, and so it has a lot of moving parts, and it's not uncommon for it to be broken from time to time.

If you are not comfortable tracking down and dealing with library build problems, installing git-annex with cabal is probably not the right choice for you!

prerequisites

Start by installing the Haskell Platform. In Debian, this is as simple as:

sudo apt-get install haskell-platform

minimal build

This builds git-annex without some features that require C libraries, that can be harder to get installed. This is plenty to get started using it, although it does not include the assistant or webapp.

cabal update
PATH=$HOME/bin:$PATH
cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"

full build

To build with all features enabled, including the assistant and webapp, you will need to install several C libraries and their headers, including libgnutls, libgsasl, libxml2, and zlib. Then run:

cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs --bindir=$HOME/bin
cabal install git-annex --bindir=$HOME/bin

building from git checkout

But maybe you want something newer (or older). Then download the version you want, and use cabal as follows inside its source tree:

cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs --bindir=$HOME/bin
cabal install --only-dependencies
cabal configure
cabal build
cabal install --bindir=$HOME/bin

EKG

When building with cabal, you can optionally enable the EKG monitoring interface. This is great for debugging resource usage problems.

After finishing the installation the cabal way, here are the packages I installed. It is possible that there are other packages I installed previously as dependency for other packages.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise

$ apt-get install cabal-install libgnutls28-dev libgsasl7-dev c2hs libghc-libxml-sax-dev zlib1g-dev libghc-zlib-dev
$ cabal install git-annex --bindir=$HOME/bin

I get an error from the command as above: $ sudo apt-get install cabal-install libgnutls28-dev libgsasl7-dev c2hs libghc libxml-sax-dev zlib1g-dev libghc-zlib-dev

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise

If you're installing git-annex with cabal, there is no need to install any haskell library packages with apt-get. That includes libghc-libxml-sax-dev and libghc-zlib-dev. Without those, the apt-get line may work to install the C libraries needed for cabal to install the haskell libraries.

However, see the the Ubuntu page for much easier ways to get git-annex installed.

Comment by http://joeyh.name/ Thu May 30 15:25:29 2013

@Joey Many thanks. I am new to Haskell (vaguely looked at it with DARCS) and git-annex. After installing with apt-get on Ubuntu 12.04 LTS I found webapp was missing, hence have come here. I am going through the correct steps now, it should be awesome when done.

This seems to be a long build process (still going on my old laptop, much longer than apt-get). Ubuntu git-annex packages from 13.10 Saucy I think are updated to include webapp.

At the end of the build I got these errors: Registering yesod-static-1.1.2.3... Installing library in /home/nrb/.cabal/lib/yesod-static-1.1.2.3/ghc-7.4.1 Registering yesod-static-1.1.2.3... cabal: Error: some packages failed to install: c2hs-0.16.4 depends on language-c-0.3.2.1 which failed to install. dbus-0.10.4 depends on libxml-sax-0.7.4 which failed to install. git-annex-4.20130521.2 depends on libxml-sax-0.7.4 which failed to install. language-c-0.3.2.1 failed during the configure step. The exception was: ExitFailure 1 libxml-sax-0.7.4 failed during the configure step. The exception was: ExitFailure 1 network-protocol-xmpp-0.4.5 depends on libxml-sax-0.7.4 which failed to install.

One way I could fix this myself is to put together a VM with 13.10 or Debian in it and work inside that. Or if I can get help to fix my issues here that would be great ;)

Registering yesod-static-1.1.2.3...
Installing library in /home/nrb/.cabal/lib/yesod-static-1.1.2.3/ghc-7.4.1
Registering yesod-static-1.1.2.3...
cabal: Error: some packages failed to install:
c2hs-0.16.4 depends on language-c-0.3.2.1 which failed to install.
dbus-0.10.4 depends on libxml-sax-0.7.4 which failed to install.
git-annex-4.20130521.2 depends on libxml-sax-0.7.4 which failed to install.
language-c-0.3.2.1 failed during the configure step. The exception was:
ExitFailure 1
libxml-sax-0.7.4 failed during the configure step. The exception was:
ExitFailure 1
network-protocol-xmpp-0.4.5 depends on libxml-sax-0.7.4 which failed to
install.

I'm having problems installing from cabal, and it seems related to yesod. I found an older discussion on something similar, where a constraint to require a newer version of yesod had been added, but I haven't figured out what was done to solve it.

The problem seems to be that git-annex requires yesod < 1.2, but cabal is unable to install an older version.

$ cabal install git-annex --bindir=$HOME/bin
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: git-annex-4.20130601
trying: git-annex-4.20130601:+webapp
rejecting: yesod-1.2.1.1, 1.2.1, 1.2.0.1, 1.2.0 (conflict:
git-annex-4.20130601:webapp => yesod(<1.2))
trying: yesod-1.1.9.3
$

From what I can tell, the problem is fixed in github master since yesod >= 1.2 is supported again.

Comment by krig Tue Jun 25 06:14:18 2013
git-annex 4.20130621 once again builds with the current version of yesod.
Comment by http://joeyh.name/ Tue Jun 25 17:16:46 2013

I had - maybe the same problem as Nigel - with ExitFailure 1 libxml-sax-0.7.4 .

I could fix this by forcing the link of libxml2 package with "brew link libxml2 --force". Maybe you should update your guide. I had this problem on 2 different machines running both the current versions of OS X.

After this the build finished successfull. Maybe this helps.

@Henning; see the OSX page for full installation instructions for OSX. Which include all the neccesary brew incantations.
Comment by http://joeyh.name/ Sat Jul 27 17:49:07 2013

I tried various ways to install git-annex on my TonidoPlug.

System Info:

root@TonidoPlug2:~# uname -a
Linux TonidoPlug2 2.6.31.8-topkick1281p2-001-004-20101214 #1 Thu Jun 16 10:06:20 CST 2011 armv5tel GNU/Linux

apt-get didn't work.

root@TonidoPlug2:~# apt-get install git-annex
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package git-annex

The Linux standalone installation results in an error message like this, when calling git-annex (or git annex)

~$ git-annex.linux/git-annex
/home/gitolite/git-annex.linux/bin/git-annex: 1: Syntax error: ")" unexpected

(git-annex.linux/bin/git-annex is a binary file and works fine on other distros)

When installing with cabal, I get the error message (tried as root and gitolite user)

~$ cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"
Resolving dependencies...
cabal: cannot configure git-annex-4.20130802. It requires base >=4.5 && <4.8
For the dependency on base >=4.5 && <4.8 there are these packages:
base-4.5.0.0, base-4.5.1.0, base-4.6.0.0 and base-4.6.0.1. However none of
them are available.
base-4.5.0.0 was excluded because of the top level dependency base -any
base-4.5.1.0 was excluded because of the top level dependency base -any
base-4.6.0.0 was excluded because of the top level dependency base -any
base-4.6.0.1 was excluded because of the top level dependency base -any

Any help is appreciated. Thanks for providing git-annex. I started cleaning up my backups with it yesterday and really like it.

The Linux standalone builds for i386 and amd64 will not work on Arm systems.

There are builds of git-annex for arm in eg, Debian. You should be able to use one of those if this system is running Debian. You may need to upgrade to eg, Debian stable, which includes git-annex.

It looks like you have an old and/or broken GHC compiler too. You could upgrade that to a newer version (eg from Debian stable) and build it that way, but it seems like the long way around if you have a Debian system there.

Comment by http://joeyh.name/ Wed Aug 7 16:31:30 2013
@Joey Thanks for the answer. I didn't want to mess around too much with the TonidoPlug. I am currently setting up a raspberry pi, which works fine.

I had problems following these directions on recent releases of Fedora/Ubuntu. The install attempts failed on cryptocipher-0.3.1, which I think came as a dependency of Yesod. I was able to work around this by installing yesod-platform with cabal first, then installing git-annex.

I'd like to use the assistant's power on a Raspberry Pi to build an always-on file/sync server. Is there a way to get the assistant running on Arm? I know there's a Debian package, but it's Version 3.20120629 and comes without the assistant. Has anyone ever successfully built a recent git-annex version on Arm? What would I need in order to do it myself?
Comment by RaspberryPie Fri Aug 23 03:07:11 2013

The git-annex assistant can easily be built on arm. But not the webapp. It's entirely possible to use the assistant without the webapp though; you just have to make the git repository and configure the remotes by hand, and then the assistant will sync them the same way the webapp does.

It is possible but very involved to build the webapp for arm. I do not anticipate doing it in the Debian package until ghc gets proper template haskell support for arm. See Webapp on ARM

Comment by http://joeyh.name/ Fri Aug 23 17:37:52 2013

Thanks for the quick answer. I will try to build git-annex with just the assistant, as you suggest, and once it works set up the server by hand as you suggest.

BTW: Awesome job you're doing with git-annex. I appreciate your enthusiasm.

Comment by RaspberryPie Fri Aug 23 18:51:51 2013

It took a while and a few tries, but I finally built the git-annex binary including the assistant on a Raspberry Pi. The build comes without the flags webapp, webdav, and dbus as these rely on a Template Haskell compiler that hasn't been ported to Arm architecture yet.

I put the binary up on Github in case anyone's interested: https://github.com/tradloff/git-annex-RPi

Comment by RaspberryPie Wed Sep 4 03:58:37 2013

I now realize there is a Ubuntu 12.04 Precise PPA with a current version of git-annex, so that's probably a better choice, but here's how I cabal isntalled git-annex.

  1. Apt install non-cabal dependencies:

    sudo aptitude install c2hs libgsasl7-dev libxml2-dev
    
  2. Manually cabal install yesod-platform to avoid the cryptocipher problem mentioned above:

    cabal install yesod-platform
    
  3. Cabal install git-annex with DNS flag disabled:

    cabal install git-annex -f"-dns"
    

I was getting this error building git-annex before disabling the DNS flag:

Utility/SRV.hs:70:54:
    Couldn't match expected type `Maybe
                                    [(Int, Int, Integer, B8.ByteString)]'
                with actual type `Either
                                    dns-1.0.0:Network.DNS.Internal.DNSError
                                    [(Int, Int, Int, dns-1.0.0:Network.DNS.Internal.Domain)]'
    In the third argument of `maybe', namely `r'
    In the second argument of `($)', namely
      `maybe [] (orderHosts . map tohosts) r'
    In a stmt of a 'do' block:
      return $ maybe [] (orderHosts . map tohosts) r

Looking at Utiltity/SRV.hs, it appears that disabling the DNS flag just makes git annex use a different DNS library (ADNS), not actually disable DNS lookups.

What is the best way to update git-annex and the dependencies via cabal? Just the $ cabal install * commands again?
If you run the "cabal update" command followed by the "cabal install" command it'll upgrade git-annex.
Comment by http://joeyh.name/ Fri Oct 11 17:09:33 2013

Lately I get this error message when trying to build git-annex-v4.20131002:

Utility/Hash.hs:7:8:
    Could not find module `Crypto.Hash'
    Perhaps you meant
      Crypto.HMAC (needs flag -package crypto-api-0.10.2)
    Use -v to see a list of the files searched for.

crypto-api-0.10.2 is installed as a debian dev package. All the dependencies are met. I have no idea what's going on.

Comment by RaspberryPie Mon Oct 21 19:55:12 2013
git-annex needs cryptohash version 0.10.0 or greater. You appear to have an old version. You can cabal configure -f-CryptoHash if it's for some reason failing to disable the cryptohash support despite the declared dependency not being met.
Comment by http://joeyh.name/ Mon Oct 21 22:09:05 2013
I fixed the error by installing a newer version of cryptohash. Thanks for pointing out the culprit.
Comment by RaspberryPie Tue Oct 22 17:55:32 2013
Quick note: The latest version in the Hackage repository (git-annex-4.20131024) fails to build, due to a faulty version of Assistant/Threads/Cronner.hs.
Comment by RaspberryPie Wed Oct 30 18:56:25 2013
@RaspberryPie that only affected builds without the webapp, in any case it's fixed now.
Comment by http://joeyh.name/ Fri Nov 1 16:33:25 2013

Okay, the error doesn't show up anymore. I didn't even get to Cronner though, because this time I got a different error:

Assistant/Alert.hs:195:20:
    Couldn't match expected type `Assistant ()' with actual type `()'
    Expected type: Maybe Remote -> Assistant ()
      Actual type: Maybe Remote -> ()
    In the expression: noop
    In an equation for `notFsckedNudge': notFsckedNudge _ = noop

This is from trying to compile 4.20131101 with -f"-webapp -webdav"

Comment by RaspberryPie Sat Nov 2 12:52:18 2013

Unfortunate about that. I've fixed it in git.

(It would be best to file bug reports about build failures to avoid cluttering up this page.)

Comment by http://joeyh.name/ Sat Nov 2 17:40:18 2013

After a fresh install of Haskell, and following the instructions above, I end up with the following rather bizarre and unexpected problem:

$ cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"
Resolving dependencies...
Configuring pcre-light-0.4...
Building pcre-light-0.4...
Preprocessing library pcre-light-0.4...
Base.hsc:103:18: error: pcre.h: No such file or directory
Base.hsc: In function ‘main’:
Base.hsc:402: error: ‘PCRE_ANCHORED’ undeclared (first use in this function)
Base.hsc:402: error: (Each undeclared identifier is reported only once
Base.hsc:402: error: for each function it appears in.)
Base.hsc:405: error: ‘PCRE_AUTO_CALLOUT’ undeclared (first use in this function)

(followed by an error for every other macro that was expected to be defined in the header...)

compiling dist/build/Text/Regex/PCRE/Light/Base_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Text/Regex/PCRE/Light/Base_hsc_make.c -o dist/build/Text/Regex/PCRE/Light/Base_hsc_make.o -m64 -fno-stack-protector -m64 -fno-stack-protector -m64 -D__GLASGOW_HASKELL__=700 -Ddarwin_BUILD_OS -Ddarwin_HOST_OS -Dx86_64_BUILD_ARCH -Dx86_64_HOST_ARCH -I/sw/lib/ghc-7.0.4/bytestring-0.9.1.10/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/sw/lib/ghc-7.0.4/base-4.3.1.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/sw/lib/ghc-7.0.4/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/sw/lib/ghc-7.0.4/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/sw/lib/ghc-7.0.4/include/
Failed to install pcre-light-0.4
cabal: Error: some packages failed to install:
git-annex-3.20120230 depends on pcre-light-0.4 which failed to install.
pcre-light-0.4 failed during the building phase. The exception was:
ExitFailure 1

This is a somewhat older Mac OS X 10.6.8 system.

I do have PCRE already installed via Fink, and pcre.h is in /sw/include. I see other -I/sw/... things in the compile command above, but obviously /sw/include is not one of them.

Any clues for me?

(Why the heck does git-annex need pcre in particular anyway??? I saw another regex library get installed earlier somewhere in this (massive) process.)

Comment by robohack Thu Nov 21 20:17:10 2013

The PCRE problem is solved trivially in my case with a couple more cabal install options, though the need for these seems oddly dissatisfying given the reams of other stuff that was successfully built and installed without these options.

Now however I seem to have encountered a deeper problem:

$ cabal install git-annex --bindir=$HOME/bin --extra-include-dirs=/sw/include --extra-lib-dirs=/sw/lib               
Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/7h/7hWHR5m8HPKOnUEvQU7HU++++TI/-Tmp-/git-annex-3.20120230-84797/git-annex-3.20120230/Setup.hs, /var/folders/7h/7hWHR5m8HPKOnUEvQU7HU++++TI/-Tmp-/git-annex-3.20120230-84797/git-annex-3.20120230/dist/setup/Main.o )
Linking /var/folders/7h/7hWHR5m8HPKOnUEvQU7HU++++TI/-Tmp-/git-annex-3.20120230-84797/git-annex-3.20120230/dist/setup/setup ...
hsc2hs Utility/StatFS.hsc
perl -i -pe 's/^{-# INCLUDE.*//' Utility/StatFS.hs
ghc -O2 -Wall -ignore-package monads-fd --make configure

Utility/StatFS.hsc:54:8:
    Could not find module `GHC.Foreign':
      Use -v to see a list of the files searched for.
make: *** [Build/SysConfig.hs] Error 1
Configuring git-annex-3.20120230...
Building git-annex-3.20120230...
Preprocessing executable 'git-annex' for git-annex-3.20120230...

Git/Version.hs:11:18:
    Could not find module `Build.SysConfig':
      Use -v to see a list of the files searched for.
Failed to install git-annex-3.20120230
cabal: Error: some packages failed to install:
git-annex-3.20120230 failed during the building phase. The exception was:
ExitFailure 1
Comment by robohack Thu Nov 21 20:30:54 2013

I'm using the ghc7.0 branch because Fink's GHC is still at 7.0.4....

$ cabal build                                
Building git-annex-3.20120523...
Preprocessing executable 'git-annex' for git-annex-3.20120523...
[ 78 of 163] Compiling Utility.Url      ( Utility/Url.hs, dist/build/git-annex/git-annex-tmp/Utility/Url.o )

Utility/Url.hs:111:88:
    Couldn't match expected type `Maybe URI' with actual type `URI'
    In the second argument of `fromMaybe', namely
      `(newURI `relativeTo` u)'
    In the expression: fromMaybe newURI (newURI `relativeTo` u)
    In an equation for `newURI_abs':
        newURI_abs = fromMaybe newURI (newURI `relativeTo` u)
Comment by robohack Thu Nov 21 21:14:54 2013

@robohack, the ghc7.0 branch is not being maintained, and is so old I don't recommend it. To build it against current cabal you will probably need to version its dependency on network to an older version than 2.4.0.

Also, git-annex has not depended on pcre for a long time. But you're building thoroughly old version so get to trip over every bug that's been reported for the past 2 years..

Comment by http://joeyh.name/ Fri Nov 22 16:27:36 2013

I followed the instructions and the invocation of

cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"

resulted in the following error:

Test.hs:107:41: Not in scope: `errMessage'
Failed to install git-annex-5.20140306
cabal: Error: some packages failed to install:
git-annex-5.20140306 failed during the building phase. The exception was:
ExitFailure 1

I used the Haskell Platform for Mac OS X (10.8)

I get exactly the same error message as Matthias when attempting the minimal Cabal install on openSUSE 12.2 (x86_64) Linux.
The errMessage build failure is due to a new version of optparse-applicative. I've added support for it in git master.
Comment by http://joeyh.name/ Thu Mar 20 16:06:22 2014

The issues I had were version mismatches when resolving dependencies of git-annex.

It seems that when you install haskell-platform package with apt-get, it installs a bunch of haskell dependencies as apt packages, yet those aren't needed for any other system packages. So some people here who complain about version mismatches might not have intended to install any Haskell libraries with apt, they just come along for the ride by default.

I can't remember the exact ones, but I ended up uninstalling some of the stuff that gets auto-installed along with haskell-platform, and using cabal to build those. Then all the git-annex dependencies worked.

Why 13.04 in this day and age? Using Zentyal as a home server/gateway, and it currently runs on 13.04.

This method might not work if you installed other apt packages that do need those apt-based Haskell libraries. But if git-annex is all you need that uses the Haskell platform, might work.

lyriondesktop:/home/zilti/tmp # cabal install c2hs
Resolving dependencies...
Configuring c2hs-0.17.2...
Building c2hs-0.17.2...
Preprocessing executable 'c2hs' for c2hs-0.17.2...
[ 1 of 26] Compiling Data.DLists      ( src/Data/DLists.hs, dist/build/c2hs/c2hs-tmp/Data/DLists.o )
[ 2 of 26] Compiling Control.StateTrans ( src/Control/StateTrans.hs, dist/build/c2hs/c2hs-tmp/Control/StateTrans.o )

src/Control/StateTrans.hs:77:1: Warning:
    Module `Prelude' does not export `catch'
[ 3 of 26] Compiling Data.Errors      ( src/Data/Errors.hs, dist/build/c2hs/c2hs-tmp/Data/Errors.o )
[ 4 of 26] Compiling Data.Attributes  ( src/Data/Attributes.hs, dist/build/c2hs/c2hs-tmp/Data/Attributes.o )
[ 5 of 26] Compiling Text.Lexers      ( src/Text/Lexers.hs, dist/build/c2hs/c2hs-tmp/Text/Lexers.o )
[ 6 of 26] Compiling Control.StateBase ( src/Control/StateBase.hs, dist/build/c2hs/c2hs-tmp/Control/StateBase.o )
[ 7 of 26] Compiling Data.NameSpaces  ( src/Data/NameSpaces.hs, dist/build/c2hs/c2hs-tmp/Data/NameSpaces.o )
[ 8 of 26] Compiling C2HS.C.Attrs     ( src/C2HS/C/Attrs.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Attrs.o )
[ 9 of 26] Compiling C2HS.C.Builtin   ( src/C2HS/C/Builtin.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Builtin.o )
[10 of 26] Compiling Paths_c2hs       ( dist/build/autogen/Paths_c2hs.hs, dist/build/c2hs/c2hs-tmp/Paths_c2hs.o )
[11 of 26] Compiling C2HS.Config      ( src/C2HS/Config.hs, dist/build/c2hs/c2hs-tmp/C2HS/Config.o )
[12 of 26] Compiling C2HS.Switches    ( src/C2HS/Switches.hs, dist/build/c2hs/c2hs-tmp/C2HS/Switches.o )
[13 of 26] Compiling C2HS.Version     ( src/C2HS/Version.hs, dist/build/c2hs/c2hs-tmp/C2HS/Version.o )
[14 of 26] Compiling System.CIO       ( src/System/CIO.hs, dist/build/c2hs/c2hs-tmp/System/CIO.o )
[15 of 26] Compiling Control.State    ( src/Control/State.hs, dist/build/c2hs/c2hs-tmp/Control/State.o )
[16 of 26] Compiling C2HS.State       ( src/C2HS/State.hs, dist/build/c2hs/c2hs-tmp/C2HS/State.o )
[17 of 26] Compiling C2HS.CHS.Lexer   ( src/C2HS/CHS/Lexer.hs, dist/build/c2hs/c2hs-tmp/C2HS/CHS/Lexer.o )

src/C2HS/CHS/Lexer.hs:612:16: Warning:
    Defined but not used: `lexeme'
[18 of 26] Compiling C2HS.CHS         ( src/C2HS/CHS.hs, dist/build/c2hs/c2hs-tmp/C2HS/CHS.o )
[19 of 26] Compiling C2HS.Gen.Header  ( src/C2HS/Gen/Header.hs, dist/build/c2hs/c2hs-tmp/C2HS/Gen/Header.o )
[20 of 26] Compiling C2HS.C.Trav      ( src/C2HS/C/Trav.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Trav.o )
[21 of 26] Compiling C2HS.C.Names     ( src/C2HS/C/Names.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Names.o )
[22 of 26] Compiling C2HS.C           ( src/C2HS/C.hs, dist/build/c2hs/c2hs-tmp/C2HS/C.o )
[23 of 26] Compiling C2HS.Gen.Monad   ( src/C2HS/Gen/Monad.hs, dist/build/c2hs/c2hs-tmp/C2HS/Gen/Monad.o )

src/C2HS/Gen/Monad.hs:227:10: Warning:
    Orphan instance: instance Read Ident
[24 of 26] Compiling C2HS.C.Info      ( src/C2HS/C/Info.hs, dist/build/c2hs/c2hs-tmp/C2HS/C/Info.o )
[25 of 26] Compiling C2HS.Gen.Bind    ( src/C2HS/Gen/Bind.hs, dist/build/c2hs/c2hs-tmp/C2HS/Gen/Bind.o )

src/C2HS/Gen/Bind.hs:971:43: Warning:
    In the use of `posColumn' (imported from Language.C.Data.Position):
    Deprecated: "column number information is inaccurate in presence of macros - do not rely on it."

src/C2HS/Gen/Bind.hs:789:10: Warning:
    Orphan instance: instance Num CInteger
[26 of 26] Compiling Main             ( src/Main.hs, dist/build/c2hs/c2hs-tmp/Main.o )
Linking dist/build/c2hs/c2hs ...
Installing executable(s) in /root/.cabal/bin
Installed c2hs-0.17.2
lyriondesktop:/home/zilti/tmp # cabal install git-annex
Resolving dependencies...
Configuring gnuidn-0.2.1...
cabal: The program c2hs is required but it could not be found.
Failed to install gnuidn-0.2.1
cabal: Error: some packages failed to install:
git-annex-5.20140709 depends on gnuidn-0.2.1 which failed to install.
gnuidn-0.2.1 failed during the configure step. The exception was:
ExitFailure 1
network-protocol-xmpp-0.4.6 depends on gnuidn-0.2.1 which failed to install.

@Daniel, I suggest you either follow the instuctions above, or if you don't want to follow the instructions, follow the error messages. :P In this case, the instructions say to do:

PATH=$HOME/bin:$PATH cabal install c2hs --bindir=$HOME/bin

Which is exactly to work around the problem that we can see in your transcript: Installing executable(s) in /root/.cabal/bin

Also, to reiterate the top of the page: If you are not comfortable tracking down and dealing with library build problems, installing git-annex with cabal is probably not the right choice for you!

Comment by http://joeyh.name/ Fri Jul 11 18:30:55 2014
Comments on this page are closed.