Dependence hell in bondage. It's really hell

Different programming languages ​​use different packaging systems.

In its diverse approach, Java Maven seems to be the best bet for me, since it supports different versions of jar files in folders with version versions and, therefore, there will be no library in conflicting versions.

Next is python. Python pip places its packages in /usr/local/lib/python/dist-packages/site-packages . When there is a version conflict, you can use its virtualenv and live with it.

Nodejs supports installing packages in both local folders and global folders. Until now, I have never had a dependency conflict in global libraries.

Then I was fascinated by the haskell style and started using cabal . First, I installed my libraries inside /home/user1/.cabal . Then, when the package system broke down, one of my friends suggested I delete two folders - /home/user1/.cabal && /home/user1/.ghc . Now the first confusion has arisen why cabal library files are in two .cabal && .ghc . I cleared the library folders ~/.ghc and ~/.cabal and made cabal install from the package source for cabal-db-0.1.12 . Now a new error has appeared, and I was surprised because I misinformed all the local repositories. The error was

 Configuring Cabal-1.22.2.0... Building Cabal-1.22.2.0... Installed Cabal-1.22.2.0 cabal: Error: some packages failed to install: ansi-terminal-0.6.2.1 failed during the configure step. The exception was: user error (The package 'ansi-terminal' requires Cabal library version -any && >=1.6 but no suitable version is installed.) 

Then I tried the safest bet - sandbox for cabal-db . It worked. Then I repeated the sandbox for another pacakge, ghc-pkg-autofix. I did,

 cd ghc-pkg-autofix-0.2.0.1 cabal sandbox init cabal install 

And for a sandbox where there are absolutely no external dependencies, errors appear again,

 cabal: Could not resolve dependencies: trying: ghc-pkg-autofix-0.2.0.1 (user goal) trying: Cabal-1.22.2.0 (dependency of ghc-pkg-autofix-0.2.0.1) next goal: process (dependency of ghc-pkg-autofix-0.2.0.1) rejecting: process-1.2.0.0/installed-06c..., 1.2.3.0, 1.2.2.0, 1.2.1.0, 1.2.0.0, 1.1.0.2, 1.1.0.1, 1.1.0.0 (conflict: ghc-pkg-autofix => process>=1.0 && <1.1) rejecting: process-1.0.1.5, 1.0.1.4, 1.0.1.3, 1.0.1.2, 1.0.1.1, 1.0.0.0 (conflict: Cabal => process>=1.1.0.1 && <1.3) Dependency tree exhaustively searched. Note: when using a sandbox, all packages are required to have consistent dependencies. Try reinstalling/unregistering the offending packages or recreating the sandbox. 

Am I doing something wrong (or) are similar dependency conflicts quite common in cabal? I see that managing dependencies in other languages ​​is much easier.

Note. I am using cabal-install version 1.22.0.0 && The Glorious Glasgow Haskell Compilation System, version 7.8.4

+6
source share
1 answer

"And for a sandbox where there are absolutely no external dependencies," this is not so. The sandbox still has dependencies on the global package database. Things like Cabal, GHC, the process are usually installed in a global package database. Here you want to install ghc-pkg-autofix, which requires a 1.0 process, but you have a newer version of an already installed process. Are you sure you need ghc-pkg-autofix, it seems like it's quite old.

+5
source

Source: https://habr.com/ru/post/985892/


All Articles