GNU bug report logs - #36249
[PATCH] gnu: ghc-clock: Break test dependency cycle differently.

Previous Next

Package: guix-patches;

Reported by: Robert Vollmert <rob <at> vllmrt.net>

Date: Sun, 16 Jun 2019 16:30:02 UTC

Severity: normal

Tags: patch

Done: Timothy Sample <samplet <at> ngyro.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36249 in the body.
You can then email your comments to 36249 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#36249; Package guix-patches. (Sun, 16 Jun 2019 16:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Vollmert <rob <at> vllmrt.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 16 Jun 2019 16:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: guix-patches <at> gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH] gnu: ghc-clock: Break test dependency cycle differently.
Date: Sun, 16 Jun 2019 18:29:02 +0200
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.
---
 gnu/packages/haskell-check.scm | 26 +--------------------
 gnu/packages/haskell.scm       | 42 +++++++++++++++++++++++++++++-----
 2 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/haskell-check.scm b/gnu/packages/haskell-check.scm
index cfd986ed5e..21ea365aab 100644
--- a/gnu/packages/haskell-check.scm
+++ b/gnu/packages/haskell-check.scm
@@ -153,30 +153,6 @@ output file should be identical to the corresponding @code{golden} file, which
 contains the correct result for the test.")
     (license license:expat)))
 
