Changes between Version 18 and Version 19 of Commentary/Compiler/RecompilationAvoidance


Ignore:
Timestamp:
Feb 17, 2010 1:26:52 PM (4 years ago)
Author:
simonmar
Comment:

Add "package version changes"

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/RecompilationAvoidance

    v18 v19  
    167167   * The ''ABI hash'', which depends on everything that the module 
    168168     exposes about its implementation: think of this as a hash of 
    169      ''exports'' and ''decls''. 
     169     ''export-list hash'' and ''decls''. 
    170170   * The ''export-list hash'', which depends on the contents of the 
    171      export list (a hash of ''exports''). 
     171     export list (a hash of ''exports''), the ''orphan hash'' (see [#Orphans Orphans]) and the package dependencies (see [#Packageversionchanges Package Version Changes]). 
    172172   * The ''orphan hash'', which depends on all the orphan 
    173173     instances/rules in the, and the orphan hashes of all orphan 
    174      modules below this module in the dependency tree (see "Orphans" 
    175      later). 
     174     modules below this module in the dependency tree (see [#Orphans Orphans]). 
    176175 * ''exports'': what the module exports 
    177176 * ''dependencies'': modules and packages that this module depends on 
     
    551550(Correctly triggering recompilation when packages change was one of the things we fixed when implementing fingerprints, see #1372). 
    552551 
     552=== Package version changes === 
     553 
     554If the version of a package is bumped, what forces recompilation of 
     555the things that depend on it? 
     556 
     557 1. If a module from the package is imported directly, then we will notice that the imported module is not amongst the dependencies of the module when it was compiled last, and force a recompilation (see [#Decidingwhethertorecompile Deciding whether to recompile]). 
     558 
     559 2. If a module from the old package is imported indirectly, then the old package will be amongst the package dependencies (`dep_pkgs . mi_deps`), so we must recompile otherwise these dependencies will be inconsistent.  The way we handle this case is by including the package dependencies in the ''export hash'' of a module, so that other modules which import this module will automatically be recompiled when one of the package dependencies changes.  The recompiled module will have new package dependencies, which will force recompilation of its importers, and so on.  Therefore if a package version changes, the change will be propagated throughout the module dependency graph. 
     560 
    553561 
    554562== Interface stability ==