From 441df6f18eb361802f02194957bc2ee2e28aabc9 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Sun, 11 Feb 2024 17:56:35 +0000 Subject: [PATCH] Re #6270 Fix `--haddock-arguments` with `--haddock-for-hackage` --- ChangeLog.md | 2 ++ src/Stack/Build/ExecutePackage.hs | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index d0dae418a8..4cd418bfdd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -14,6 +14,8 @@ Other enhancements: Bug fixes: +* `--haddock-for-hackage` does not ignore `--haddock-arguments`. + ## v2.15.1 - 2024-02-09 Release notes: diff --git a/src/Stack/Build/ExecutePackage.hs b/src/Stack/Build/ExecutePackage.hs index a2898fc208..209b171451 100644 --- a/src/Stack/Build/ExecutePackage.hs +++ b/src/Stack/Build/ExecutePackage.hs @@ -596,20 +596,21 @@ singleBuild fulfillHaddockExpectations pname mcurator $ \keep -> do let args = concat - ( if isHaddockForHackage - then - [ [ "--for-hackage" ] ] - else - [ [ "--html" - , "--hoogle" - , "--html-location=../$pkg-$version/" - ] - , [ "--haddock-option=--hyperlinked-source" - | ee.buildOpts.haddockHyperlinkSource - ] - , [ "--internal" | ee.buildOpts.haddockInternal ] - , quickjump - ] + ( ( if isHaddockForHackage + then + [ [ "--for-hackage" ] ] + else + [ [ "--html" + , "--hoogle" + , "--html-location=../$pkg-$version/" + ] + , [ "--haddock-option=--hyperlinked-source" + | ee.buildOpts.haddockHyperlinkSource + ] + , [ "--internal" | ee.buildOpts.haddockInternal ] + , quickjump + ] + ) <> [ [ "--haddock-option=" <> opt | opt <- ee.buildOpts.haddockOpts.additionalArgs ]