Recent comments posted to this site:

I kinda wish people would post questions to the forum, and not clutter up this page..

Anyway, there have been past bugs in the direct mode code that caused some files to not be checked out in direct mode, but stay as symlinks pointing at the content. That can be fixed by running git annex fsck. But, I am not aware of any problem that can leave a git-annex symlink that is not checked into git at all. Perhaps you copied the symlink from another location?

Comment by http://joeyh.name/ Wed Jul 16 17:51:28 2014
What I said was just wrong. Instead of trying on tr.html, I tried with a copy of that file. But making the copy of that file had the wanted effect, transforming the symlink to the actual file. Probably the assistant monitoring file creation, and transforming indirect file to direct file. Or perhaps the cp command follows symlinks by default (I thought it didn't).
Comment by http://mildred.fr/ Wed Jul 16 07:04:08 2014

I have an issue with direct mode: I have tons of symlinks that points to the git-annex store, while in direct mode. After investigation, I found that these files don't seem to be part of the repository. I can check with:

$ git -c core.bare=false status --porcelain tr.html
?? Documentation/Mozilla/developer.mozilla.org/tr.html

$ ls -l tr.html
lrwxrwxrwx 1 mildred mildred 205 10 juin  16:22 tr.html -> ../../../.git/annex/objects/gF/z1/SHA256E-s31895--c873982bd742ba8db6e026afee26b7ab2f75f54f587304d8c2d877db3900c0f6.html/SHA256E-s31895--c873982bd742ba8db6e026afee26b7ab2f75f54f587304d8c2d877db3900c0f6.html

The link is valid, and is probably pointing to a unused file in the annex store. How to add these files back?

If I was in indirect mode, I could simply use git add tr.html (and not git annex add). This would stage to the git staging area the symlink, and all would be well.

I found that in direct mode, the same was true. The command is:

git -c core.bare=false add tr.html

The file is added to the repository, and the link is converted to the target file. The question now is why? There is no hook on the add command. Could it be the annex assistant? If that didn't worked, my question would have been: how to checkout a file in direct mode?

Comment by http://mildred.fr/ Wed Jul 16 06:52:33 2014

@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

``` 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 exportcatch' [ 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. ```

safe does not prevent using the unsafe prelude functions. Utility.PartialPrelude does, and provides a few safe wrappers like lastMaybe.
Comment by http://joeyh.name/ Thu Jul 10 20:24:03 2014

https://hackage.haskell.org/package/safe

A library wrapping Prelude/Data.List functions that can throw exceptions, such as head and !!. Each unsafe function has up to four variants, e.g. with tail:

tail :: [a] -> [a], raises an error on tail [].

tailMay :: [a] -> Maybe [a], turns errors into Nothing.

tailDef :: [a] -> [a] -> [a], takes a default to return on errors.

tailNote :: String -> [a] -> [a], takes an extra argument which supplements the error message.

tailSafe :: [a] -> [a], returns some sensible default if possible, [] in the case of tail.

Hello everyone.

Be aware that your distribution's package may be very old. For example, at the time I write this, latest Debian stable is Debian 7.5 which is 2 months old. But git-annex package there is two years old (tomorrow, it will be exactly two yezrs old).

So, beware. If following online walkthrough, either install a more recent git-annex (e.g. from Debain backports) or follow instructions from your local /usr/share/doc/git-annex/html/walkthrough.html instead.

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.

Next thing i ran into was missing c2hs. So apt-get install c2hs before running the cabal install otherwise...

$ cabal install git-annex --only-dependencies
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:
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.
Comment by azul Fri Jun 20 06:35:35 2014
Comments on this page are closed.