ekmett/heaps

Can't be used to bootstrap GHC

Closed this issue · 8 comments

In the most recent version of Shake, I added heaps as a dependency. Unfortunately, while heaps has no problematic actual dependencies, the Setup.hs file depends on Cabal and cabal-doctest. The latest cabal-doctest is no longer compatible with Cabal HEAD as used to build GHC. There are a few ways around this issue:

  1. Stop using cabal-doctest as a setup dependency.
  2. Have me inline the parts of Heap I need into Shake itself. I'm going to do that as a temporary step anyway.
  3. Upgrade cabal-doctest to work with HEAD Cabal, but that's will need to be done going forward too.

CC @snowleopard

There's a fourth option here as well:

  1. Use head.hackage to build dependencies with GHC HEAD.

Indeed, I added a head.hackage patch for cabal-doctest here for precisely this reason.

cc @phadej

I don't use head.hackage, so it doesn't fit my workflow, so while it might be enough for some people I'd still need another solution.

While I'm sympathetic to the desire to have shake build with GHC HEAD at all times, keeping cabal-doctest in sync with HEAD can prove to be a nightmare due to how quickly the Cabal API changes in its development process. We'd have to constantly be churning out new Hackage releases of cabal-doctest to stay in line with the moving target of HEAD. More than likely, most of those releases would bitrot by the time the next major release of GHC came out, which would require time and effort to go back and make metadata revisions to repair the old, broken versions of cabal-doctest that no longer compile with the new major release.

This is why I strongly encourage people to use head.hackage, since it allows people who use GHC HEAD to stay on top of the latest development changes without spamming Hackage with a bunch of releases to stay in sync with HEAD. It also means that developers don't have to worry about incurring dependencies as much as they used to, since head.hackage can ensure that they're always building without issues.

Option (5) also sounds reasonable. Is there a way to remove the custom Setup.hs stanza while still retaining the ability to run doctests locally (within the heaps repo itself)?

@ndmitchell, #14 features a version of heaps without the cabal-doctest dependency. Would this work for your needs?

  1. would be the best option, and #14 gets there. I think @phadej is right that Shake should avoid build-type Custom.

I've released heaps-0.3.6.1 to Hackage without a cabal-doctest dependency. Let me know if anything else is required on heaps' end.