capn.freako@gmail.com | 25 Apr 00:29 2013
Picon

Fwd: How to do automatic reinstall of all dependencies?



-db

----- Forwarded message -----
From: "Captain Freako" <capn.freako <at> gmail.com>
Date: Tue, Apr 23, 2013 9:21 pm
Subject: How to do automatic reinstall of all dependencies?
To: <haskell-cafe <at> haskell.org>

Hi all,

Does anyone know why the following is not working, as an automatic way of reinstalling all dependencies?:

dbanas <at> dbanas-lap:~/prj/AMI-Tool$ cabal install --only-dependencies --reinstall --force-reinstalls parsec
Resolving dependencies...
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
dbanas <at> dbanas-lap:~/prj/AMI-Tool$

Thanks,
-db

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Erik Hesselink | 25 Apr 10:35 2013
Picon

Re: Fwd: How to do automatic reinstall of all dependencies?

I think --reinstall only reinstalls the package you are actually
installing, not the dependencies. You could try using a sandboxing
tool, like cabal-dev. Then you just do 'cabal-dev install', and when
you want to reinstall everything, you do 'rm cabal-dev/' to wipe the
sandbox and start over.

Regards,

Erik

On Thu, Apr 25, 2013 at 12:29 AM, capn.freako <at> gmail.com
<capn.freako <at> gmail.com> wrote:
>
>
> -db
>
> ----- Forwarded message -----
> From: "Captain Freako" <capn.freako <at> gmail.com>
> Date: Tue, Apr 23, 2013 9:21 pm
> Subject: How to do automatic reinstall of all dependencies?
> To: <haskell-cafe <at> haskell.org>
>
> Hi all,
>
> Does anyone know why the following is not working, as an automatic way of
> reinstalling all dependencies?:
>
> dbanas <at> dbanas-lap:~/prj/AMI-Tool$ cabal install --only-dependencies
> --reinstall --force-reinstalls parsec
> Resolving dependencies...
> All the requested packages are already installed:
> Use --reinstall if you want to reinstall anyway.
> dbanas <at> dbanas-lap:~/prj/AMI-Tool$
>
> Thanks,
> -db
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
Alexander Kjeldaas | 25 Apr 11:03 2013
Picon

Re: Fwd: How to do automatic reinstall of all dependencies?


This is not what you asked for, but reinstalling all dependencies probably isn't such a good idea, because ultimately some dependencies are shipped with GHC and you might not be able to reinstall them.

Here is a useful formula I developed to avoid cabal-hell and always upgrade dependencies whenever a new package is installed.

$ cabal install --upgrade-dependencies  `eval echo $(ghc-global-constraints )` <package-name>

What this does is fix the version of all global packages.  These are by default the ones that are shipped with ghc, so the above command explicitly excludes those from being upgraded.

The ghc-global-constraints function is something I have in my .bashrc file, and it looks like this:

function ghc-global-constraints() {
    ghc-pkg list --global | tail -n+2  | head -n-1 | grep -v '(' | while read a; do
        VER=${a##*-}
        PKG=${a%-*}
        echo -n "--constraint='$PKG==$VER' "
    done
}

This technique depends on actually fixing broken package dependencies, but today that's usually just a github fork away, and often easier than dealing with multiple cabal-dev installations IMO.

Alexander



On Thu, Apr 25, 2013 at 12:29 AM, capn.freako <at> gmail.com <capn.freako <at> gmail.com> wrote:


-db

----- Forwarded message -----
From: "Captain Freako" <capn.freako <at> gmail.com>
Date: Tue, Apr 23, 2013 9:21 pm
Subject: How to do automatic reinstall of all dependencies?
To: <haskell-cafe <at> haskell.org>

Hi all,

Does anyone know why the following is not working, as an automatic way of reinstalling all dependencies?:

dbanas <at> dbanas-lap:~/prj/AMI-Tool$ cabal install --only-dependencies --reinstall --force-reinstalls parsec
Resolving dependencies...
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
dbanas <at> dbanas-lap:~/prj/AMI-Tool$

Thanks,
-db


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Johannes Waldmann | 25 Apr 14:04 2013
Picon

Re: Fwd: How to do automatic reinstall of all dependencies?

Alexander Kjeldaas <alexander.kjeldaas <at> gmail.com> writes:

 cabal install --upgrade-dependencies  `eval echo $(ghc-global-constraints
)` <package-name>

for a moment I was reading "ghc --global-constraints" there ... - J.W.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane