Ticket #3090 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 weeks ago

ghc-pkg update should fail if dependent packages might break

Reported by: simonmar Owned by:
Priority: high Milestone: 7.6.1
Component: Package system Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

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.

Attachments

ghc-pkg-update-check-for-dependents.patch.gz Download (160.4 KB) - added by simonmar 3 years ago.
patch for ghc
ghc-pkg-update-check-for-dependents.testsuite.patch.gz Download (7.6 KB) - added by simonmar 3 years ago.
patch for testsuite

Change History

Changed 3 years ago by simonmar

patch for ghc

Changed 3 years ago by simonmar

patch for testsuite

Changed 3 years ago by duncan

For cabal-install to update a whole bunch of packages correctly we would need more than just ghc-pkg update, if we implement this check. We would need to be able to register/update a whole batch of packages at once. Or we'd have to unregister each package and all its dependencies (in reverse order) and then re-register them all (assuming we did actually update them all).

Changed 3 years ago by malcolm.wallace@…

Or cabal-install could use ghc-pkg register --force on all dependent packages (but not on the root package?)

Changed 3 years ago by igloo

  • milestone set to 6.12.1

Changed 3 years ago by simonmar

  • component changed from Compiler to Package system

Changed 3 years ago by igloo

  • failure set to None/Unknown
  • milestone changed from 6.12.1 to 6.14.1

Changed 18 months ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 15 months ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 9 months ago by igloo

  • priority changed from normal to high
  • status changed from new to patch
  • milestone changed from 7.2.1 to 7.6.1

Changed 3 weeks ago by simonpj

  • status changed from patch to closed
  • resolution set to wontfix

Closing because

  • cabal install already checks
  • Sooner or later (sooner we hope) Cabal will be able to install multiple instances of a package without breakage.
Note: See TracTickets for help on using tickets.