Skip to content

Instantly share code, notes, and snippets.

@23Skidoo
Last active April 1, 2020 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 23Skidoo/9eea1f194858e777330fa0bc43415ddc to your computer and use it in GitHub Desktop.
Save 23Skidoo/9eea1f194858e777330fa0bc43415ddc to your computer and use it in GitHub Desktop.

[ANN] Cabal 3.2 Release

Cabal 3.2 has finally been released, including a whole host of bug fixes, new features, and other goodies. You can find the project Changelog on github if you want the rest of the changeset between this version and Cabal 3.0.

In this post, we'll go over some of the highlights in this release, as well as detail some upcomings line items and milestones for future planned work on the library.

Highlights & Bugfixes

The 3.2 changeset features the following:

  • Improved benchmarking support
  • Solver optimizations
  • Better .lhs support

Benchmarking Support

  • --benchmark-option(s) is now supported by the v2-* commands as of #6224

Of the changes we see in Cabal 3.2, you'll notice from the changelog that several previous bugs have been fixed, and some new features have been added. In this version, bench now accepts the --benchmark-option(s) flag so that you can now pass options to benchmark executables in the same sense that --test-option(s) works. For example, if you're running criterion as I do for many projects, you often want to disiplay output, and one would have to call something similar to cabal run bench -- --arg1 --arg2 ... in order to get it to run with that option. Now, I can simply pass the --benchmark-option(s) argument and use cabal bench. That's a quality of life improvement! The same support for --benchmark-option(s) is now available for all of the v2-* era commands.

Solver Optimizations

  • Solver optimized skip for a package version if it doesn't resolve conflicts in the last version controlled by --fine-grained-conflicts (on by default) as of #5918

Some new optimizations have been added to Cabal to improve the solver's ability to skip packages that it knows will not fix conflicts. The --fine-grained-conflicts flag is now used by default under the hood, and flag triggers the solver to not consider other versions of a package that have no hope of solving a conflict if the last tried version didn't solve it. For a really detailed description of how this works, including examples, see /u/grayjay's post on the pull request.

.lhs` Support

  • .lhs files now work with cabal v2-run as of #6134

A literate version, at least, without additional syntax. Not much to say here. Literate Haskell fans rejoice.

Future Plans

  • so, the masterplan is that we want to get rid of v1-* eventually; it's a dead-weight to those working on cabal now the question is how to get there fastest.
  • the warnings in 2.4 were a strategy to raise awareness.
  • I’d have to lookup the discussions we had about how to go about this, to remind myself what options we contemplated
  • 3.4 would occur w/ ghc 8.12
  • v1 and v2 commands were switched as of 3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment