Skip to content

Commit

Permalink
Add check for "ghc-options: -j"
Browse files Browse the repository at this point in the history
  • Loading branch information
lspitzner committed Apr 20, 2018
1 parent 4818eb5 commit baea4fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cabal/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,12 @@ checkDevelopmentOnlyFlagsBuildInfo bi =
++ "add new warnings. "
++ extraExplanation

, check (has_J) $
PackageDistInexcusable $
"'ghc-options: -j[N]' can make sense for specific user's setup,"
++ " but it is not appropriate for a distributed package."
++ extraExplanation

, checkFlags ["-fdefer-type-errors"] $
PackageDistInexcusable $
"'ghc-options: -fdefer-type-errors' is fine during development but "
Expand Down Expand Up @@ -1745,6 +1751,13 @@ checkDevelopmentOnlyFlagsBuildInfo bi =
has_Werror = "-Werror" `elem` ghc_options
has_Wall = "-Wall" `elem` ghc_options
has_W = "-W" `elem` ghc_options
has_J = any
(\o -> case o of
"-j" -> True
('-' : 'j' : d : _) -> isDigit d
_ -> False
)
ghc_options
ghc_options = hcOptions GHC bi ++ hcProfOptions GHC bi
++ hcSharedOptions GHC bi

Expand Down

0 comments on commit baea4fc

Please sign in to comment.