-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: "cabal haddock" uses CPP overzealously
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.
- Loading branch information
Showing
5 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module NoCPP (Haystack) where | ||
|
||
-- | For hiding needles. | ||
data Haystack = Haystack | ||
|
||
-- | Causes a build failure if the CPP language extension is enabled. | ||
stringGap = "Foo\ | ||
\Bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters