unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Vollmert <rob@vllmrt.net>
To: 36249@debbugs.gnu.org
Subject: [bug#36249] [PATCH] gnu: ghc-clock: Break test dependency cycle differently.
Date: Sun, 16 Jun 2019 18:42:15 +0200	[thread overview]
Message-ID: <443E9718-007C-4CE5-9CFB-11BAC6628A1B@vllmrt.net> (raw)
In-Reply-To: <20190616162902.28977-1-rob@vllmrt.net>

> On 16. Jun 2019, at 18:29, Robert Vollmert <rob@vllmrt.net> wrote:
> 
> Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36084.
> 
> * gnu/packages/haskell-check.scm (ghc-tasty): Import ghc-clock-bootstrap
> directly from (gnu packages haskell).
> (ghc-clock-bootstrap): Move to...
> * gnu/packages/haskell.scm (ghc-clock-bootstrap): Here and update to 0.7.2.
> (ghc-clock): Inherit ghc-clock-bootstrap and build as test-only package that
> builds tests against ghc-clock-bootstrap and copies its result.
> —

[…]

> @@ -199,7 +175,7 @@ timer functions of different operating systems via a unified API.")
>        ("ghc-unbounded-delays" ,ghc-unbounded-delays)
>        ("ghc-async" ,ghc-async)
>        ("ghc-ansi-terminal" ,ghc-ansi-terminal)
> -       ("ghc-clock-bootstrap" ,ghc-clock-bootstrap)
> +       ("ghc-clock-bootstrap" ,(@@ (gnu packages haskell) ghc-clock-bootstrap))

Is this an appropriate thing to do? Or should I export ghc-clock-bootstrap and mark it
hidden?

>        ("ghc-wcwidth" ,ghc-wcwidth-bootstrap)))
>     (home-page "http://documentup.com/feuerbach/tasty")
>     (synopsis "Modern and extensible testing framework")
> diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
> index b9745b9661..35e89bb15c 100644
> --- a/gnu/packages/haskell.scm
> +++ b/gnu/packages/haskell.scm
> @@ -1,4 +1,3 @@
> -

> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
> ;;; Copyright © 2015 Siniša Biđin <sinisa@bidin.eu>

Oops, that must be introduced in some other patch of mine. (Bad keyboard :-( )

> +(define-public ghc-clock
> +  (package
> +    (inherit ghc-clock-bootstrap)
> +    (name "ghc-clock")
> +    (version "0.7.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://hackage.haskell.org/package/"
> +             "clock/"
> +             "clock-" version ".tar.gz"))
> +       (sha256
> +        (base32 "07v91s20halsqjmziqb1sqjp2sjpckl9by7y28aaklwqi2bh2rl8"))
> +       (patches
> +        (search-patches
> +         "ghc-clock-disable-library.patch"))))

I missed adding the patch, see below.

> +    (inputs
> +     `(("ghc-clock-bootstrap" ,ghc-clock-bootstrap)
> +       ("ghc-tasty" ,ghc-tasty)
> +       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
> +    (arguments
> +     `(#:tests? #t
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'install
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((bootstrap (assoc-ref inputs "ghc-clock-bootstrap")))
> +               (copy-recursively bootstrap (assoc-ref outputs "out"))))))))))
> +
> (define-public ghc-charset
>   (package
>     (name "ghc-charset")
> -- 
> 2.20.1 (Apple Git-117)
> 

diff --git a/gnu/packages/patches/ghc-clock-disable-library.patch b/gnu/packages/patches/ghc-clock-disable-library.patch
new file mode 100644
index 0000000000..4bf83cfaf1
--- /dev/null
+++ b/gnu/packages/patches/ghc-clock-disable-library.patch
@@ -0,0 +1,13 @@
+
+diff -u a/clock.cabal b/clock.cabal
+--- a/clock.cabal      2019-06-16 17:36:19.212000000 +0200
++++ b/clock.cabal      2019-06-16 17:36:37.804000000 +0200
+@@ -61,6 +61,7 @@
+ 
+ 
+-library
++library disabled
++    buildable: False
+     if impl (ghc < 7.6)
+       build-depends:       base >= 4.4 && <= 5, ghc-prim
+     build-depends:       base >= 2 && <= 5

The library needs to be renamed because it conflicts with the existing clock library otherwise.
This feels a bit hacky, but I don’t currently see a more elegant way to handle this. Ideas?

  reply	other threads:[~2019-06-16 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 16:29 [bug#36249] [PATCH] gnu: ghc-clock: Break test dependency cycle differently Robert Vollmert
2019-06-16 16:42 ` Robert Vollmert [this message]
2019-07-16 16:16 ` [bug#36249] [PATCH v2] gnu: ghc-clock: Align version of bootstrap and real package Robert Vollmert
2019-07-16 19:09   ` bug#36249: " Timothy Sample

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443E9718-007C-4CE5-9CFB-11BAC6628A1B@vllmrt.net \
    --to=rob@vllmrt.net \
    --cc=36249@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).