Skip to content
Mikolaj edited this page Jan 10, 2013 · 38 revisions

We keep track of the discovered GHC bugs and inconvenient features, in particular, to know what we have to work around depending on which version of GHC we deploy with.

  • setSessionDynFlags does not always work

    Worked around for 7.4.2 and 7.6.1, fixed in 7.6.2, workaround ifdefed.

  • GHC API displays linker messages to stdout instead of via log_action

    Worked around for all versions by suppressing stdout during compilation and setting GHC verbosity to 0 during execution. Not fixed upstream. Workaround are marked with comments, but not ifdefed, because they are a sensible precaution against any other kinds of stray output that may crop up.

  • GHC API reports CPP errors in confusing ways

    Partially worked around for all versions by capturing the errors and merging them with standard errors. Not fixed upstream yet. There may be other, similar cases where the workaround helps. The workaround code is not particularly hacky, just not perfectly effective, so it makes sense to keep it even after the original problem is fixed, so not ifdefing the workaround to any specific GHC version nor marking it in the code in any way.

  • getModificationTime gives only second-level resolution

    Worked around for all versions (tested on 7.4.2), fixed in 7.8.1 for Linux only. The workaround code is contained to IdeSession.hs, but it has to be all over the place, so ifdefing it would make the file much less readable and would require nontrivial maintenance. When we switch to GHC >= 7.8 we have to either get rid of the workaround or ifdef its most recent version, if we really need to.

  • We need to disable GHC's debugging facility in order to be able to interrupt code

    GHC does not give us an explicit API for terminating code started using runStmt. The workaround is described in the ticket but requires that we disable the GHC debugging facility, which eventually will not be good enough. This is presumably fixed for 7.8.1 (though not tested), so the workaround is ifdefed to be ignored for GHC >= 7.8. We will quickly learn, via our tests, if the fix is not effective or requires some further code changes on our part.

  • GHC may crash with a hard crash when attempting to run uncompiled code

    This is not a major problem, because we can guard against this in ide-session, but when we don't (because of a bug or otherwise) it makes for some difficult debugging. No workaround as such is needed, so the code is not ifdefed either.

  • We have no high-level way of resetting the Handles

    Not sure if this is an API bug per say; see Issue 24 and the corresponding commit. Anyway, the workaround is so extensive (involves extra packages, etc.) that ifdefing or marking the workaround code is not practical.

  • GHC API dependency analysis is broken

    Worked around for 7.4.2 (with some luck it should work for any 7.4.*), workaround ifdefed to be ignored for GHC >= 7.6.2 and to cause compilation failure for GHC == 7.6.1. It is fixed upstream for 7.6.2 as GHCi erroneously unloads modules after a failed :reload. If we ever switch to 7.6.1, a similar workaround has to be cloned from GHC 7.6.1 sources and patched with the 7.6.2 fix.

Clone this wiki locally