[Git][ghc/ghc][wip/haanss/depdir] 2 commits: user guide and release notes
Hassan Al-Awwadi pushed to branch wip/haanss/depdir at Glasgow Haskell Compiler / GHC Commits: 6f0e08a8 by Hassan Al-Awwadi at 2025-07-11T14:11:49+02:00 user guide and release notes - - - - - 53045685 by Hassan Al-Awwadi at 2025-07-11T14:41:21+02:00 removed leftover import - - - - - 3 changed files: - compiler/GHC/Tc/Gen/Splice.hs - docs/users_guide/9.14.1-notes.rst - docs/users_guide/separate_compilation.rst Changes: ===================================== compiler/GHC/Tc/Gen/Splice.hs ===================================== @@ -173,8 +173,6 @@ import GHC.Parser.HaddockLex (lexHsDoc) import GHC.Parser (parseIdentifier) import GHC.Rename.Doc (rnHsDoc) -import System.Directory(listDirectory) - {- Note [Template Haskell state diagram] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== docs/users_guide/9.14.1-notes.rst ===================================== @@ -232,6 +232,11 @@ Cmm They are replaced, respectively, by ``SpecialiseEP``, ``pragSpecED`` and ``pragSpecInlED``. +- We have added the ``addDependentDirectory`` function to match + ``addDependentFile``, which adds a directory to the list of dependencies that + the recompilation checker will look at to determine if a module needs to be + recompiled. + Included libraries ~~~~~~~~~~~~~~~~~~ ===================================== docs/users_guide/separate_compilation.rst ===================================== @@ -710,7 +710,7 @@ beautiful sight! You can read about :ghc-wiki:`how all this works <commentary/compiler/recompilation-avoidance>` in the GHC commentary. Recompilation for Template Haskell and Plugins -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Recompilation checking gets a bit more complicated when using Template Haskell or plugins. Both these features execute code at compile time and so if any of the @@ -727,6 +727,17 @@ if ``foo`` is from module ``A`` and ``bar`` is from module ``B``, the module wil now depend on ``A.o`` and ``B.o``, if either of these change then the module will be recompiled. +``addDependentFile`` and ``addDependentDirectory`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When using Template Haskell or plugins, you can use the functions +``addDependentFile`` and ``addDependentDirectory`` to add additional +dependencies to the module being compiled. When adding a file, this means +that the contents of the file changing between compilations will trigger a +recompilation of the module. When adding a directory, this means that any +file or subdirectory *added* to or *removed* from the directory will trigger +recompilation of the module, so it is not a recursive dependency. + .. _mutual-recursion: Mutually recursive modules and hs-boot files View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/75856938050c94945fc6ca91c0cf542... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/75856938050c94945fc6ca91c0cf542... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Hassan Al-Awwadi (@hassan.awwadi)