git-annex/ install/ OSX/ old comments

Moved a bunch of outdated comments here, AFAIK all these issues are fixed.

Recent install for OS X

if you are having trouble installing with `cabal install git-annex` at the moment, trouble of the XML kind, you'll need to do a couple things:

`brew update` `brew install libxml2` `cabal update` `cabal install libxml --extra-include-dirs=/usr/local/Cellar/libxml2/2.8.0/include/libxml2 --extra-lib-dirs=/usr/local/Cellar/libxml2/2.8.0/lib`

well, then i hit a brick wall.

well.

I got it to work by manually symlinking from `../Cellar/libxml2/2.8.0/lib/`* into `/usr/local` and from `../../Cellar/libxml2/2.8.0/lib/` to `/usr/local/pkgconfig`, but i can't recommend it or claim to be too proud about it all.

OS X already has an old libxml knocking around so this might ruin everything for me.

let's find out !

Comment by https://www.google.com/accounts/o8/id?id=AItOawnBEsNDl_6O4rHb2en3I0-fg-6fUxglaRQ — Wed Oct 29 14:05:27 2025
For the moment

Hi Joey! I just comment that I could not install it but the issue is with the last version (the one you just release today, so no problem!! man on sunday?? you're awesome!!!) so I installed the previous one and no problem at all

Thanks for all the efford and if you need me to try os whatever, feel free to ask!

Thanks again

Agustin

Comment by https://www.google.com/accounts/o8/id?id=AItOawkwR9uOA38yi5kEUvcEWNtRiZwpxXskayE — Wed Oct 29 14:05:27 2025
Installation not working on OS X 10.6.8

I try installing with brew because I already had brew setup in my machine, but all run ok but when I try to run cabal install git-annex I got an error with the hinotify-0.3.2 library complaining about a header file.

Full trace:

    sudo cabal install git-annex
    Resolving dependencies...
    Configuring hinotify-0.3.2...
    Building hinotify-0.3.2...
    Preprocessing library hinotify-0.3.2...
    INotify.hsc:35:25: error: sys/inotify.h: No such file or directory
    INotify.hsc: In function ‘main’:
    INotify.hsc:259: error: invalid use of undefined type ‘struct inotify_event’
    INotify.hsc:260: error: invalid use of undefined type ‘struct inotify_event’
    INotify.hsc:261: error: invalid use of undefined type ‘struct inotify_event’
    INotify.hsc:262: error: invalid use of undefined type ‘struct inotify_event’
    INotify.hsc:265: error: invalid use of undefined type ‘struct inotify_event’
    INotify.hsc:266: error: invalid application of ‘sizeof’ to incomplete type ‘struct inotify_event’
    compiling dist/build/System/INotify_hsc_make.c failed (exit code 1)
    command was: /usr/bin/gcc -c dist/build/System/INotify_hsc_make.c -o dist/build/System/INotify_hsc_make.o -m64 -fno-stack-protector -m64 -D__GLASGOW_HASKELL__=704 -Ddarwin_BUILD_OS -Ddarwin_HOST_OS -Dx86_64_BUILD_ARCH -Dx86_64_HOST_ARCH -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/directory-1.1.0.2/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/unix-2.5.1.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/old-time-1.1.0.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 -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/bytestring-0.9.2.1/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/base-4.5.0.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/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/Cellar/ghc/7.4.1/lib/ghc-7.4.1/include/
    cabal: Error: some packages failed to install:
    git-annex-3.20120624 depends on hinotify-0.3.2 which failed to install.
    hinotify-0.3.2 failed during the building phase. The exception was:
    ExitFailure 1

Anyone has an idea how can I solve this.

Thanks for the time!

Agustin

Comment by https://www.google.com/accounts/o8/id?id=AItOawkwR9uOA38yi5kEUvcEWNtRiZwpxXskayE — Wed Oct 29 14:05:27 2025
comment 7

$(brew --prefix) should, in most cases, be /usr/local. That's the recommended install location for homebrew.

I already had git installed and homebrew as my package manager - my install steps were as follows:

1. brew install haskell-platform ossp-uuid md5sha1sum coreutils pcre
2. PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" cabal install git-annex

Comment by http://www.davidhaslem.com/ — Wed Oct 29 14:05:27 2025
comment 6
Last night I made it look in /opt/local/libexec/gnubin .. if there's another directory it could look in, let me know. I am reluctant to make it run the brew command directly.
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
comment 5
@Сергей, I've fixeed that in git.
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
sha256

If you're missing the `sha256sum` command with Homebrew, it's provided by `coreutils`. You have to change your `$PATH` before running `cabal install git-annex.cabal`:

    PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"

Comment by https://www.google.com/accounts/o8/id?id=AItOawnHrjHxJAm39x8DR4bnbazQO6H0nMNuY9c — Wed Oct 29 14:05:27 2025
Problems with Base & Crypto

I got the following error message trying to install git-annex:

    cabal: cannot configure git-annex-3.20120418. It requires base >=4.5 && <5
    For the dependency on base >=4.5 && <5 there are these packages: base-4.5.0.0.
    However none of them are available.
    base-4.5.0.0 was excluded because of the top level dependency base -any

These are the steps I performed to make it work

1. Download Ghc 7.4.
2. Run `sudo cabal install git-annex --bindir=$HOME/bin`.
3. Compilation of the Crypto-4.2.4 dependency failed since it's not updated to work with Ghc 7.4. You need to patch SHA2.hs (steps below).
4. Run `sudo cabal install git-annex --bindir=$HOME/bin` a second time.

The steps I did to patch the SHA2.hs file in Crypto-4.2.4:

1. `cabal unpack crypto-4.2.4`
2. `cd Crypto-4.2.4`
3. `patch -p1 < crypto-4.2.4-ghc-7.4.patch`
4. `sudo cabal install`.

PS: I used this patchfile. Then I did the last step a third time.

Comment by https://www.google.com/accounts/o8/id?id=AItOawkO9tsPZkAxEulq2pGCdwz4md-LqB0RcMw — Wed Oct 29 14:05:27 2025
Have error

[ 98 of 248] Compiling Utility.DiskFree ( Utility/DiskFree.hs, dist/build/git-annex/git-annex-tmp/Utility/DiskFree.o ) [ 99 of 248] 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) cabal: Error: some packages failed to install: git-annex-3.20121009 failed during the building phase. The exception was: ExitFailure 1

