Commit d80caca1 authored by Committed by Ben GamariBrowse files
Error early when you register with too old a version of Cabal.
On the GHC 8.0 RCs, multiple users reported a very strange error whereby GHC would complain that the symbols names recorded in interface files did not match the expected name. The reason for this is that they were using an old version of Cabal which chose symbol names differently from the installed package ID ('id' field) which the package was to be installed with; GHC 8.0 now mandates that these coincides. This change adds a test to ghc-pkg to make sure that 'id' and 'key' (which is how Cabal previously reported what the symbol name was supposed to be) match; if they don't match or key is missing, we assume that the Cabal was too old. Bikeshed points: - Should we offer more information about how to upgrade Cabal correctly (i.e. specify a version?) - Should we allow for a missing 'key'? If we allow for 'key' to be missing, we lose the ability to detect Cabal from GHC 7.8 or earlier being used. If we require it to be specified, then it will not be possible for Cabal to deprecate the (unused) field and remove it without having BC for 8.0. Signed-off-by: Edward Z. Yang <firstname.lastname@example.org> Test Plan: validate Reviewers: austin, bgamari, hvr Reviewed By: hvr Subscribers: bergmark, thomie Differential Revision: https://phabricator.haskell.org/D1892 GHC Trac Issues: #11558