-;; This package builds `clock` without tests, since the tests rely on tasty
-;; and tasty-quickcheck, which in turn require clock to build.
-(define ghc-clock-bootstrap
-  (package
-    (name "ghc-clock-bootstrap")
-    (version "0.5.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/"
-             "clock/"
-             "clock-" version ".tar.gz"))
-       (sha256
-        (base32 "1ncph7vi2q6ywwc8ysxl1ibw6i5dwfvln88ssfazk8jgpj4iyykw"))))
-    (build-system haskell-build-system)
-    (arguments `(#:tests? #f)) ;; Testing suite depends on tasty and
-                               ;; tasty-quickcheck, which need clock to build.
-    (home-page "https://hackage.haskell.org/package/clock")
-    (synopsis "High-resolution clock for Haskell")
-    (description "A package for convenient access to high-resolution clock and
-timer functions of different operating systems via a unified API.")
-    (license license:bsd-3)))
-
 (define-public ghc-tasty
   (package
     (name "ghc-tasty")
@@ -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))
        ("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 <at> fbengineering.ch>
 ;;; Copyright © 2015 Siniša Biđin <sinisa <at> bidin.eu>
@@ -4757,9 +4756,11 @@ or timeout period.  This package provides alternative functions which use the
 unbounded @code{Integer} type.")
     (license license:bsd-3)))
 
-(define-public ghc-clock
+;; This package builds `clock` without tests, since the tests rely on tasty
+;; and tasty-quickcheck, which in turn require clock to build.
+(define ghc-clock-bootstrap
   (package
-    (name "ghc-clock")
+    (name "ghc-clock-bootstrap")
     (version "0.7.2")
     (source
      (origin
@@ -4771,15 +4772,44 @@ unbounded @code{Integer} type.")
        (sha256
         (base32 "07v91s20halsqjmziqb1sqjp2sjpckl9by7y28aaklwqi2bh2rl8"))))
     (build-system haskell-build-system)
-    (inputs
-     `(("ghc-tasty" ,ghc-tasty)
-       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
+    (arguments `(#:tests? #f)) ;; Testing suite depends on tasty and
+    ;; tasty-quickcheck, which need clock to build.
     (home-page "https://hackage.haskell.org/package/clock")
     (synopsis "High-resolution clock for Haskell")
     (description "A package for convenient access to high-resolution clock and
 timer functions of different operating systems via a unified API.")
     (license license:bsd-3)))
 
+(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"))))
+    (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)





Information forwarded to guix-patches <at> gnu.org:
bug#36249; Package guix-patches. (Sun, 16 Jun 2019 16:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 36249 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36249 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: ghc-clock: Break test dependency cycle differently.
Date: Sun, 16 Jun 2019 18:42:15 +0200
> On 16. Jun 2019, at 18:29, Robert Vollmert <rob <at> 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 <at> fbengineering.ch>
> ;;; Copyright © 2015 Siniša Biđin <sinisa <at> 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?





Information forwarded to guix-patches <at> gnu.org:
bug#36249; Package guix-patches. (Tue, 16 Jul 2019 16:17:01 GMT) Full text and rfc822 format available.

Message #11 received at 36249 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36249 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH v2] gnu: ghc-clock: Align version of bootstrap and real package
Date: Tue, 16 Jul 2019 18:16:06 +0200
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 with tests.
---
 gnu/packages/haskell-check.scm | 26 +-------------------------
 gnu/packages/haskell.scm       | 20 +++++++++++++++-----
 2 files changed, 16 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/haskell-check.scm b/gnu/packages/haskell-check.scm
index d275b5f525..294665478b 100644
--- a/gnu/packages/haskell-check.scm
+++ b/gnu/packages/haskell-check.scm
@@ -153,30 +153,6 @@ output file should be identical to the corresponding @code{golden} file, which
 contains the correct result for the test.")
     (license license:expat)))
 
-;; This package builds `clock` without tests, since the tests rely on tasty
-;; and tasty-quickcheck, which in turn require clock to build.
-(define ghc-clock-bootstrap
-  (package
-    (name "ghc-clock-bootstrap")
-    (version "0.5.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/"
-             "clock/"
-             "clock-" version ".tar.gz"))
-       (sha256
-        (base32 "1ncph7vi2q6ywwc8ysxl1ibw6i5dwfvln88ssfazk8jgpj4iyykw"))))
-    (build-system haskell-build-system)
-    (arguments `(#:tests? #f)) ;; Testing suite depends on tasty and
-                               ;; tasty-quickcheck, which need clock to build.
-    (home-page "https://hackage.haskell.org/package/clock")
-    (synopsis "High-resolution clock for Haskell")
-    (description "A package for convenient access to high-resolution clock and
-timer functions of different operating systems via a unified API.")
-    (license license:bsd-3)))
-
 (define-public ghc-tasty
   (package
     (name "ghc-tasty")
@@ -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))
        ("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 7c910e56cb..65d8d75950 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -4785,9 +4785,11 @@ or timeout period.  This package provides alternative functions which use the
 unbounded @code{Integer} type.")
     (license license:bsd-3)))
 
-(define-public ghc-clock
+;; This package builds `clock` without tests, since the tests rely on tasty
+;; and tasty-quickcheck, which in turn require clock to build.
+(define ghc-clock-bootstrap
   (package
-    (name "ghc-clock")
+    (name "ghc-clock-bootstrap")
     (version "0.7.2")
     (source
      (origin
@@ -4799,15 +4801,23 @@ unbounded @code{Integer} type.")
        (sha256
         (base32 "07v91s20halsqjmziqb1sqjp2sjpckl9by7y28aaklwqi2bh2rl8"))))
     (build-system haskell-build-system)
-    (inputs
-     `(("ghc-tasty" ,ghc-tasty)
-       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
+    (arguments `(#:tests? #f)) ;; Testing suite depends on tasty and
+                               ;; tasty-quickcheck, which need clock to build.
     (home-page "https://hackage.haskell.org/package/clock")
     (synopsis "High-resolution clock for Haskell")
     (description "A package for convenient access to high-resolution clock and
 timer functions of different operating systems via a unified API.")
     (license license:bsd-3)))
 
+(define-public ghc-clock
+  (package
+    (inherit ghc-clock-bootstrap)
+    (name "ghc-clock")
+    (inputs
+     `(("ghc-tasty" ,ghc-tasty)
+       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
+    (arguments `(#:tests? #t))))
+
 (define-public ghc-charset
   (package
     (name "ghc-charset")
-- 
2.20.1 (Apple Git-117)





Reply sent to Timothy Sample <samplet <at> ngyro.com>:
You have taken responsibility. (Tue, 16 Jul 2019 19:10:04 GMT) Full text and rfc822 format available.

Notification sent to Robert Vollmert <rob <at> vllmrt.net>:
bug acknowledged by developer. (Tue, 16 Jul 2019 19:10:04 GMT) Full text and rfc822 format available.

Message #16 received at 36249-done <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Robert Vollmert <rob <at> vllmrt.net>
Cc: 36249-done <at> debbugs.gnu.org
Subject: Re: [bug#36249] [PATCH v2] gnu: ghc-clock: Align version of bootstrap
 and real package
Date: Tue, 16 Jul 2019 15:09:00 -0400
Hi Robert,

Robert Vollmert <rob <at> vllmrt.net> writes:

> 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 with tests.
> ---
>  gnu/packages/haskell-check.scm | 26 +-------------------------
>  gnu/packages/haskell.scm       | 20 +++++++++++++++-----
>  2 files changed, 16 insertions(+), 30 deletions(-)
>
> [...]

I ended up turning this around, and basing “ghc-clock-bootstrap” on
“ghc-clock”.  It turns out we already have a bunch of packages that do
the same thing, so all that was needed was to follow those examples.

I committed a similar patch as 71e5d425c9b9e108ebdd06d13de45b56dddd9ef5,
with you as the co-author.  Thanks!


-- Tim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Aug 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.