Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Don't recommend --force-reinstalls #1201

Closed
wants to merge 2 commits into from

4 participants

Sönke Hahn Mikhail Glushenkov Duncan Coutts Andres Löh
Sönke Hahn

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.

Sönke Hahn soenkehahn better warning message: suggest '--avoid-reinstalls' or
'ghc-pkg unregister' in case 'cabal install' selects destructive
reinstalls
b096fce
Mikhail Glushenkov
Collaborator

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

Sönke Hahn

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

Mikhail Glushenkov
Collaborator

@kosmikus Do you agree with this change?

Duncan Coutts
Collaborator

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).

Sönke Hahn

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?

Andres Löh
Collaborator

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.

Mikhail Glushenkov
Collaborator

Closing as rejected.

Mikhail Glushenkov 23Skidoo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2013
  1. Sönke Hahn

    better warning message: suggest '--avoid-reinstalls' or

    soenkehahn authored
    'ghc-pkg unregister' in case 'cabal install' selects destructive
    reinstalls
Commits on Feb 17, 2013
  1. Sönke Hahn
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 cabal-install/Distribution/Client/Install.hs
4 cabal-install/Distribution/Client/Install.hs
View
@@ -431,7 +431,9 @@ checkPrintPlan verbosity installed installPlan sourcePkgDb
then if dryRun then [] else
["Continuing even though the plan contains dangerous reinstalls."]
else
- ["Use --force-reinstalls if you want to install anyway."]
+ ["Try --avoid-reinstalls to avoid selecting destructive reinstalls or " ++
+ "manually uninstall conflicting packages.",
+ "Use --force-reinstalls if you want to install anyway (including destructive reinstalls)."]
else unless dryRun $ warn verbosity
"Note that reinstalls are always dangerous. Continuing anyway..."
Something went wrong with that request. Please try again.