From 90c014c455793cc026666b108fe37adc642e1f22 Mon Sep 17 00:00:00 2001 From: "Wolfgang E. Sanyer" Date: Sun, 27 Dec 2020 00:03:47 -0500 Subject: 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 Signed-off-by: Sergei Trofimovich --- eclass/haskell-cabal.eclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'eclass') diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 8706cc99478e..505eab437386 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: +# > : 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 -- cgit v1.2.3-65-gdbad