Skip to content
Snippets Groups Projects
  • Finley McIlwaine's avatar
    80f0a652
    Do not use tmp dirs for Haddock, add --haddock-version-cpp, and more · 80f0a652
    Finley McIlwaine authored
    Haddock no longer writes compilation files by default, so we do not need to pass
    tmp dirs for `-hidir`, `-stubdir`, and `-odir` via `--optghc`. Indeed, we do not
    *want* to do so, since it results in recompilation for every invocation of
    Haddock via Cabal. This commit stops this from happening for haddock versions >=
    2.28 (when Hi Haddock was introduced).
    
    This commit also stops the default definition of the `__HADDOCK_VERSION__` macro
    when invoking GHC through haddock. Since a very limited set of users may still
    depend on this macro, we introduce the `--haddock-version-cpp` flag and
    `haddock-version-cpp:` cabal.project field, which enable the definition of
    the `__HADDOCK_VERSION__` macro when invoking GHC through Haddock. This will
    almost guarantee recompilation during documentation generation due to the macro
    definition.
    
    This commit also renames the `--haddock-lib` flag to `--haddock-resources-dir`
    (and `haddock-lib:` cabal.project field to `haddock-resources-dir:`), and adds
    this flag to the users guide since it was missing an entry. This also allows us
    to add this field to `cabal-install:test:integration-tests2`, since it is no
    longer ambiguous with the `--lib` flag.
    
    This commit also causes `documentation: true` or `--enable-documentation` to
    imply `-haddock` for GHC.
    
    Also, since Haddock >= 2.29 is renaming `--lib` to `--resources-dir`, this
    commit switches the flag provided to Haddock using a backwards compatible
    condition based on the Haddock version.
    
    Adds a changelog entry.
    80f0a652
    History
    Do not use tmp dirs for Haddock, add --haddock-version-cpp, and more
    Finley McIlwaine authored
    Haddock no longer writes compilation files by default, so we do not need to pass
    tmp dirs for `-hidir`, `-stubdir`, and `-odir` via `--optghc`. Indeed, we do not
    *want* to do so, since it results in recompilation for every invocation of
    Haddock via Cabal. This commit stops this from happening for haddock versions >=
    2.28 (when Hi Haddock was introduced).
    
    This commit also stops the default definition of the `__HADDOCK_VERSION__` macro
    when invoking GHC through haddock. Since a very limited set of users may still
    depend on this macro, we introduce the `--haddock-version-cpp` flag and
    `haddock-version-cpp:` cabal.project field, which enable the definition of
    the `__HADDOCK_VERSION__` macro when invoking GHC through Haddock. This will
    almost guarantee recompilation during documentation generation due to the macro
    definition.
    
    This commit also renames the `--haddock-lib` flag to `--haddock-resources-dir`
    (and `haddock-lib:` cabal.project field to `haddock-resources-dir:`), and adds
    this flag to the users guide since it was missing an entry. This also allows us
    to add this field to `cabal-install:test:integration-tests2`, since it is no
    longer ambiguous with the `--lib` flag.
    
    This commit also causes `documentation: true` or `--enable-documentation` to
    imply `-haddock` for GHC.
    
    Also, since Haddock >= 2.29 is renaming `--lib` to `--resources-dir`, this
    commit switches the flag provided to Haddock using a backwards compatible
    condition based on the Haddock version.
    
    Adds a changelog entry.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.