From 704735320ced47df7cd814aec66f63e022ff9da8 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Wed, 30 Dec 2020 02:33:26 +0200 Subject: [PATCH] Use cabal-docspec ... make package build-type: Simple --- .github/workflows/haskell-ci.yml | 19 ++++++++++++++++--- CHANGELOG.markdown | 4 ++++ Setup.lhs | 31 +------------------------------ Warning.hs | 5 ----- cabal.haskell-ci | 11 +---------- distributive.cabal | 17 ++--------------- tests/doctests.hs | 25 ------------------------- 7 files changed, 24 insertions(+), 88 deletions(-) delete mode 100644 Warning.hs delete mode 100644 tests/doctests.hs diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 859b720..db78185 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.11.20201227 +# version: 0.11.20201230 # -# REGENDATA ("0.11.20201227",["github","--config=cabal.haskell-ci","cabal.project"]) +# REGENDATA ("0.11.20201230",["github","--config=cabal.haskell-ci","cabal.project"]) # name: Haskell-CI on: @@ -145,6 +145,15 @@ jobs: rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version + - name: install cabal-docspec + run: | + mkdir -p $HOME/.cabal/bin + curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20201230.1/cabal-docspec-0.0.0.20201230.1.xz > cabal-docspec.xz + echo '18caf4f361fadd978782f08e78f42d21d4f177567419055ffccae19b8214852d cabal-docspec.xz' | sha256sum -c - + xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec + rm -f cabal-docspec.xz + chmod a+x $HOME/.cabal/bin/cabal-docspec + cabal-docspec --version - name: checkout uses: actions/checkout@v2 with: @@ -191,7 +200,11 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - name: tests run: | - $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all + $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct + - name: docspec + run: | + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all + cabal-docspec $ARG_COMPILER - name: cabal check run: | cd ${PKGDIR_distributive} || false diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 65b0756..b2b210e 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,7 @@ +0.6.2.1 [202y.mm.d] +------------------- +* Use `build-type: Simple` + 0.6.2 [2020.04.10] ------------------ * Make the `Distributive` instance for `Tagged` poly-kinded. diff --git a/Setup.lhs b/Setup.lhs index faedcd3..3c9ac1e 100644 --- a/Setup.lhs +++ b/Setup.lhs @@ -1,34 +1,5 @@ \begin{code} -{-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wall #-} -module Main (main) where - -#ifndef MIN_VERSION_cabal_doctest -#define MIN_VERSION_cabal_doctest(x,y,z) 0 -#endif - -#if MIN_VERSION_cabal_doctest(1,0,0) - -import Distribution.Extra.Doctest ( defaultMainWithDoctests ) -main :: IO () -main = defaultMainWithDoctests "doctests" - -#else - -#ifdef MIN_VERSION_Cabal --- If the macro is defined, we have new cabal-install, --- but for some reason we don't have cabal-doctest in package-db --- --- Probably we are running cabal sdist, when otherwise using new-build --- workflow -import Warning () -#endif - -import Distribution.Simple - +import Distribution.Simple (defaultMain) main :: IO () main = defaultMain - -#endif - \end{code} diff --git a/Warning.hs b/Warning.hs deleted file mode 100644 index a5a14a9..0000000 --- a/Warning.hs +++ /dev/null @@ -1,5 +0,0 @@ -module Warning - {-# WARNING ["You are configuring this package without cabal-doctest installed.", - "The doctests test-suite will not work as a result.", - "To fix this, install cabal-doctest before configuring."] #-} - () where diff --git a/cabal.haskell-ci b/cabal.haskell-ci index bf4c513..4da3d19 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -3,13 +3,4 @@ unconstrained: False allow-failures: <7.3 irc-channels: irc.freenode.org#haskell-lens irc-if-in-origin-repo: True - --- Because we use a custom Setup script, --test-show-details can only support --- the options that come with the version of Cabal that is linked against. --- Unfortunately, --test-show-details=direct wasn't introduced until --- Cabal-1.24.*, and GHC 7.10 and earlier ship with an older version of Cabal --- than that. As a result, trying to pass --test-show-details=direct won't work --- on these GHC versions unless we rebuild Cabal from scratch, which is --- time-consuming. As a result, we simply disable --test-show-details=direct --- as a quick-but-dirty workaround. -test-output-direct: False +docspec: True diff --git a/distributive.cabal b/distributive.cabal index 0f6db1e..c79a5f0 100644 --- a/distributive.cabal +++ b/distributive.cabal @@ -1,6 +1,6 @@ name: distributive category: Data Structures -version: 0.6.2 +version: 0.6.2.1 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE @@ -12,7 +12,7 @@ bug-reports: http://github.com/ekmett/distributive/issues copyright: Copyright (C) 2011-2016 Edward A. Kmett synopsis: Distributive functors -- Dual to Traversable description: Distributive functors -- Dual to @Traversable@ -build-type: Custom +build-type: Simple tested-with: GHC == 7.0.4 , GHC == 7.2.2 , GHC == 7.4.2 @@ -31,7 +31,6 @@ extra-source-files: config CHANGELOG.markdown README.markdown - Warning.hs source-repository head type: git @@ -95,18 +94,6 @@ library default-language: Haskell2010 --- Verify the results of the examples -test-suite doctests - type: exitcode-stdio-1.0 - main-is: doctests.hs - build-depends: - base >= 4, - distributive, - doctest >= 0.11.1 && <0.18 - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 - test-suite spec type: exitcode-stdio-1.0 hs-source-dirs: tests diff --git a/tests/doctests.hs b/tests/doctests.hs deleted file mode 100644 index 2d080e7..0000000 --- a/tests/doctests.hs +++ /dev/null @@ -1,25 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Main (doctests) --- Copyright : (C) 2012-14 Edward Kmett --- License : BSD-style (see the file LICENSE) --- Maintainer : Edward Kmett --- Stability : provisional --- Portability : portable --- --- This module provides doctests for a project based on the actual versions --- of the packages it was built with. It requires a corresponding Setup.lhs --- to be added to the project ------------------------------------------------------------------------------ -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import Test.DocTest - -main :: IO () -main = do - traverse_ putStrLn args - doctest args - where - args = flags ++ pkgs ++ module_sources