For now abandoning the idea of using the git-annex standalone. After building the package with git-annex standalone setup the health check failed because large number of libraries still use external libraries.
I went a step back to try and compile this from source by hand following the official guide and I got the failure before I could start:
cabal buildUtility/Exception.hs:25:18: Could not find module `Control.Monad.Catch' Perhaps you meant Control.Monad.CatchIO (from MonadCatchIO-mtl-0.3.0.4) Control.Monad.Base (from transformers-base-0.4.1) Control.Monad.Cont (from mtl-2.0.1.0) Use -v to see a list of the files searched for.
checking whether bootstrap compiler is affected by bug 9439... Warning: Couldn't figure out LLVM version! Make sure you have installed LLVMghc: could not execute: opt-3.0
src/OS/Win.hs:78:48: Ambiguous occurrence `C.installedPackageId' It could refer to either `C.installedPackageId', imported qualified from `Distribution.InstalledPackageInfo' at src/OS/Win.hs:14:1-55 or `C.installedPackageId', imported qualified from `Distribution.Package' at src/OS/Win.hs:15:1-42
Ran cabal install in haskell-platform source directory. This installed number of packages but it failed with
cabal: Error: some packages failed to install:GLURaw-1.4.0.1 depends on OpenGLRaw-1.5.0.0 which failed to install.GLUT-2.5.1.1 depends on OpenGLRaw-1.5.0.0 which failed to install.OpenGL-2.9.2.0 depends on OpenGLRaw-1.5.0.0 which failed to install.OpenGLRaw-1.5.0.0 failed during the configure step. The exception was:ExitFailure 1
Installed apt-get install freeglut3 freeglut3-dev and ran cabal install OpenGLRaw-1.5.0.0 which failed again with the same error.
and tried configuring with minimal number of flags: cabal configure -f"-assistant -pairing -xmpp -dns" and failed with
Common.hs:14:8: Could not find module `Data.Default' Use -v to see a list of the files searched for.Utility/Exception.hs:25:18: Could not find module `Control.Monad.Catch' Perhaps you meant Control.Monad.Cont (from mtl-2.2.1) Control.Monad.Cont (needs flag -package mtl-2.1.3.1) Control.Monad.State (needs flag -package mtl-2.1.3.1) Use -v to see a list of the files searched for.Utility/FileSize.hs:10:8: Could not find module `System.PosixCompat.Files' Perhaps you meant System.Posix.Files (from unix-2.7.0.1) Use -v to see a list of the files searched for.Utility/FileSystemEncoding.hs:25:18: Could not find module `Data.Hash.MD5' Use -v to see a list of the files searched for.Utility/FileSystemEncoding.hs:27:8: Could not find module `Data.Bits.Utils' Use -v to see a list of the files searched for.Utility/Process.hs:45:8: Could not find module `System.Log.Logger' Use -v to see a list of the files searched for.Utility/SafeCommand.hs:12:8: Could not find module `Data.String.Utils' Use -v to see a list of the files searched for.Utility/Tmp.hs:14:8: Could not find module `Control.Monad.IfElse' Perhaps you meant Control.Monad.IO.Class (needs flag -package transformers-0.3.0.0) Control.Monad.List (needs flag -package mtl-2.1.3.1) Control.Monad.State (needs flag -package mtl-2.1.3.1) Use -v to see a list of the files searched for.Utility/UserInfo.hs:16:8: Could not find module `System.PosixCompat' Perhaps you meant System.Posix.Temp (from unix-2.7.0.1) System.Posix.Types (from base) Use -v to see a list of the files searched for.root@gitlab-dev:/tmp/git-annex# cabal configureResolving dependencies...Common.hs:14:8: Could not find module `Data.Default' Use -v to see a list of the files searched for.Utility/Exception.hs:25:18: Could not find module `Control.Monad.Catch' Perhaps you meant Control.Monad.Cont (from mtl-2.2.1) Control.Monad.Cont (needs flag -package mtl-2.1.3.1) Control.Monad.State (needs flag -package mtl-2.1.3.1) Use -v to see a list of the files searched for.Utility/FileSize.hs:10:8: Could not find module `System.PosixCompat.Files' Perhaps you meant System.Posix.Files (from unix-2.7.0.1) Use -v to see a list of the files searched for.Utility/FileSystemEncoding.hs:25:18: Could not find module `Data.Hash.MD5' Use -v to see a list of the files searched for.Utility/FileSystemEncoding.hs:27:8: Could not find module `Data.Bits.Utils' Use -v to see a list of the files searched for.Utility/Process.hs:45:8: Could not find module `System.Log.Logger' Use -v to see a list of the files searched for.Utility/SafeCommand.hs:12:8: Could not find module `Data.String.Utils' Use -v to see a list of the files searched for.Utility/Tmp.hs:14:8: Could not find module `Control.Monad.IfElse' Perhaps you meant Control.Monad.IO.Class (needs flag -package transformers-0.3.0.0) Control.Monad.List (needs flag -package mtl-2.1.3.1) Control.Monad.State (needs flag -package mtl-2.1.3.1) Use -v to see a list of the files searched for.Utility/UserInfo.hs:16:8: Could not find module `System.PosixCompat' Perhaps you meant System.Posix.Temp (from unix-2.7.0.1) System.Posix.Types (from base) Use -v to see a list of the files searched for.
Configuring gnuidn-0.2.1...setup-Simple-Cabal-1.22.0.0-x86_64-linux-ghc-7.8.4: The program 'c2hs' isrequired but it could not be found.Building hinotify-0.3.7...Configuring gsasl-0.3.5...Installed edit-distance-0.2.1.2Configuring regex-posix-0.95.2...Failed to install gsasl-0.3.5Build log ( /root/.cabal/logs/gsasl-0.3.5.log ):Configuring gsasl-0.3.5...setup-Simple-Cabal-1.22.0.0-x86_64-linux-ghc-7.8.4: The program 'pkg-config'version >=0.9.0 is required but it could not be found.
Installed pkg-config and c2hs and it passed further
cabal: Error: some packages failed to install:dbus-0.10.9.2 depends on libxml-sax-0.7.5 which failed to install.dns-1.2.3 failed during the building phase. The exception was:ExitFailure 1fdo-notify-0.3.1 depends on libxml-sax-0.7.5 which failed to install.gnuidn-0.2.1 failed during the configure step. The exception was:ExitFailure 1gnutls-0.1.5 failed during the configure step. The exception was:ExitFailure 1gsasl-0.3.5 failed during the configure step. The exception was:ExitFailure 1libxml-sax-0.7.5 failed during the configure step. The exception was:ExitFailure 1network-protocol-xmpp-0.4.6 depends on libxml-sax-0.7.5 which failed toinstall.
cabal: Error: some packages failed to install:dns-1.2.3 failed during the building phase. The exception was:ExitFailure 1gnuidn-0.2.1 failed during the configure step. The exception was:ExitFailure 1gnutls-0.1.5 failed during the configure step. The exception was:ExitFailure 1gsasl-0.3.5 failed during the configure step. The exception was:ExitFailure 1
Building dns-1.2.3...Preprocessing library dns-1.2.3...Network/DNS/Decode.hs:16:8: Could not find module `Data.Conduit.Network' Use -v to see a list of the files searched for.Network/DNS/StateBinary.hs:17:8: Could not find module `Data.Conduit.Attoparsec' Use -v to see a list of the files searched for.cabal: Error: some packages failed to install:dns-1.2.3 failed during the building phase. The exception was:ExitFailure 1
So if i do cabal install dns-1.2.3 --force-reinstalls it configures the older versions of conduit-extra and that again breaks the cabal install in git-annex. Forcing reinstall in git-annex breaks dns-1.2.3 and it is one cyclic mess.
The following packages are broken, either because they have a problemlisted above, or because they depend on a broken package.dns-1.2.3conduit-extra-1.1.6.2HTTP-4000.2.19
cabal install conduit-extra-1.1.6.2Resolving dependencies...In order, the following would be installed:nats-1 (reinstall) changes: hashable-1.2.2.0 -> 1.2.3.1semigroups-0.16.1 (reinstall) changes: hashable-1.2.2.0 -> 1.2.3.1,text-1.1.0.0 -> 1.2.0.3, unordered-containers-0.2.4.0 -> 0.2.5.1void-0.7 (reinstall) changes: hashable-1.2.2.0 -> 1.2.3.1conduit-1.2.3.1 (reinstall)conduit-extra-1.1.6.2 (reinstall) changes: conduit-1.2.3.1 addedcabal: The following packages are likely to be broken by the reinstalls:contravariant-1.2.0.1semigroupoids-4.3reducers-3.10.3.1tasty-rerun-1.1.3profunctors-4.3.2free-4.10.0.1keys-3.10.1kan-extensions-4.2.1pointed-4.2adjunctions-4.2bifunctors-4.2comonad-4.2.2http-conduit-2.1.5attoparsec-conduit-1.1.0Use --force-reinstalls if you want to install anyway.
cabal: Error: some packages failed to install:dns-1.2.3 failed during the building phase. The exception was:ExitFailure 1git-annex-5.20150205 depends on dns-1.2.3 which failed to install.
@jacobvosmaer Thanks for the suggestion. Yes, I am there now. Up until my few last comments all the issues were about building the environment that would allow me to do that.
cabal install git-annex --prefix=/tmp -f"-assistant -webapp -webdav -pairing -xmpp -dns"<snip>[307 of 341] Compiling Command.AddUrl ( Command/AddUrl.hs, dist/dist-sandbox-e946ccd1/build/git-annex/git-annex-tmp/Command/AddUrl.o )[308 of 341] Compiling Command.ImportFeed ( Command/ImportFeed.hs, dist/dist-sandbox-e946ccd1/build/git-annex/git-annex-tmp/Command/ImportFeed.o )Command/ImportFeed.hs:279:28: Not in scope: ‘getItemSummary’Command/ImportFeed.hs:280:32: Not in scope: ‘getItemDescription’ Perhaps you meant ‘getFeedDescription’ (imported from Text.Feed.Query)cabal: Error: some packages failed to install:git-annex-5.20150205 failed during the building phase. The exception was:ExitFailure 1
@jacobvosmaer I have tried the standalone, tried building the package with it and the health check failed with 10s of warnings. I am also a bit scared to use that as it has its own git which would make maintenance even harder (having different versions of git).
I am going to try to build an older version of git-annex, the current one is very new: 20150205
To get the haskell environment ready I did the following:
sudo apt-get install ghc pkg-config libxml2-dev libgsasl7-dev c2hs libgnutls-dev libncurses5-dev llvm m4wget https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-src.tar.bz2tar xf ghc-7.8.4-src.tar.bz2cd ghc-7.8.4./configure --prefix=/usr/localmakemake install wget https://www.haskell.org/cabal/release/cabal-1.22.0.0/Cabal-1.22.0.0.tar.gz tar Cabal-1.22.0.0.tar.gz ghc -threaded --make Setup ./Setup configure --user --prefix=/usr/local ./Setup buildwget https://www.haskell.org/cabal/release/cabal-install-1.22.0.0/cabal-install-1.22.0.0.tar.gztar xf cabal-install-1.22.0.0.tar.gzghc-pkg check # probably not needed, I had to do some checking at some point./bootstrap.sh --globalwget https://downloads.haskell.org/~platform/2014.2.0.0/haskell-platform-2014.2.0.0-srcdist.tar.gztar xf haskell-platform-2014.2.0.0-srcdist.tar.gzvim hptool/src/OS/Win.hs comment out line 14./platform.sh
For CentOS I had to start off with:
yum install ghcyum install llvmyum install ncurses-devel zlib-develyum install gnutls-devel libxml2-devel libgsasl-devel gtk2hs-buildtools# at some point i had a failure with c2hs but cabal was already installed so I could do:cabal install c2hs
About ghc + cabal. cabal is a command line tool that acts like Ruby's bundle; the cabal command line tool is distributed in a package called 'cabal-install'. Internally, cabal the CLI tool relies on a library called Cabal. When you install ghc (the Haskell compiler) you get a version of Cabal (ghc 7.8.4 has Cabal 1.18.1.5), so really all you need is to install on the build boxes is ghc and cabal-install.
I mentioned above that in theory, all you need is ghc + cabal-install. But that seems to be unreliable. What we can also do, and what seems more reliable (on some platforms), is to install a newer version of Cabal, and then a matching newer version of cabal-install. I got this working on Debian 7, but not on EL6 or EL7.
We want to use a different libgmp, and a different libz. (I believe the other libs are white-listed by Omnibus.)
To get linked against other libraries we will need to use ghc (compiler) flags. We don't speak directly to ghc, so this will probably mean either tacking flags onto cabal install git-annex, or editing .cabal files, so cabal tells ghc the right thing.
After getting to the point where I was 2 months ago, I've decided to go in a bit of different direction. I already know which libs are an issue so I am currently trying to compile alex or happy package which are the ones that are linking against libgmp that is outside of the whitelisted path.
I am using cabal to install them, with the extra flags --extra-lib-dirs=/opt/gitlab/embedded/lib/ --extra-include-dirs=/opt/gitlab/embedded/include/ where libgmp is.
After several attempts and tweaks the linking stays the same:
Still no progress on this, tried compiling GHC with a compiled version of libgmp on a non standard location and git-annex somewhere still builds against the OS built version.
We made some move on LFS and so far it seems that users are content with installing git-annex using their package repo. Considering how much work this was and that it is not closer to being done I will close the issue until the need is back again.