Comment by https://www.google.com/accounts/o8/id?id=AItOawmY_4MvT5yEeztrS7UIJseStUe4mtgp6YE — Wed Oct 29 14:05:27 2025
installing via homebrew

I had to:

    cabal update

before:

    cabal install git-annex

Comment by https://www.google.com/accounts/o8/id?id=AItOawm_-2XlXNyd6cCLI4n_jaBNqVUOWwJquko — Wed Oct 29 14:05:27 2025
comment 35
We do not yet have an autobuild for 10.9. You can build from source: http://git-annex.branchable.com/bugs/git_annex_doesn__39__t_work_in_Max_OS_X_10.9/#comment-8e8ee5e50506a6fde029d236f4809df8
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
Mac OS X Maverick - symbol not found

Just to mention that the beta dated 24 Oct 2013 and Joey's autobuild of 27 Oct both don't start with the following error message for git-annex, git-annex-webapp under Mac OS X 10.9 Maverick with latest XCode installed:

    dyld: Symbol not found: _objc_debug_taggedpointer_mask
      Referenced from: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
      Expected in: /Applications/git-annex.app/Contents/MacOS/bundle/I
     in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

    Trace/BPT trap: 5

Many thanks. Can I help?

Comment by https://www.google.com/accounts/o8/id?id=AItOawl-xMSPoRHcT5d2nAc1K8pWVi-AexKkYik — Wed Oct 29 14:05:27 2025
comment 17
@a-or-b that issue is logged here subtle build issue on OSX 10.7 and Haskell Platform (if you have the 32bit version installed), you can use cabal to build and install git-annex and it will detect if its 32 or 64bit automatically.
Comment by https://www.google.com/accounts/o8/id?id=AItOawkSq2FDpK2n66QRUxtqqdbyDuwgbQmUWus — Wed Oct 29 14:05:27 2025
comment 3
@Douglas, I've fixed that in git. FWIW, the program is installed before that point. Actually, I am leaning toward not having cabal install that plist file at all.
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
Updated install instructions with homebrew

To install git annex with homebrew simply do:

    brew update
    brew install haskell-platform git ossp-uuid md5sha1sum coreutils pcre
    cabal install git-annex

Then link the binary to your `PATH` e.g. with

    ln -s ~/.cabal/bin/git-annex* /usr/local/bin/

Comment by https://www.google.com/accounts/o8/id?id=AItOawnnIQkoUQo4RYzjUNyiB3v6yJ5aR41WG8k — Wed Oct 29 14:05:27 2025
ghc 7.0
You did the right thing, although just checking out the ghc-7.0 branch will avoid merge conflicts. I am trying to keep it fairly close to up-to-date.
Comment by http://joey.kitenet.net/ — Wed Oct 29 14:05:27 2025
setup: standalone/macos/git-annex.app/Contents/Info.plist: does not exist

I tried installing with cabal and homebrew on Mountain Lion. After cabal install git-annex I get:

    Linking dist/build/git-annex/git-annex ...
    Installing executable(s) in /Users/dfc/.cabal/bin
    setup: standalone/macos/git-annex.app/Contents/Info.plist: does not exist
    cabal: Error: some packages failed to install:
    git-annex-3.20121001 failed during the final install step. The exception was:
    ExitFailure 1

