Hassan Al-Awwadi pushed to branch wip/haanss/depdir at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • docs/users_guide/separate_compilation.rst
    ... ... @@ -732,12 +732,14 @@ be recompiled.
    732 732
     
    
    733 733
     When using Template Haskell or plugins, you can use the functions
    
    734 734
     ``addDependentFile`` and ``addDependentDirectory`` to add additional
    
    735
    -dependencies to the module being compiled. When adding a file, this means
    
    736
    -that the contents of the file changing between compilations will trigger a
    
    737
    -recompilation of the module. When adding a directory, this means that any 
    
    738
    -file or subdirectory *added* to or *removed* from the directory will trigger
    
    739
    -recompilation of the module, so it is not a recursive dependency.
    
    740
    -  
    
    735
    +dependencies to the module being compiled.
    
    736
    +
    
    737
    +- When adding a file, this means that the contents of the file changing between
    
    738
    +  compilations will trigger a recompilation of the module.
    
    739
    +- When adding a directory, this means that any file or subdirectory *added* to or
    
    740
    +  *removed* from the directory will trigger recompilation of the module, so
    
    741
    +  it is not a recursive dependency.
    
    742
    +
    
    741 743
     .. _mutual-recursion:
    
    742 744
     
    
    743 745
     Mutually recursive modules and hs-boot files
    

  • libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
    ... ... @@ -836,13 +836,17 @@ getPackageRoot = Q qGetPackageRoot
    836 836
     --
    
    837 837
     --   * ghc -M does not know about these dependencies - it does not execute TH.
    
    838 838
     --
    
    839
    ---   * The dependency is shallow, just a hash of its direct contents. It returns
    
    840
    ---     a list of the contents (absolute paths), files and subdirectories both, so
    
    841
    ---     you can manually depend on (a subset of) those, if you wish.
    
    839
    +--   * The dependency is shallow, just a hash of its direct contents.
    
    840
    +--     Basically, it only sees a list of names, and hashes those names.
    
    841
    +--     It does not look at directory metadata, recurse into subdirectories
    
    842
    +--     or look at file contents. As long as the list of names remains the same,
    
    843
    +--     the directory is considered unchanged.
    
    844
    +--
    
    845
    +--   * The state of the directory is read at the interface generation time,
    
    846
    +--     not at the time of the function call.
    
    842 847
     addDependentDirectory :: FilePath -> Q ()
    
    843 848
     addDependentDirectory dp = Q (qAddDependentDirectory dp)
    
    844 849
     
    
    845
    -
    
    846 850
     -- | Record external files that runIO is using (dependent upon).
    
    847 851
     -- The compiler can then recognize that it should re-compile the Haskell file
    
    848 852
     -- when an external file changes.
    
    ... ... @@ -853,7 +857,11 @@ addDependentDirectory dp = Q (qAddDependentDirectory dp)
    853 857
     --
    
    854 858
     --   * ghc -M does not know about these dependencies - it does not execute TH.
    
    855 859
     --
    
    856
    ---   * The dependency is based on file content, not a modification time
    
    860
    +--   * The dependency is based on file content, not a modification time or
    
    861
    +--     any other metadata associated with the file (e.g. permissions).
    
    862
    +--
    
    863
    +--   * The state of the file is read at the interface generation time,
    
    864
    +--     not at the time of the function call.
    
    857 865
     addDependentFile :: FilePath -> Q ()
    
    858 866
     addDependentFile fp = Q (qAddDependentFile fp)
    
    859 867