Finer-grained recompilation checking for exports
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:
- module
N
imports moduleM
, -
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 orimport hiding
import ofM
, then we require that the export list ofM
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 thatN
continues to export all these identifiers, with the sameAvail
structure (i.e. we should error ifN
stops bundlingK
orf
withT
) - if we have
import M(T(..))
, we must check that the children ofT
have not changed
- if we have
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}
Merge request reports
Activity
mentioned in issue #25881 (closed)
added 1 commit
- cc426c11 - Finer-grained recompilation checking for exports
added 1 commit
- f29ea1f2 - Finer-grained recompilation checking for exports
I have:
- Updated the nomenclature to focus on "orphan/deps" vs "exported avails". This is because the previous "visible"/"invisible" naming scheme was misleading, as we don't deal with non-orphan class instances here.
- Extended the logic to avoid recompilation in cases such as
import M(T(..))
and the set of children exported byT
does not change; this is tested inExportRecomp1
(happy path) andExportRecomp3
(we do need to recompile, because the children change) - Added the
ExportRecomp5
test which checks that we do recompile in the case of orphans. - Added Note [When to recompile when export lists change?] in
GHC.Iface.Recomp
which explains the new mechanism for recompilation checking.
Edited by sheafadded 1 commit
- d2c822cf - Finer-grained recompilation checking for exports
added 5 commits
-
d2c822cf...d0fd9370 - 4 commits from branch
ghc:master
- e213f378 - Finer-grained recompilation checking for exports
-
d2c822cf...d0fd9370 - 4 commits from branch
- Resolved by sheaf
added 1 commit
- e51900a0 - Finer-grained recompilation checking for exports
- Resolved by sheaf
- Resolved by sheaf
- Resolved by sheaf