Oddity with 'cabal install' in GHC 7.4.1

Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install' a second time without first doing a 'ghc-pkg unregister <package-name>', I get the following complaint: cabal: The install plan contains reinstalls which can break your GHC
installation. You can try --solver=modular for the new modular solver that chooses such reinstalls less often and also offers the --avoid-reinstalls option. You can also ghc-pkg unregister the affected packages and run ghc-pkg check to see the effect on reverse dependencies. If you know what you are doing you can use the --force-reinstalls option to override this reinstall check.
The only path I've found so far that's willing to rebuild or even say nothing needs rebuilding (when nothing does) is to 'ghc-pkg unregister' and then 'cabal install' again. I'm getting the same behavior on Red Hat 5 and Mac OS 10.6.8, both compiled from sources. Does anyone know what's going on here? -- Conal

Hi Conal.
On Sun, Feb 5, 2012 at 12:36 AM, Conal Elliott
Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install' a second time without first doing a 'ghc-pkg unregister <package-name>', I get the following complaint:
[...]
The warning is intended to prevent you from breaking your system without knowing that you know that you're running a potentially dangerous cabal invocation. The --force-reinstalls flag should always make it build. If it doesn't, it's a bug. In addition, I'm planning to make the warning a little bit less aggressive before the release.
The only path I've found so far that's willing to rebuild or even say nothing needs rebuilding (when nothing does) is to 'ghc-pkg unregister' and then 'cabal install' again. I'm getting the same behavior on Red Hat 5 and Mac OS 10.6.8, both compiled from sources.
I'd be surprised if the OS matters. But as I said, I've not yet encountered a situation where it wouldn't build given --force-reinstalls. Cheers, Andres

On Sat, Feb 4, 2012 at 9:51 PM, Andres Löh
Hi Conal.
On Sun, Feb 5, 2012 at 12:36 AM, Conal Elliott
wrote: Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install' a second time without first doing a 'ghc-pkg unregister <package-name>', I get the following complaint:
[...]
The warning is intended to prevent you from breaking your system without knowing that you know that you're running a potentially dangerous cabal invocation.
The --force-reinstalls flag should always make it build. If it doesn't, it's a bug.
In addition, I'm planning to make the warning a little bit less aggressive before the release.
Before the release of what? (seeing as GHC 7.4.1 has been released)
The only path I've found so far that's willing to rebuild or even say nothing needs rebuilding (when nothing does) is to 'ghc-pkg unregister' and then 'cabal install' again. I'm getting the same behavior on Red Hat 5 and Mac OS 10.6.8, both compiled from sources.
I'd be surprised if the OS matters. But as I said, I've not yet encountered a situation where it wouldn't build given --force-reinstalls.
Cheers, Andres
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

In addition, I'm planning to make the warning a little bit less aggressive before the release.
Before the release of what? (seeing as GHC 7.4.1 has been released)
Sorry, I should have been clear. Before the release of cabal-install. The described behaviour only occurs in the current development version of cabal-install. It isn't tied directly to GHC 7.4.1. Cheers, Andres

Hi Andres,
Thanks for the reply! Note that I get this message even running 'cabal
install' a second time after changing nothing. Is that scenario an example
of what you mean by a "potentially dangerous cabal invocation"? I've been
unable to avoid this error message by any other means that (a) 'ghc-pkg
unregister <package>' or (b) '--force-reinstall'. So far,
'--solver=modular' hasn't helped. So I'm hoping for something less
aggressive. In particular, in case nothing has changed, I want 'cabal
install' to succeed (exit code 0) so that my automated build & install &
release processes will continue rather than get stopped.
Regards, - Conal
On Sat, Feb 4, 2012 at 9:51 PM, Andres Löh
Hi Conal.
On Sun, Feb 5, 2012 at 12:36 AM, Conal Elliott
wrote: Since upgrading to 7.4.1, if I 'cabal install' successfully and then 'cabal install' a second time without first doing a 'ghc-pkg unregister <package-name>', I get the following complaint:
[...]
The warning is intended to prevent you from breaking your system without knowing that you know that you're running a potentially dangerous cabal invocation.
The --force-reinstalls flag should always make it build. If it doesn't, it's a bug.
In addition, I'm planning to make the warning a little bit less aggressive before the release.
The only path I've found so far that's willing to rebuild or even say nothing needs rebuilding (when nothing does) is to 'ghc-pkg unregister' and then 'cabal install' again. I'm getting the same behavior on Red Hat 5 and Mac OS 10.6.8, both compiled from sources.
I'd be surprised if the OS matters. But as I said, I've not yet encountered a situation where it wouldn't build given --force-reinstalls.
Cheers, Andres

