blanu / Dust

A Polymorphic Engine for Filtering-Resistant Transport Protocols
286 stars 31 forks source link

Dependency nightmare #16

Open burncycl opened 10 years ago

burncycl commented 10 years ago

Hello again blanu,

I was curious if you are still maintaining this code, and if more progress will be made on Dust.....I saw your kickstarter...

I am still fighting a dependency nightmare during installation.

Fetch source.

cd /source git clone https://github.com/blanu/Dust cd Dust/hs

Install source.

cabal configure

root@Euclid:/source/Dust/hs# cabal configure Resolving dependencies... Configuring Dust-2.3.1... cabal: At least the following dependencies are missing: Dust-crypto >=0.2, base64-bytestring -any, network -any, random-extras -any, random-fu -any, random-source -any, split -any, threefish -any

cabal install --only-dependencies

root@Euclid:/source/Dust/hs# cabal install --only-dependencies Resolving dependencies... cabal: Could not resolve dependencies: trying: Dust-2.3.1 trying: crypto-api-0.13/installed-370... trying: directory-1.2.0.1/installed-91a... rejecting: unix-2.7.0.1/installed-5de... (conflict: directory => unix==2.6.0.1/installed-f12...) rejecting: unix-2.6.0.1/installed-f12... (conflict: crypto-api => bytestring==0.10.4.0/installed-001..., unix => bytestring==0.10.0.2/installed-4f9...) rejecting: unix-2.7.0.1, 2.7.0.0, 2.6.0.1, 2.6.0.0, 2.5.1.1, 2.5.1.0, 2.5.0.0, 2.4.2.0, 2.4.1.0, 2.4.0.2, 2.4.0.1, 2.4.0.0, 2.3.2.0, 2.3.1.0, 2.3.0.0, 2.2.0.0, 2.0 (conflict: directory => unix==2.6.0.1/installed-f12...)

blanu commented 10 years ago

I've been banging my head against the cabal dependency hell. As far as I can tell, this isn't a problem I can resolve in the Dust package. The problem is in conflicting version requirements coming from dependencies of dependencies of Dust.

Things I have tried which worked on my system: Update your cabal to a version which has the --reinstall and --force-reinstalls options. You can use these to get working versions of libraries. Using these options may break other libraries you have installed, but since I only have Dust installed it sometimes works.

Make sure to do a "cabal update" so that you have the newest versions of all libraries. Make sure you have the newest version of cabal as well.

For problematic libraries, download the source, and compile and install them locally instead of automatically downloading them from hackage.

Long term possible solutions: Reduce dependencies. Each library required introduces new possibilities for version conflicts. Normally I like to use libraries to keep the codebase small, but in this case it might be better to only use libraries when necessary.

Eliminate dependencies by copying code into the codebase. This is considered bad software engineering, but there are instances such as utility libraries where we only need a couple of functions and copying them could eliminate the whole library as a dependency (and most of its dependencies).

Provide pre-compiled binaries. On Ubuntu I have made binaries such that there is no need to compile Haskell code and manage dependencies at all. Of course I can't make binaries for every OS, distro, and architecture. I can pick a handful though and eliminate compilation problems for those, assuming people are interested mainly in the executable tools which use Dust. For people that want to write software that uses Dust, they will still need the library. For the future I'm investigating compiling Dust into a C library and that could be precompiled as well.

burncycl commented 10 years ago

I have updated my cabal to "the latest version" based on my OS and Cabal version from apt-get, but you also mention updating my cabal to the version where --reinstall and --force-reinstalls are options

I am currently testing with: cabal-install version 1.16.0.2 using version 1.16.0 of the Cabal library Ubuntu 14.04 LTS

Could you please provide the various relevant versions of software you're using (e.g. OS, cabal, etc.) in order to recreate the build environment most suited to your application. Or, document an installation path. This will help eliminate guess work on my part.

I'd also be happy to document the installation path once I figure things out on the Wiki.

Thanks.