• Simon Marlow's avatar
    Refuse to run any commands if the .cabal has been modified · 1f05d301
    Simon Marlow authored
    See GHC bug #1372
    This is a consistency check, intended to prevent this class of build
       * Package P is updated, its version number is bumped, the
         new version is compiled and installed.
       * Package Q depends on P.  Q is modified to use the new P, and Q's
         .cabal file is updated with changes to the build-depends field to
         depend on the new version of P.
       * The user has an old build of Q.  They pull the changes to Q and
         'setup build' without cleaning or re-configuring.  Build errors
         ensue, because the code of Q depends on changes to P's API, and
         we're still building against the old P.
    Note that you can't get segfaults this way, only build errors.
    This also relies on some new consistency checking in GHC 6.8 to work
    properly.  If the user re-configures their Q build and then issues
    'setup build' without cleaning, GHC must now realise that the package
    flags have changed, and re-compile all the affected Q modules.  GHC
    6.6 would not do this, but 6.8 does.
LocalBuildInfo.hs 7.16 KB