Skip to content

Commit 68f64ea

Browse files
authored
Merge pull request #6277 from commercialhaskell/fix6276
Fix #6276 Haddock > 2.17.2 provides --hyperlinked-source
2 parents f850230 + 71bacb8 commit 68f64ea

File tree

2 files changed

+8
-31
lines changed

2 files changed

+8
-31
lines changed

ChangeLog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Behavior changes:
5555
considered a possible GHC build if `libc.musl-x86_64.so.1` is found in `\lib`
5656
or `\lib64`.
5757
* No longer supports Cabal versions older than `1.24.0.0`. This means projects
58-
using snapshots earlier than `lts-7.0` or `nightly-2016-05-26` will no longer
59-
build.
58+
using snapshots earlier than `lts-7.0` or `nightly-2016-05-26` (GHC 8.0.1)
59+
will no longer build. GHC 8.0.1 comes with Haddock 2.17.2.
6060
* When unregistering many packages in a single step, Stack can now do that
6161
efficiently. Stack no longer uses GHC-supplied `ghc-pkg unregister` (which is,
6262
currently, slower).

src/Stack/Build/Execute.hs

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ import Path.IO
8282
, renameFile
8383
)
8484
import RIO.Process
85-
( HasProcessContext, byteStringInput, doesExecutableExist
86-
, eceExitCode, findExecutable, getStderr, getStdout, inherit
85+
( HasProcessContext, byteStringInput, eceExitCode
86+
, findExecutable, getStderr, getStdout, inherit
8787
, modifyEnvVars, proc, runProcess_, setStderr, setStdin
8888
, setStdout, showProcessArgDebug, useHandleOpen, waitExitCode
8989
, withProcessWait, withWorkingDir
@@ -1958,33 +1958,10 @@ singleBuild ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} installedMap
19581958
mcurator <- view $ buildConfigL.to bcCurator
19591959
when (doHaddock mcurator package) $ do
19601960
announce "haddock"
1961-
sourceFlag <- if not (boptsHaddockHyperlinkSource eeBuildOpts)
1962-
then pure []
1963-
else do
1964-
-- See #2429 for why the temp dir is used
1965-
ec
1966-
<- withWorkingDir (toFilePath eeTempDir)
1967-
$ proc "haddock" ["--hyperlinked-source"]
1968-
$ \pc -> withProcessWait
1969-
(setStdout createSource $ setStderr createSource pc) $ \p ->
1970-
runConcurrently
1971-
$ Concurrently (runConduit $ getStdout p .| CL.sinkNull)
1972-
*> Concurrently (runConduit $ getStderr p .| CL.sinkNull)
1973-
*> Concurrently (waitExitCode p)
1974-
case ec of
1975-
-- Fancy crosslinked source
1976-
ExitSuccess -> pure ["--haddock-option=--hyperlinked-source"]
1977-
-- Older hscolour colouring
1978-
ExitFailure _ -> do
1979-
hscolourExists <- doesExecutableExist "HsColour"
1980-
unless hscolourExists $
1981-
prettyWarnL
1982-
[ flow "Warning: Haddock is not generating hyperlinked \
1983-
\sources because 'HsColour' not found on PATH (use"
1984-
, style Shell (flow "stack install hscolour")
1985-
, flow "to install)."
1986-
]
1987-
pure ["--hyperlink-source" | hscolourExists]
1961+
let sourceFlag =
1962+
[ "--haddock-option=--hyperlinked-source"
1963+
| boptsHaddockHyperlinkSource eeBuildOpts
1964+
]
19881965

19891966
-- For GHC 8.4 and later, provide the --quickjump option.
19901967
actualCompiler <- view actualCompilerVersionL

0 commit comments

Comments
 (0)