guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add ghc-doctest.


From: ericbavier
Subject: Re: [PATCH] gnu: Add ghc-doctest.
Date: Wed, 21 Oct 2015 22:32:35 -0500

From: Eric Bavier <address@hidden>

> * 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]