Skip to content
Snippets Groups Projects
Unverified Commit 0d2d9ca7 authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #6137 from haskell/issue-5977

Issue 5977
parents 48a8aa2b 73751a9a
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ haddockAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFl
haddockAction (configFlags, configExFlags, installFlags, haddockFlags, testFlags)
targetStrings globalFlags = do
baseCtx <- establishProjectBaseContext verbosity cliConfig OtherCommand
baseCtx <- establishProjectBaseContext verbosity cliConfig HaddockCommand
targetSelectors <- either (reportTargetSelectorProblems verbosity) return
=<< readTargetSelectors (localPackages baseCtx) Nothing targetStrings
......
......@@ -171,7 +171,7 @@ import System.Posix.Signals (sigKILL, sigSEGV)
-- | Tracks what command is being executed, because we need to hide this somewhere
-- for cases that need special handling (usually for error reporting).
data CurrentCommand = InstallCommand | OtherCommand
data CurrentCommand = InstallCommand | HaddockCommand | OtherCommand
deriving (Show, Eq)
-- | This holds the context of a project prior to solving: the content of the
......@@ -431,7 +431,7 @@ runProjectPostBuildPhase verbosity
-- Finally if there were any build failures then report them and throw
-- an exception to terminate the program
dieOnBuildFailures verbosity currentCommand elaboratedPlanToExecute buildOutcomes
dieOnBuildFailures verbosity currentCommand elaboratedPlanToExecute buildOutcomes
-- Note that it is a deliberate design choice that the 'buildTargets' is
-- not passed to phase 1, and the various bits of input config is not
......@@ -1030,6 +1030,7 @@ dieOnBuildFailures verbosity currentCommand plan buildOutcomes
]
dieIfNotHaddockFailure
| currentCommand == HaddockCommand = die'
| all isHaddockFailure failuresClassification = warn
| otherwise = die'
where
......
module Example where
import Prelude
example :: Int
example = False
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- example-1.0 (lib) (first run)
Configuring library for example-1.0..
Preprocessing library for example-1.0..
Building library for example-1.0..
# cabal v2-haddock
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- example-1.0 (lib) (first run)
Preprocessing library for example-1.0..
Running Haddock on library for example-1.0..
cabal: Failed to build documentation for example-1.0-inplace.
packages: .
\ No newline at end of file
import Test.Cabal.Prelude
import System.Exit (ExitCode (..))
main = cabalTest $ do
fails $ cabal "v2-build" ["example"]
fails $ cabal "v2-haddock" ["example"]
name: example
version: 1.0
build-type: Simple
cabal-version: >=1.10
library
default-language: Haskell2010
build-depends: base
exposed-modules: Example
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment