Remove invalid library directories from some haskell packages

  • Done
  • quality assurance status badge
Details
2 participants
  • John Soo
  • Ludovic Courtès
Owner
unassigned
Submitted by
John Soo
Severity
normal

Debbugs page

John Soo wrote 5 years ago
(address . guix-patches@gnu.org)
CAKf5CqXw-e+Rc2ytbcEZhai2kv18YQutK1pr7un5P6UgpZ74kQ@mail.gmail.com
Hi all,

When compiling with ghc, I have been getting the message that the following
packages have invalid package databases. These patches remove the library
from the output, keeping the executables.

There may be other packages with this problem but I have not done an audit.

- John
Attachment: file
From f7bca9fca0b01b1c770d388fea80cbcee042b14a Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 17 Nov 2019 01:15:16 -0800
Subject: [PATCH 1/3] gnu: ghc-hpack: Remove invalid lib directory.

* gnu/packages/haskell-xyz.scm (ghc-hpack): Remove invalid library directory
from output.
---
gnu/packages/haskell-xyz.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index fb6833207d..1d78eb7894 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -5500,6 +5500,13 @@ representations of current time.")
("ghc-quickcheck" ,ghc-quickcheck)
("ghc-temporary" ,ghc-temporary)
("hspec-discover" ,hspec-discover)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'remove-lib
+ (lambda* (#:key outputs #:allow-other-keys)
+ (delete-file-recursively
+ (string-append (assoc-ref outputs "out") "/lib")))))))
(home-page "https://github.com/sol/hpack")
(synopsis "Tools for an alternative Haskell package format")
(description
--
2.24.0
From eb18a37d60039c5f67f7cb923c88433159a8387c Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 17 Nov 2019 08:25:53 -0800
Subject: [PATCH 3/3] gnu: hoogle: Remove invalid library.

* gnu/packages/haskell-apps.scm (hoogle): Remove invalid library from output.
---
gnu/packages/haskell-apps.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index 5a16b1bb91..1e79294737 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -500,6 +500,13 @@ unwanted suggestions, and to add your own custom suggestions.")
("ghc-warp" ,ghc-warp)
("ghc-warp-tls" ,ghc-warp-tls)
("ghc-zlib" ,ghc-zlib)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'remove-lib
+ (lambda* (#:key outputs #:allow-other-keys)
+ (delete-file-recursively
+ (string-append (assoc-ref outputs "out") "/lib")))))))
(home-page "https://hoogle.haskell.org/")
(synopsis "Haskell API Search")
(description "Hoogle is a Haskell API search engine, which allows
--
2.24.0
From c634931be8790342a0eaeec2bbef6f058c86448e Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 17 Nov 2019 01:19:20 -0800
Subject: [PATCH 2/3] gnu: hlint: Remove invalid lib directory.

* gnu/packages/haskell-apps.scm (hlint): Remove invalid library from output.
---
gnu/packages/haskell-apps.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index d5c31cbb0b..5a16b1bb91 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -441,6 +441,13 @@ used to keep a folder in sync between computers.")
("ghc-aeson" ,ghc-aeson)
("ghc-lib-parser" ,ghc-lib-parser)
("hscolour" ,hscolour)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'remove-lib
+ (lambda* (#:key outputs #:allow-other-keys)
+ (delete-file-recursively
+ (string-append (assoc-ref outputs "out") "/lib")))))))
(home-page "http://community.haskell.org/~ndm/hlint/")
(synopsis "Suggest improvements for Haskell source code")
(description "HLint reads Haskell programs and suggests changes that
--
2.24.0
John Soo wrote 5 years ago
(address . 38593@debbugs.gnu.org)
CAKf5CqWwmDPsEzwtAgj-H1k71E04i0+hLRP4crc3X=zfPTy8QA@mail.gmail.com
I forgot to mention there are patches attached to this.
Attachment: file
Ludovic Courtès wrote 5 years ago
Re: [bug#38593] Remove invalid library directories from some haskell packages
(name . John Soo)(address . jsoo1@asu.edu)(address . 38593@debbugs.gnu.org)
871rt0kkxv.fsf@gnu.org
Hi,

John Soo <jsoo1@asu.edu> skribis:

Toggle quote (3 lines)
> When compiling with ghc, I have been getting the message that the following
> packages have invalid package databases.

Does it hurt in practice, or are these invalid databases shadowed by the
one created in the profile?

Toggle quote (16 lines)
> diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
> index fb6833207d..1d78eb7894 100644
> --- a/gnu/packages/haskell-xyz.scm
> +++ b/gnu/packages/haskell-xyz.scm
> @@ -5500,6 +5500,13 @@ representations of current time.")
> ("ghc-quickcheck" ,ghc-quickcheck)
> ("ghc-temporary" ,ghc-temporary)
> ("hspec-discover" ,hspec-discover)))
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-after 'install 'remove-lib
> + (lambda* (#:key outputs #:allow-other-keys)
> + (delete-file-recursively
> + (string-append (assoc-ref outputs "out") "/lib")))))))

Should we add a phase in ‘haskell-build-system’ that systematically
removes package databases?

Thanks,
Ludo’.
John Soo wrote 5 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(name . help-guix)(address . help-guix@gnu.org)(address . 38593@debbugs.gnu.org)
69081139-A67A-43C5-8757-36437C6CC96D@asu.edu
Hi Ludo and guix,

Let me explain my problem. Maybe there is some other explanation here and these patches aren’t necessary.

When I have stylish-haskell installed I have troubles compiling anything using plain ghc. I want to use the ghc packages in the profile but for some reason ghc reports the database is invalid because of at least stylish-haskell and I think I’ve seen hoogle as well.

Toggle quote (4 lines)
> Does it hurt in practice, or are these invalid databases shadowed by the
> one created in the profile?


I’m not sure what you mean here. I think I dod not explained my problem well enough. Does the explanation above make sense?

Another possibility is the duplication of path variables in tmux where I usually operate.

Thinking now, maybe another explanation is because stylish-haskell and ghc-stylish-haskell are fighting each other? They are duplicate packages and maybe if one is removed it will be ok?

Toggle quote (3 lines)
> Should we add a phase in ‘haskell-build-system’ that systematically
> removes package databases?

I don’t think so. I like having the profile packages. A lot of times I prefer to use plain ghc with the profile packages over cabal or another tool so I’m happy to have the packages in the database.

The ones I was considering removing were ones that primarily provide a binary to use - hoogle and stylish-haskell are primarily used as binaries. However on second thought if I wanted to use them as libraries I think I would be confused as to why I could not.

Overall I am leaning towards finding some other solution.

Thanks everyone!

John
John Soo wrote 4 years ago
Have not experienced this problem in a long time
(address . 38593-done@debbugs.gnu.org)
87lfdc33yp.fsf@asu.edu
I have not experienced this issue in a long time. I may come back to it
if it ever happens again.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 38593@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 38593
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help