There is no directory named macos inside of standalone:

    jumbo:git-annex-3.20121001 dfc$ ls -l standalone/
    total 112
    -rw-r--r--+ 1 dfc  staff  55614 Oct  6 10:40 licences.gz
    drwxr-xr-x+ 6 dfc  staff    204 Oct  6 10:40 linux
    drwxr-xr-x+ 3 dfc  staff    102 Oct  6 10:40 osx

Comment by https://www.google.com/accounts/o8/id?id=AItOawmYiJgOvC4IDYkr2KIjMlfVD9r_1Sij_jY — Wed Oct 29 14:05:27 2025
GHC 7

The Haskell Platform installer for OSX uses GHC 7.0.4, which doesn't seem able to support the current version of git-annex.

Cabal throws a very cryptic error about not being able to use the proper base package.

I was able to install it by

1. cloning the repo
2. merging the ghc7.0 branch
3. resolving merge conflicts in git-annex.cabal
4. cabal install git-annex.cabal

(Note I also tried this with homebrew and had similar results)

Comment by https://www.google.com/accounts/o8/id?id=AItOawkEUhIcw37X2Kh-dznSMIb9Vgcq0frfdWs — Wed Oct 29 14:05:27 2025
comment 17
The instructions say to use cabal for a reason -- it's more likely to work. But I have made the Makefile detect the mismatched GHC and C compiler and force the C compiler to 32 bit.
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
Compiling git-annex on OSX (with 32 bit Haskell)

I came across an issue when following the instructions here: http://git-annex.branchable.com/install/OSX/

I'm compiling the 'assistant' branch (522f568450a005ae81b24f63bb37e75320b51219).

The pre-compiled version of Haskell for OSX recommends the 32 bit installer, however git-annex compiles

> Utility/libdiskfree.o Utility/libkqueue.o Utility/libmounts.o

as 64 bit. The 'make' command fails on linking 32- and 64-bit code.

So... I made a small change to the Makefile

> CFLAGS=-Wall

becomes

> CFLAGS=-Wall -m32

I don't know if there is an easy way to programmatically check for this, or even if you'd want to spend time doing it, but it might help someone else out.

https://gist.github.com/3167798

Comment by https://a-or-b.myopenid.com/ — Wed Oct 29 14:05:27 2025
comment 15

git-annex will now fall back to slower pure Haskell hashing code if `sha256sum`, etc programs are not in PATH. I'd still recommend installing the coreutils, as they're probably faster.

(The `shasum` command seems to come from a perl library, so I have not tried to make git-annex use that one.)

Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
comment 14
@Damien, hmm, it should not be using any cp options, unless when it was built there was a cp in the path that supported some option like -p. Can you check with --debug what cp parameters it's trying to use?
Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
gnu commands
…and another approach to the same problem: apparently git-annex also relies on the GNU coreutils (for instance, when doing `git annex get .`, `cp` complains about `illegal option -- -`). I do have the GNU coreutils installed with Homebrew, but they are all prefixed with `g`. So maybe you should try `gsha256sum` and `gcp` before `sha256sum` and `cp`, that seems like a more general solution.
Comment by https://www.google.com/accounts/o8/id?id=AItOawnHrjHxJAm39x8DR4bnbazQO6H0nMNuY9c — Wed Oct 29 14:05:27 2025
sha256 alternative
in reply to comment 6: On my Mac (10.7.4) there's `/usr/bin/shasum -a 256 <file>` command that will produce the same output as `sha256sum <file>`.
Comment by https://www.google.com/accounts/o8/id?id=AItOawnHrjHxJAm39x8DR4bnbazQO6H0nMNuY9c — Wed Oct 29 14:05:27 2025
comment 11

Hi @joey! Perfect!... I'll do that then!

Thanks for your time man!

Comment by https://www.google.com/accounts/o8/id?id=AItOawkwR9uOA38yi5kEUvcEWNtRiZwpxXskayE — Wed Oct 29 14:05:27 2025
comment 10

@Agustin you should be able to work around that with: cabal install git-annex --flags=-Inotify

I've fixed it properly for the next release, it should only be using that library on Linux.

Comment by http://joeyh.name/ — Wed Oct 29 14:05:27 2025
comment 10

Installing it with brew, I had to do the following steps before the final `cabal` command:

- `cabal install c2hs`
- add `$HOME/.cabal/bin` to my `$PATH` (so that c2hs program can be found)

Comment by https://www.google.com/accounts/o8/id?id=AItOawkp-1EQboBDqZ05MxOHNkwNQDM4luWYioA — Wed Oct 29 14:05:27 2025
comment 1

You can also use Homebrew instead of MacPorts. Homebrew's `haskell-platform` is up-to-date, too:

    brew install haskell-platform git ossp-uuid md5sha1sum coreutils pcre
    ln -s /usr/local/include/pcre.h /usr/include/pcre.h

As of this writing, however, Homebrew's `md5sha1sum` has a broken mirror. I wound up getting that from MacPorts anyway.

Comment by http://www.schleptet.net/~cfm/ — Wed Oct 29 14:05:27 2025
Comments on this page are closed.