From mboxrd@z Thu Jan 1 00:00:00 1970 From: ericbavier@openmailbox.org Subject: Re: [PATCH] gnu: Add ghc-doctest. Date: Wed, 21 Oct 2015 22:32:35 -0500 Message-ID: <1445484780-25990-1-git-send-email-ericbavier@openmailbox.org> References: <1445483479-19104-1-git-send-email-ericbavier@openmailbox.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpBDC-0003bH-W0 for guix-devel@gnu.org; Thu, 22 Oct 2015 04:27:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpBD8-0004lW-Uk for guix-devel@gnu.org; Thu, 22 Oct 2015 04:27:02 -0400 Received: from smtp3.openmailbox.org ([62.4.1.37]:34198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpBD8-0004lF-Pm for guix-devel@gnu.org; Thu, 22 Oct 2015 04:26:58 -0400 In-Reply-To: <1445483479-19104-1-git-send-email-ericbavier@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org, Paul van der Walt From: Eric Bavier > * gnu/packages/haskell.scm (ghc-doctest): New variable. > --- > gnu/packages/haskell.scm | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm > index cfe2ebe..855a21b 100644 > --- a/gnu/packages/haskell.scm > +++ b/gnu/packages/haskell.scm > @@ -2215,4 +2215,39 @@ command line options in Haskell.") > available in later versions of base to a wider (older) range of compilers.") > (license bsd-3))) > > +(define-public ghc-doctest > + (package > + (name "ghc-doctest") > + (version "0.10.1") > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "http://hackage.haskell.org/package/doctest/doctest-" > + version > + ".tar.gz")) > + (sha256 > + (base32 > + "1jbyhzbi2hfrfg7vbkpj6vriaap8cn99nnmzwcfscwaijz09jyrm")))) > + (build-system haskell-build-system) > + (arguments `(#:tests? #f)) ; FIXME: missing test framework > + (propagated-inputs > + `(("ghc-syb" ,ghc-syb) > + ("ghc-paths" ,ghc-paths))) > + (inputs > + `(("ghc-base-compat" ,ghc-base-compat) > + ("ghc-hunit" ,ghc-hunit) > + ("ghc-hspec" ,ghc-hspec) > + ("ghc-quickcheck" ,ghc-quickcheck) > + ("ghc-stringbuilder" ,ghc-stringbuilder) > + ("ghc-silently" ,ghc-silently) > + ("ghc-setenv" ,ghc-setenv))) Testing for and with doctest is tricky. I'm not sure your comment about missing test frameworks is accurate; it looks, from what I can tell, like all the necessary inputs are present. I believe the issue is that tests that call the 'doctest' function may not (probably do not) include the "-package-db" argument in the parameter list given, but since haskell-build-system relies on the fact that cabal passes that argument to GHC, it is essential that that information get there somehow. I would say it's a deficiency of most package's build systems that they do not take this situation into account. So, either the tests files can be patched to include "-package-db" in the GHC arguments given to the 'doctest' function, or GHC_PACKAGE_PATH can be defined appropriately before the 'check' phase (at that point in the build cabal will not complain, as it would if GHC_PACKAGE_PATH were defined during the 'configure' phase). It looks to me like tests are disabled for all packages that use doctest in this patch series: ghc-trifecta ghc-lens ghc-wai-logger ghc-parsers ghc-semigroupoids ghc-comonad ghc-distributive ghc-http-types ghc-unix-time ghc-iproute I would suggest that tests for these packages simply be disabled (and the corresponding test-only inputs be removed) for the time being. The pending GHC native-search-path patches should trivially resolve this issue, at which time tests for these packages can be revisited. WDYT? `~Eric