commit:     90c014c455793cc026666b108fe37adc642e1f22
Author:     Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail <DOT> com>
AuthorDate: Sun Dec 27 05:03:47 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jan 30 09:54:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90c014c4

haskell-cabal.eclass: add CABAL_FEATURE=rebuild-after-doc-workaround

This is added as a temporary workaround until [this upstream][1] issue
can be closed out

[1]: https://github.com/haskell/cabal/issues/7213

Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail.com>
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 eclass/haskell-cabal.eclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index 8706cc99478..505eab43738 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -29,6 +29,15 @@
 #                  only used for packages that use libghc internally and _must_
 #                  not pull upper versions
 #   test-suite --  add support for cabal test-suites (introduced in Cabal-1.8)
+#   rebuild-after-doc-workaround -- enable doctest test failue workaround.
+#                  Symptom: when `./setup haddock` is run in a `build-type: 
Custom`
+#                  package it might cause cause the test-suite to fail with
+#                  errors like:
+#                  > <command line>: cannot satisfy -package-id 
singletons-2.7-3Z7pnljD8tU1NrslJodXmr
+#                  Workaround re-reginsters the package to avoid the failure
+#                  (and rebuilds changes).
+#                  FEATURE can be removed once 
https://github.com/haskell/cabal/issues/7213
+#                  is fixed.
 
 inherit eutils ghc-package multilib toolchain-funcs
 
@@ -99,6 +108,7 @@ for feature in ${CABAL_FEATURES}; do
                nocabaldep) CABAL_FROM_GHC=yes;;
                ghcdeps)    CABAL_GHC_CONSTRAINT=yes;;
                test-suite) CABAL_TEST_SUITE=yes;;
+               rebuild-after-doc-workaround) 
CABAL_REBUILD_AFTER_DOC_WORKAROUND=yes;;
 
                # does nothing, removed 2016-09-04
                bin)        ;;
@@ -554,6 +564,12 @@ cabal_src_compile() {
                                cabal-haddock
                        fi
                fi
+               if [[ -n "${CABAL_REBUILD_AFTER_DOC_WORKAROUND}" ]]; then
+                       ewarn "rebuild-after-doc-workaround is enabled. This is 
a"
+                       ewarn "temporary worakround to deal with 
https://github.com/haskell/cabal/issues/7213";
+                       ewarn "until the upstream issue can be resolved."
+                       cabal-build
+               fi
        else
                if [[ -n "${CABAL_USE_HSCOLOUR}" ]] && use hscolour; then
                        if [[ -n "${CABAL_USE_HOOGLE}" ]] && use hoogle; then

Reply via email to