Skip to content

ghc-pkg update should fail if dependent packages might break

If a package is recompiled and re-installed, and other packages depend on it, those packages might be broken; e.g. see #3060 (closed).

Hence ghc-pkg update should refuse to perform the update, unless explicitly overridden with --force. However, it's not quite as simple as that:

  • The package might already have been installed over the top of the old one, and

    it's too late to reverse that.

  • cabal-install likes to build and install a bunch of packages at the same time,

    using ghc-pkg update on each one. This will fail.

  • The GHC build system uses ghc-pkg update to register packages, and this

    breaks when packages are re-built (it's ok for a clean build, though).

I've attached a couple of patches to implement it, but let's hold these back until the above issues are sorted out.

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information