Skip to content
Snippets Groups Projects
  • Iain Nicol's avatar
    c5e0b331
    Fix: "cabal haddock" uses CPP overzealously · c5e0b331
    Iain Nicol authored
    Until recently we supported ancient versions of Haddock, pre v2.0.  To
    support the CPP extension with such versions, cabal had to invoke the
    CPP before invoking Haddock on the output.  For simplicity cabal would
    invoke the CPP on all Haskell files, if any Haskell file required CPP.
    However, invoking CPP on a file which does not require it can cause
    build failures.
    
    Haddock v2.0+ supports the CPP via GHC, and even automatically
    preprocesses any file with the {-# LANGUAGE CPP #-} pragma. Hence we
    simply need only tell Haddock to enable the CPP when the CPP is a
    package level default extension.
    
    Fixes issue #1808.
    c5e0b331
    History
    Fix: "cabal haddock" uses CPP overzealously
    Iain Nicol authored
    Until recently we supported ancient versions of Haddock, pre v2.0.  To
    support the CPP extension with such versions, cabal had to invoke the
    CPP before invoking Haddock on the output.  For simplicity cabal would
    invoke the CPP on all Haskell files, if any Haskell file required CPP.
    However, invoking CPP on a file which does not require it can cause
    build failures.
    
    Haddock v2.0+ supports the CPP via GHC, and even automatically
    preprocesses any file with the {-# LANGUAGE CPP #-} pragma. Hence we
    simply need only tell Haddock to enable the CPP when the CPP is a
    package level default extension.
    
    Fixes issue #1808.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.