Running the Cabal tests

Edward Z. Yang ezyang at mit.edu
Sun Mar 20 02:48:31 UTC 2016


Excerpts from Erik de Castro Lopo's message of 2016-03-19 19:24:34 -0700:
> Edward Z. Yang wrote:
> 
> > package-tests currently has a dumb hack to figure out these environment
> > variables: it tries to read out the local build information associated
> > with your build of Cabal. 
> 
> Thank you Ed. That explains some bizare behaviour I'm seeing.
> 
> > Unfortunately, this format is extremely backwards incompatible,
> 
> Not only that, but the assumption that we're currently testing with the
> same version of GHC that cabal-install was compiled with is really not 
> very sound.

Actually, the package test suite doesn't have to make this assumption
(it just does so by default).  If you add CABAL_PACKAGETESTS_WITH_GHC
you can specify a version of GHC to do the tests with, distinct from
the GHC version Cabal was built with.  (It works best if the GHC
versions match, however, because if you build Cabal with ghc-7.10 and
then run the test suite with ghc-7.8 none of the tests which assume
there is a Cabal library available for ghc-7.8 will work.)

> Since cabal-install is supposed to be buildable with the last two verions
> of GHC, I've been trying to build it in my Jenkins instance with ghc-7.8.
> Building has been fine, but I'm now trying to get tests working and that's
> when I ran into this problem.
> 
> So, do you think package-tests can be fixed so it will work the way I'm
> trying to use it or should I just have GHC version specific versions of
> cabal-install when I want to build and run the tests for cabal?

Well, for your specific problem, manually feeding in the environment
variables OR switching to 'build-type: Custom', should be enough.

Edward


More information about the cabal-devel mailing list