Hi Conal.
Thanks for the reply! Note that I get this message even running 'cabal install' a second time after changing nothing. Is that scenario an example of what you mean by a "potentially dangerous cabal invocation"?
The check currently is entirely ad-hoc. Any reinstallation of an existing package triggers the warning. There's no hash comparison.
I've been unable to avoid this error message by any other means that (a) 'ghc-pkg unregister <package>' or (b) '--force-reinstall'. So far, '--solver=modular' hasn't helped. So I'm hoping for something less aggressive. In particular, in case nothing has changed, I want 'cabal install' to succeed (exit code 0) so that my automated build & install & release processes will continue rather than get stopped.
The message appears, but building should work, with --force-reinstall and no --dry-run. Can you confirm that you've tried that? Cheers, Andres

I've been unable to avoid this error message by any other means that (a) 'ghc-pkg unregister <package>' or (b) '--force-reinstall'. So far, '--solver=modular' hasn't helped. So I'm hoping for something less aggressive. In particular, in case nothing has changed, I want 'cabal install' to succeed (exit code 0) so that my automated build & install & release processes will continue rather than get stopped.
The message appears, but building should work, with --force-reinstall and no --dry-run. Can you confirm that you've tried that?
Actually, the message should not even appear if --force-reinstalls is given. Are you using the latest development version of cabal-install from darcs? Cheers, Andres

On Sun, Feb 5, 2012 at 12:43 AM, Andres Löh
Hi Conal.
Thanks for the reply! Note that I get this message even running 'cabal install' a second time after changing nothing. Is that scenario an example of what you mean by a "potentially dangerous cabal invocation"?
The check currently is entirely ad-hoc. Any reinstallation of an existing package triggers the warning. There's no hash comparison.
I'm confused. Isn't package re-installation an extremely common thing in cabal while developing software? Do you cope by habitually adding --force-reinstall during development? Perhaps that habit is the piece missing from my mental picture.
unable to avoid this error message by any other means that (a) 'ghc-pkg unregister <package>' or (b) '--force-reinstall'. So far, '--solver=modular' hasn't helped. So I'm hoping for something less aggressive. In
I've been particular,
in case nothing has changed, I want 'cabal install' to succeed (exit code 0) so that my automated build & install & release processes will continue rather than get stopped.
The message appears, but building should work, with --force-reinstall and no --dry-run. Can you confirm that you've tried that?
Cheers, Andres
Yes, building does work for me with --force-reinstall. -- Conal

On Sun, Feb 5, 2012 at 10:48 AM, Conal Elliott
On Sun, Feb 5, 2012 at 12:43 AM, Andres Löh
wrote: Hi Conal.
Thanks for the reply! Note that I get this message even running 'cabal install' a second time after changing nothing. Is that scenario an example of what you mean by a "potentially dangerous cabal invocation"?
The check currently is entirely ad-hoc. Any reinstallation of an existing package triggers the warning. There's no hash comparison.
I'm confused. Isn't package re-installation an extremely common thing in cabal while developing software?
I would say, "You should never mutate your user or global package database" and recommend using cabal-dev. The way cabal-install does destructive updates is evil. In particular, it likes to mutate your global or user package database. You run the risk of building something and then breaking it later by mutating its dependencies. With cabal-dev it would be more like this: # Suppose you're in the source of bar # Further suppose you just changed # dependency 'foo' that you're also developing cabal-dev add-source ../foo cabal-dev install --reinstall foo Technically this still mutates a package database but, it's a throwaway package database in the bar directory. I lose very little when I 'rm -rf cabal-dev dist' and my user and global package databases stay in tact. I feel as though I can't sing the sandboxed-build praise loudly enough. The time my computer takes to rebuild packages is negligible to the human time spent dealing with broken package databases.. I hope that helps, Jason

Ah -- so use cabal-dev for development and cabal-install when a version
stabilizes? -- Conal
On Sun, Feb 5, 2012 at 4:20 PM, Jason Dagit
On Sun, Feb 5, 2012 at 10:48 AM, Conal Elliott
wrote: On Sun, Feb 5, 2012 at 12:43 AM, Andres Löh
wrote: Hi Conal.
Thanks for the reply! Note that I get this message even running 'cabal install' a second time after changing nothing. Is that scenario an example of what you mean by a "potentially dangerous cabal invocation"?
The check currently is entirely ad-hoc. Any reinstallation of an existing package triggers the warning. There's no hash comparison.
I'm confused. Isn't package re-installation an extremely common thing in cabal while developing software?
I would say, "You should never mutate your user or global package database" and recommend using cabal-dev. The way cabal-install does destructive updates is evil. In particular, it likes to mutate your global or user package database. You run the risk of building something and then breaking it later by mutating its dependencies.
With cabal-dev it would be more like this: # Suppose you're in the source of bar # Further suppose you just changed # dependency 'foo' that you're also developing cabal-dev add-source ../foo cabal-dev install --reinstall foo
Technically this still mutates a package database but, it's a throwaway package database in the bar directory. I lose very little when I 'rm -rf cabal-dev dist' and my user and global package databases stay in tact. I feel as though I can't sing the sandboxed-build praise loudly enough. The time my computer takes to rebuild packages is negligible to the human time spent dealing with broken package databases..
I hope that helps, Jason
participants (4)
-
Andres Löh
-
Conal Elliott
-
Jason Dagit
-
Thomas DuBuisson