So you want to build git-annex from source. This is encouraged for users with experience building code from source. But the build may require some care and feeding. This page will start with the easy methods and work up to the harder ones.
This page also covers installing git-annex from source, but in many cases it's better to install it using your OS's package manager.
downloading the source code
The easiest way is using git; see download or just run:
git clone git://git-annex.branchable.com/ git-annex
building from source on Debian
This is the method used by git-annex's author, and so it's the one most likely to work without problems.
First, install everything git-annex needs to build:
sudo apt-get build-dep git-annex
Now you can build git-annex by running make
inside the source tree.
Then, to install the program and associated files system-wide in /usr/local
,
run:
sudo make install PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files into other parts of your HOME directory, run:
make install-home
building from source with stack
Using stack automates nearly everything, will work on many systems, and avoids build failures due to fast-changing haskell libraries.
First, install stack
On Debian:
sudo apt-get install haskell-stack zlib1g-dev
Get the git-annex source code, and inside the source tree run:
stack setup
stack build
To install the program and all associated files system-wide
in /usr/local
, run:
sudo make install BUILDER=stack PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files into other parts of your HOME directory, run:
make install-home BUILDER=stack
(Why not run stack install git-annex
? Because that causes stack to
ignore git-annex's stack.yaml file,
yielding a less reliable build. Stack also only installs the binary,
and not other files.)
Note that this build produces a git-annex without the build flags
DBUS and MagicMime.
These optional features require installing additional C libraries.
To try to build with these features
enabled, pass extra parameters when running stack build
:
--flag git-annex:DBUS --flag git-annex:MagicMime
minimal build from source with cabal
This can be done anywhere, and builds git-annex without some optional features that require harder-to-install C libraries. This is plenty to let you get started with git-annex, but it does not include the assistant or webapp.
Be warned that this involves building a lot of Haskell libraries 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.
Get the git-annex source code, and inside the source tree, run:
cabal install -j -f"-assistant -webapp -pairing -dbus -magicmime" --only-dependencies
cabal configure -f"-assistant -webapp -pairing -dbus -magicmime"
cabal build -j
To install the program and all associated files system-wide
in /usr/local
, run:
sudo make install BUILDER=cabal PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files into other parts of your HOME directory, run:
make install-home BUILDER=cabal
full build from source with cabal
To build with all features enabled, including the assistant and webapp, you will need to install several C libraries and their headers, including libmagic, and zlib. How to do that for your OS is beyond the scope of this page.
Once the C libraries are installed, run inside the source tree:
cabal install -j --only-dependencies
cabal configure
cabal build -j
To install the program and all associated files system-wide
in /usr/local
, run:
sudo make install BUILDER=cabal PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files into other parts of your HOME directory, run:
make install-home BUILDER=cabal
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.
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.
@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
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.
From what I can tell, the problem is fixed in github master since yesod >= 1.2 is supported again.
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.
I tried various ways to install git-annex on my TonidoPlug.
System Info:
apt-get
didn't work.The Linux standalone installation results in an error message like this, when calling
git-annex
(orgit annex
)(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)
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.
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.
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
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.
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
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.
Apt install non-cabal dependencies:
Manually cabal install yesod-platform to avoid the cryptocipher problem mentioned above:
Cabal install git-annex with DNS flag disabled:
I was getting this error building git-annex before disabling the DNS flag:
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.
$ cabal install *
commands again?Lately I get this error message when trying to build git-annex-v4.20131002:
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.
configure -f-CryptoHash
if it's for some reason failing to disable the cryptohash support despite the declared dependency not being met.Okay, the error doesn't show up anymore. I didn't even get to Cronner though, because this time I got a different error:
This is from trying to compile 4.20131101 with
-f"-webapp -webdav"
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.)
After a fresh install of Haskell, and following the instructions above, I end up with the following rather bizarre and unexpected problem:
(followed by an error for every other macro that was expected to be defined in the header...)
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.)
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:
I'm using the ghc7.0 branch because Fink's GHC is still at 7.0.4....
@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..
I followed the instructions and the invocation of
resulted in the following error:
I used the Haskell Platform for Mac OS X (10.8)
errMessage
build failure is due to a new version of optparse-applicative. I've added support for it in git master.I tried this on ubuntu 14.04 without any previous haskell installs and cabal failed to resolve the dependencies:
rejecting: optparse-applicative-0.9.0 (conflict: hjsmin => optparse-applicative>=0.7 && <0.9)
full log
apt-get install happy alex libghc-hjsmin-dev
solved the problem for me. The hjsmin lib was probably crucial. It seems a bunch of dependencies can also be installed as debs rather than through cabal.standalone/android/buildchroot-inchroot
gave me a clue.Next thing i ran into was missing c2hs. So
apt-get install c2hs
before running the cabal install otherwise...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.
@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:
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!
Just an FYI: I tried to "cabal install --only-dependencies" with GHC 7.8 and it fails because DAV-1.0.1 is pulling in lens-3.10.3 which is not compatible with GHC 7.8 due to changes in Typeable.
I don't have enough experience with cabal to figure out why it's not trying to use a newer version of lens.
@azul, thanks for hints, but it still fails. No wonders though - this is Haskell, kids.
@azul - the problem with installing dependencies from apt-get is that the Ubuntu haskell packages are rather old. It shouldn't be this way (and it has gotten a LOT better - I suggest installing the newest version of the Haskell Platform that you can), but often cabal will complain about a package it is unable to install because it failed on the install of that package's dependencies. You should try to cabal install $FAILED_DEPENDENCY (not an actual env variable), and you will often get more informative error messages - some packages require non-haskell dependencies (take gtk3, for instance) which cabal doesn't know how to handle at this point, because that would require some cross platform foo (cabal install runs on Windows and OSX, which don't have native package managers at all).
@Paul - It looks like you ran into a bug, because http-client no longer depends on network>=2.6, it now can take network 2.4 - 2.6 or 2.6 or greater. If you try again it should work.
Please don't be put off by haskell because of things like this - git annex is a very large and complicated project, and developing on large projects such as this pretty much require you to have pretty recent versions of all haskell packages. I really suggest you take a look at this book http://learnyouahaskell.com/introduction. Haskell is a beautiful language and it doesn't have to be esoteric, academic, or difficult at all. It's obvious since you are attempting to build this from source that you are either interested in haskell or you are only interested in the development of git-annex. Either way, it would behoove you to read that book. It is short, full of great examples, and it even has pleasant illustrations. It may look like a children's book, but by the end of it you will know how to use all of the major monads (you may not know what a monad is, but that isn't really that important anyway - you just need to know how they are used).
Britt's comment is spot on, but git-annex tries pretty hard to work with lots of older versions of haskell libraries, as well as the latest and greatest. So it should be ok to install haskell libraries with apt-get and use them to build git-annex, as the (revised) instructions above show.
What tends not to work so well is use apt-get to install older versions of haskell libraries and then cabal install on top to add newer stuff. Gets complicated and I'd recommend not going there. The instructions above show using either apt-get or cabal to install the haskell libraries, but not both.
@thnetos, great question!
Annex.hs is a key starting place, as it defines git-annex's main monad. If you like learning code bases bottom-up, Types/* has files for the main data types used in git-annex, such as Key and UUID and Remote and GitConfig.
Command/ gets you the implementation of any particular git-annex command you are interested in. Or Remote/ for any particular special remote.
I recommend running "make tags" and then your editor should be able to use the tags file to bounce around in the source code.
Hmm, deprecated in favor of libghc-shakespear-dev, according to http://hackage.haskell.org/package/hamlet ...
I think that's the bug, right there: git-annex_5.20141125.dsc.
I hope this helps.
Yes, Debian has a by now very outdated version of git-annex.
You can clone git-annex's git repo and build a debian package from there; it's been updated for these changes.
Hi, With minimal compilation for git-annex-5.20151102.1 and Cabal version is : 1.22.4.0 Ghc version is : 7.10.2
I have an error on url.hs:45 binary operator not found before lexical element " ( "
any idea ?
@reyman64 missing dependency on http-client in that configuration. I've fixed this in git.
Hi, i have an error with last pulled version on my system :
[17 of 23] Compiling Text.Feed.Constructor ( src/Text/Feed/Constructor.hs, dist/build/Text/Feed/Constructor.o )
src/Text/Feed/Constructor.hs:131:5: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: XMLFeed _ [18 of 23] Compiling Text.Feed.Export ( src/Text/Feed/Export.hs, dist/build/Text/Feed/Export.o ) [19 of 23] Compiling Text.Feed.Import ( src/Text/Feed/Import.hs, dist/build/Text/Feed/Import.o ) [20 of 23] Compiling Text.Feed.Util ( src/Text/Feed/Util.hs, dist/build/Text/Feed/Util.o ) [21 of 23] Compiling Text.Feed.Query ( src/Text/Feed/Query.hs, dist/build/Text/Feed/Query.o )
src/Text/Feed/Query.hs:66:53: Module ‘Data.Time.Locale.Compat’ does not export ‘rfc822DateFormat’
src/Text/Feed/Query.hs:66:71: Module ‘Data.Time.Locale.Compat’ does not export ‘iso8601DateFormat’ cabal: Error: some packages failed to install: feed-0.3.11.1 failed during the building phase. The exception was: ExitFailure 1
@reyman64, that's a failure to build the feed package, not git-annex. See http://hackage.haskell.org/package/feed for a pointer to its bug tracker.
The best way to avoid running into such problems is to use stack rather than cabal to build git-annex, since that avoids using bleeding-edge and thus frequently broken versions of the dependencies.
Is there a tag in github to download the latest dev build (if i want to compile a build with v6 repository for example) ?
Because after a recent
git pull
(commit65f44423d1b9407a9c0e4a2b2e7e24b701f6dc32
) on master, i have this error onstack install
:Also,
git-annex-shell
is not created by stack install, is it normal ?Best, SR.
Check out the tag for the release of git-annex that you want to build to avoid building from master, which may not be ready. In this case, I was adjusting some build flags this morning and hadn't tried a stack build yet.
git-annex-shell is just a symlink to git-annex. I guess that stack install bypasses the code that makes cabal install set up that symlink. You can make the symlink yourself I suppose.
I cloned the
git-annex
repo from github.com and checked out the6.20160907
tag.Then I invoked
stack install
and that ended with the following. Note, this is on Windows.concurrent-output-1.7.7
is not present in resolverlts-5.18
.In the meantime, the stack.yaml has been updated to use lts-7.0, which includes concurrent-output-1.7.7, so that should solve that.
Hello,
Following https://git-annex.branchable.com/install/fromsource/ "building from source on Debian" succeeds on Xubuntu 16.04 but fails on Debian 7.11. First observed on recent commit
ade6ab4
(the one that was used on Xubuntu 16.04) then failed the same way with most recent commitf244d94
and for tagdebian/6.20160719-1
.Haskell context was installed on the machine specifically to build git-annex, so there should not be any extraneous package.
Surprisingly, "make" and "cabal" output rather different messages.
Any hint? When succeeding the pair of machines will be my first remote ssh-based repo. I need a recent enough build for mixed content repository that would automatically put some types of files in regular git and some other types in annex. Thanks.
@stephane-gourichon, Control.Monad.Catch is in the haskell exceptions package, which is a dependency of git-annex. I don't know why it is failing to find it on your system.
You appear to be in some variety of cabal hell; you probably need to delete your ~/.cabal and ~/.ghc and start over.
Also, Debian 7.11 is quite old; to follow the "building from source on Debian" you need Debian unstable, testing, or sometimes stable (doesn't work currently); not oldstable.
I tried to build git-annex on a current raspbian system. Executing "apt-get build-dep git-annex" I get the following error:
I've played with git-annex before, but never used it seriously. Building it from source for the first time, to get the latest and greatest, I ran into a few stumbling blocks. I've got them sorted out now; this is to (a) document them, and (b) ask which if any of these should be considered bugs -- in which case I'll file bug reports about them.
I'm a complete Haskell newbie, and don't want to dive into that right now, so I'm using stack, since I like the sound of
I'm working with Ubuntu 16.04 LTS, stack 1.5.1, ghc 8.0.2 (courtesy of stack), and git-annex 6.20171026.
So, here's how things went.
Almost following the stack section of fromsource, after
stack setup
I didstack build
instead ofstack install
, so that I could (a) run the tests before installing, and (b) install into /usr/local as root.Issue #1:
stack test
doesn't run the tests. It took me a while to findgit annex test
. This isn't a bug, just something for people to be aware of.Issue #2:
stack build
doesn't create the git-annex and git-annex-shell symlinks. Which means that the ssh remote tests fail.Issue #3: Unless they don't. If ./git-annex-shell doesn't exist, the tests use whatever copy they find on $PATH. Which lets them run -- but it's not testing the code you think it's testing. This could lead to either false negatives or false positives under different circumstances.
I'd noticed the Makefile, but dismissed it after a failed attempt to set
BUILDER=stack
, especially since it's undocumented. Turns out it does important stuff -- like creating those symlinks. So I dug more deeply. The magic incantation is:The "--" is the unobvious bit.
There's even a
make test
.Issue #4: The Makefile does good and useful things, but I can find no mention of it in fromsource.
OK, so at this point I've got the thing built, and the tests passing (legitimately, using the correct version of git-annex-shell). Time to install it.
Issue #5:
sudo make install
doesn't work. stack refuses to run, complaining:See https://github.com/commercialhaskell/stack/issues/471 for what this is about.
Three ways to add that option:
Hack the Makefile -- add another
if [ $BUILDER = stack ]
sectionAdd this line to git-annex's stack.yaml (or to ~/.stack/config.yaml if you want it as a global setting):
(It's a standalone entry, so should have no leading whitespace)
For installing, use a variant of the above magic incantation:
sudo make BUILDER="stack --allow-different-user" GHC="stack ghc --" install
I did #2, but #3 is probably safest, since it means you're only allow(ing)-different-user when you actually need to.
However you do it, be aware that if stack decides, at make-install time, to create any files under the source tree, of course it will create them as root, so subsequent builds as non-root will find them unwritable. I presume that's what stack's error message, "... to protect file permissions", is talking about.
Issue #6:
make install
does indeed cause stack to create more files. Specifically, it builds Build/InstallDesktopFile. It would make sense to build that atmake all
time, so that it gets done as the non-root user. This wouldn't guarantee not to pollute the source tree with root-owned files -- but as it is now, that's pretty much guaranteed to happen.After all those gripes, one very very good thing: I didn't have to apt-get any Haskell things at all! Stack downloaded everything it needed, including the compiler. Nice!
Questions for @Joey:
A. Is the Makefile undocumented because you don't really intend anyone else to use it, or is that just an oversight?
B. Are any of the above issues legitimate bugs? (Prime candidates, to my mind: #3 and #6)
C. Given all the dependency grief in the comments from Cabal users, and that for all my troubles I experienced none of that ... maybe stack should be the recommended approach, even if you don't use it yourself?
D. What's the preferred way to submit patches? I have a couple of cosmetic ones for Makefile, besides the (trivial) fix for #6
I'll edit the stack section of fromsource (the only part I'm competent to talk about), once I know which direction to go (i.e. the answer to (A)).
@erics, thanks for the useful feedback about stack. I've applied your patch to avoid the Build/InstallDesktopFile problem. And, I made it automatically set GHC when BUILDER=stack.
Using the Makefile is documented, up in the "building from source on Debian" section. But there's a set of users who want to use stack, and don't want to mess around with Makefiles (including users on Windows without a "make"), and that's who the stack instructions are kind of targeted at. It's an unfortunate problem with stack that it doesn't provide any way to make the git-annex-shell symlink.
I am doubtful that --allow-different-user is a good idea. I sometimes use stack to build git-annex for testing purposes, but I have never built it with stack and installed that with
sudo make install
. And it may well be that there's not a reasonable way to make that work; and the install target is mostly intended for use by distributions that are creating a package of git-annex, who probably set PREFIX and don't run it as root.I try to build git-annex on Gentoo linux (the most current version to be able to interact with the same version on debian). Unfortunatelly the version in Gentoo itself is to old (6.20170818).
So I found the haskell overlay that includes newer libraries for haskell as well as git-annex version 6.20180626.
So for 3 days now I try to get the haskell stack compiled what failed many times with circular dependencies, conflicting versions or simply not working haskell versions. It was a real nightmare and only a hint from the mailinglist to simply allow any haskell library, even all broken ones, gave me the solution to fulfile all dependencies for git-annex.
But now, git-annex itself fails to compile. I have no idea how to solve that.
Here the relevant logs: ./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=git-annex-6.20180626/ghc-8.4.3 --datadir=/usr/share/ --datasubdir=git-annex-6.20180626/ghc-8.4.3 --ghc-options=-j2 +RTS -A256M -qb0 -RTS --with-ar=x86_64-pc-linux-gnu-ar --ghc-option=-optc-march=native --ghc-option=-optc-O2 --ghc-option=-optc-pipe --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/git-annex-6.20180626 --verbose --enable-shared --enable-executable-dynamic --sysconfdir=/etc --disable-library-stripping --flag=-android --flag=-androidsplice --flags=-assistant --flags=-benchmark --flags=concurrentoutput --flags=-dbus --flags=magicmime --flags=network-uri --flags=pairing --flag=-production --flags=-s3 --flag=-testsuite --flags=torrentparser --flags=-webapp --flags=webdav … Assistant/Threads/MountWatcher.hs:36:2: error: warning: #warning Building without dbus support; will use mtab polling [-Wcpp] #warning Building without dbus support; will use mtab polling ^~~~~~~ | 36 | #warning Building without dbus support; will use mtab polling | ^
Assistant/Threads/NetWatcher.hs:27:2: error: warning: #warning Building without dbus support; will poll for network connection changes [-Wcpp] #warning Building without dbus support; will poll for network connection changes ^~~~~~~ | 27 | #warning Building without dbus support; will poll for network connection changes | ^
BuildFlags.hs:22:2: error: warning: #warning Building without the assistant. [-Wcpp] #warning Building without the assistant. ^~~~~~~ | 22 | #warning Building without the assistant. | ^
BuildFlags.hs:27:2: error: warning: #warning Building without the webapp. You probably need to install Yesod.. [-Wcpp] #warning Building without the webapp. You probably need to install Yesod.. ^~~~~~~ | 27 | #warning Building without the webapp. You probably need to install Yesod.. | ^
BuildFlags.hs:43:2: error: warning: #warning Building without S3. [-Wcpp] #warning Building without S3. ^~~~~~~ | 43 | #warning Building without S3. | ^
Utility/DirWatcher.hs:42:2: error: warning: #warning "Building without inotify support" [-Wcpp] #warning "Building without inotify support" ^~~~~~~ | 42 | #warning "Building without inotify support" | ^ … Utility/IPAddress.hs:20:48: error: Variable not in scope: hostAddressToTuple :: HostAddress -> (Integer, b0, c0, d0) | 20 | isLoopbackAddress (SockAddrInet _ ipv4) = case hostAddressToTuple ipv4 of | ^^^^^^^^^^^^^^^^^^
Utility/IPAddress.hs:26:53: error: Variable not in scope: hostAddress6ToTuple :: HostAddress6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) | 26 | isLoopbackAddress (SockAddrInet6 _ _ ipv6 _) = case hostAddress6ToTuple ipv6 of | ^^^^^^^^^^^^^^^^^^^
Utility/IPAddress.hs:39:47: error: Variable not in scope: hostAddressToTuple :: HostAddress -> (Integer, Integer, Integer, Integer) | 39 | isPrivateAddress (SockAddrInet _ ipv4) = case hostAddressToTuple ipv4 of | ^^^^^^^^^^^^^^^^^^
Utility/IPAddress.hs:49:52: error: Variable not in scope: hostAddress6ToTuple :: HostAddress6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) | 49 | isPrivateAddress (SockAddrInet6 _ _ ipv6 _) = case hostAddress6ToTuple ipv6 of | ^^^^^^^^^^^^^^^^^^^
Utility/IPAddress.hs:70:22: error: Variable not in scope: htonl :: Integer -> t | 70 | toipv4 a b = htonl $ fromIntegral a * (2halfipv4bits) + fromIntegral b | ^^^^^ … Utility/Mounts.hs:13:1: error: Could not find module `System.MountPoints' Use -v to see a list of the files searched for. | 13 | import qualified System.MountPoints | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Utility/Mounts.hs:14:1: error: Could not find module
System.MountPoints' Use -v to see a list of the files searched for. | 14 | import System.MountPoints (Mntent(..)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ … Utility/SRV.hs:18:1: error: Could not find module
Network.DNS.Lookup' Use -v to see a list of the files searched for. | 18 | import qualified Network.DNS.Lookup as DNS | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Utility/SRV.hs:19:1: error: Could not find module `Network.DNS.Resolver' Use -v to see a list of the files searched for. | 19 | import Network.DNS.Resolver | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Full logs via e-mail.
As you can see, I try to compile without assistant and without webapp as I never use that two subsystems. From the ebuild file, that should exclude them via cabal flags and does not install the dns library (beside others).
Bt git-annex seems to ignore the cabal flags and try to install all the excluded stuff nevertheless (like s3, assistan or webapp).
Help! How to get out of the Haskell nightmare!?
@Mowgl, I see from the errors that whatever version of git-annex you're trying to build is at least somewhat out of date, since Utility.SRV was removed last month. The Utility.Mounts problem has also been fixed in newer versions.
hostAddressToTuple has been provided by all versions of the network package that git-annex.cabal allows it to build with, so you must have forced it to build with an older, unsupported version.
Anyway, there is nothing that prevents using git-annex 6.20170818 from working with any newer version of git-annex, unless you are using a couple of features added in newer versions.
@joey, What I have is just the builds I get from gentoo respective the haskell overlay. The most current version in that overlay is 6.20180626 but it also does not compile.
I need a version more recent than 6.20170818 as that version does still use rsync for remote copy.
fatal: cannot create directory at
'doc/bugs/Assertion96cnt6040sizeof4095nl95value95type95LC95TIME4147sizeof4095nl95value95type95LC95TIME91093414139failed.': Filename too long
fixed by updating longpaths in gitconfig,
stack setup ok
stack install failed,
regex-tdfa-1.2.3.1: copy/register Progress 58/168 removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:RemoveDirectory
Will have to try the Make approach on Windows ?
I had to build with cabal on DragonFlyBSD because stack isn't available (which is presumably the reason it's not in dports even though it builds cleanly.)
Everything worked after, except all the cabal commands gave warnings of the type:
I don't know much about "new style" and "legacy" commands in cabal, but instructions should probably be cleaned up to get around these warnings at some point.
Can I make armv7 version for alpine Linux? Or WASM?
git-annex
can't run on iOS without jailbreak. The only way is to build it on iSH or A-shell.git-annex(aarch64) is already provided on alpine repo. But iSH supports only armv7. So I can't install git-annex. I tried to build ghc for armv7. But the Haskell foundation has dropped supporting the armv7 since ghc-9.
A-shell needs WASI binary. I tried ghc-wasm-meta to compile git-annex to WASI binary, But I couldn't handle package version conflicts inside git-annex.