Skip to content
Snippets Groups Projects

Finer-grained recompilation checking for exports

Closed sheaf requested to merge sheaf/ghc:T25881 into master

Ticket: #25881 (closed)

This MR refines the recompilation checking logic, to avoid recompiling modules with an explicit import list when the modules they import start exporting new items. More specifically, when:

  1. module N imports module M,
  2. M is changed, but in a way that:
    a. preserves the exports that N imports
    b. does not introduce anything that forces recompilation downstream, such as orphan instances

then we no longer require recompilation of N.

Note that there is more to (2a) as initially meets the eye:

  • if N includes a whole module or import hiding import of M, then we require that the export list of M does not change,

  • if N only includes explicit imports, we check that the imported items don't change, e.g.

    • if we have import M(T(K, f), g), we must check that N continues to export all these identifiers, with the same Avail structure (i.e. we should error if N stops bundling K or f with T)
    • if we have import M(T(..)), we must check that the children of T have not changed

See Note [When to recompile when export lists change?] in GHC.Iface.Recomp.

This is all tested in the new tests RecompExports{1,2,3,4,5}

Edited by sheaf

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • sheaf resolved all threads

    resolved all threads

  • sheaf added 1 commit

    added 1 commit

    • e51900a0 - Finer-grained recompilation checking for exports

    Compare with previous version

  • Matthew Pickering
  • Matthew Pickering
  • Matthew Pickering
  • Looks great. Thanks Sam. I left a few small comments.

  • Matthew Pickering approved this merge request

    approved this merge request

  • sheaf resolved all threads

    resolved all threads

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading