Ticket #120 (closed defect: fixed)

Opened 6 years ago

Last modified 17 months ago

misleading error message from cabal when versions differ

Reported by: igloo@… Owned by:
Priority: normal Milestone:
Component: Cabal library Version: 1.1.6
Severity: normal Keywords:
Cc: Difficulty: easy (<4 hours)
GHC Version: 6.6 Platform: Linux

Description

From a GHC ticket:  http://hackage.haskell.org/trac/ghc/ticket/1237

(perhaps configure should record the full path to GHC?)


Using cabal, I do './Setup.hs configure', './Setup.hs build', and 'sudo ./Setup.hs install'. Unfortunately, root's $PATH pointed to a different GHC (6.7 at some point, and not 6.4.2 which I was using), which resulted in the error message:

Setup.hs: error reading ./.setup-config; run "setup configure" command?

Of course, there was nothing wrong with .setup-config, so I spent some time investigating permissions, before int-e suggested that the search path was at fault.

Change History

Changed 6 years ago by duncan

  • difficulty changed from normal to easy (<4 hours)

Or perhaps it should record the version of Cabal that wrote the dist/setup-conf file and complain if they differ.

Changed 5 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed

It now adds a header to the file and checks it again when reading. The header is a line like:

Saved package config for foo-1.0 written by Cabal-1.3.7 using ghc-6.8

It checks this header when reading back the config. If the Cabal versions do not match you'll get this error:

cabal: You need to re-run the 'configure' command. The version of Cabal
being used has changed (was Cabal-1.3.6, now Cabal-1.3.7).

If additionally the compiler versions do not match then you get:

cabal: You need to re-run the 'configure' command. The version of Cabal
being used has changed (was Cabal-1.3.6, now Cabal-1.3.7). Additionally
the compiler is different (was ghc-6.8, now ghc-6.9) which is probably
the cause of the problem.

Of course it does not help for older Cabal versions which lacked this check but it's the best we can do and should help in future.

Changed 17 months ago by elga

Note: See TracTickets for help on using tickets.