kosmikus / lhs2tex

Preprocessor for typesetting Haskell sources with LaTeX
Other
99 stars 28 forks source link

Allow building with Cabal-3.0 (GHC 8.8) #76

Closed RyanGlScott closed 4 years ago

RyanGlScott commented 4 years ago

Various minor tweaks are needed to fix the build the custom Setup script with Cabal-3.0:

RyanGlScott commented 4 years ago

The large remaining hurdle to getting cabal-install-3.0 (which GHC 8.8 requires) to work with the current Travis configuration. Since cabal-install-3.0 uses new-build by default, this command now fails:

$ cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/CmdInstall.hs:233:5 in main:Distribution.Client.CmdInstall
cabal: --enable-tests was specified, but tests can't be enabled in a remote
package

I can think of two possible ways to work around this:

  1. Require cabal-install-2.4.0.0 as the minimum and use cabal v1-install everywhere in .travis.yml
  2. Tweak .travis.yml to use cabal v1-install on newer versions of cabal only by using bash tricks (something like if [ $CABALVER -ge 2400 ] ; then CABALV1="cabal v1-"; else CABALV1="cabal " fi)
RyanGlScott commented 4 years ago

A third option would be:

  1. Convert .travis.yml over to use new-build everywhere.

This option would also require raising the minimum version of cabal-install used on Travis.

RyanGlScott commented 4 years ago

I've implemented each of options (1)-(3) above to see how each one would work:

  1. https://github.com/RyanGlScott/lhs2tex/commit/88d482fb839da1eaca74e42610d607785ea97e0c
  2. https://github.com/RyanGlScott/lhs2tex/commit/5db39bee67c52f17f15d9d8d6433178859d80432
  3. https://github.com/RyanGlScott/lhs2tex/commit/6be23fd9d05d4a2773a7559b0325d7b95eb8343d

Which approach would you prefer to use?

RyanGlScott commented 4 years ago

Ping @kosmikus

kosmikus commented 4 years ago

@RyanGlScott Thanks, and sorry for the delay. I've merged your option 3.

RyanGlScott commented 4 years ago

Thanks! Could you release these changes to Hackage as well?

RyanGlScott commented 4 years ago

Ping.