Don't recommend --force-reinstalls #1201

wants to merge 2 commits into

4 participants


In case 'cabal install' selects destructive reinstalls it suggests '--force-reinstalls'. In my experience this is seldom what one wants since it is likely to destroy other installed libraries. It should additionally suggest '--avoid-reinstalls' and/or manually unregistering conflicting packages.

Feel free to rephrase the warning message.

@soenkehahn soenkehahn better warning message: suggest '--avoid-reinstalls' or
'ghc-pkg unregister' in case 'cabal install' selects destructive
Haskell member

I don't think you can assume that the underlying compiler is GHC here.


@23Skidoo: Of course, you're right. Thanks.

Haskell member

@kosmikus Do you agree with this change?

Haskell member

I'm not convinced. It's often the case that --force-reinstalls is exactly what is needed. For example when hacking on a collection of related packages, making a change in a dependent package and then rebuilding. Of course it's going to break the others, but I'm rebuilding them so that's fine.

I'm happy with making the warning clearer and/or more fierce. I'm not sure that recommending --avoid-reinstalls is a good idea, I don't think the --avoid-reinstalls behaviour is often what you want (it means it'll select non-ideal versions, e.g. older ones, to avoid breaking existing ones).


I am not at all insisting on my specific wording. And I see your usecase where --force-reinstalls is what one wants. I still think it would be good to tell users that there are alternatives to --force-reinstalls.

Would you be happier with the warning if it mentioned the disadvantages of --avoid-reinstalls?


I'm not convinced either. I completely agree that the suggestion to use --force-reinstalls leads to people typing --force-reinstalls and subsequently complaining that everything is broken. However, --avoid-reinstalls in my experience is even less often what you want. It looks good in theory. But most of the time there are some old versions with missing upper bounds around, so you'll just turn a solver error into a build phase error.

Haskell member

Closing as rejected.

@23Skidoo 23Skidoo closed this Jul 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment