unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <lars@6xq.net>
To: Philip Munksgaard <philip@munksgaard.me>
Cc: 54760@debbugs.gnu.org
Subject: bug#54760: import: hackage: Internal libraries are not filtered out of dependency list
Date: Thu, 2 Jun 2022 13:57:02 +0200	[thread overview]
Message-ID: <YpiljmAhcSAHsn36@noor.fritz.box> (raw)
In-Reply-To: <eb3dfbb5-23ef-4092-9e08-0301405a815e@www.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

Hey,

> Indeed, that seems to work for those packages, but it still doesn't seem to work for OneTuple, as mentioned here:
I’m attaching a patch for that, please have a look. I’ll merge these
into master, since they don’t change any builds.

> Aha! The upgrade to GHC 9.0.0 caused ghc-hashable to break. I suppose many other packages could be broken as well.
I didn’t actually upgrade any packages on wip-haskell yet, so it’s
likely they fail with a newer GHC than 8.10.

Cheers,
Lars


[-- Attachment #2: 0001-import-hackage-Filter-upper-mixed-case-dependencies-.patch --]
[-- Type: text/plain, Size: 2805 bytes --]

From 261736187d51c85c203ad08fbc1ae89340256a8c Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Thu, 2 Jun 2022 13:52:08 +0200
Subject: [PATCH] import: hackage: Filter upper/mixed case dependencies too.

* guix/import/hackage.scm (filter-dependencies): Convert OWN-NAMES
to lowercase before filtering.
(hackage-module->sexp): Remove #f from OWN-NAMES, which is used for
unnamed (default) libraries.
* tests/hackage.scm (test-cabal-internal-library-ignored): Add mismatched
uppercase letters.
---
 guix/import/hackage.scm | 8 +++++---
 tests/hackage.scm       | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 6e982366cf..878a7d2f9c 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -227,9 +227,10 @@ (define (filter-dependencies dependencies own-names)
 list with the names of dependencies.  OWN-NAMES is the name of the Cabal
 package being processed and its internal libaries and is used to filter
 references to itself."
-  (filter (lambda (d) (not (member (string-downcase d)
+  (let ((ignored-dependencies (map string-downcase
                                    (append own-names ghc-standard-libraries))))
-          dependencies))
+    (filter (lambda (d) (not (member (string-downcase d) ignored-dependencies)))
+            dependencies)))
 
 (define* (hackage-module->sexp cabal cabal-hash
                                #:key (include-test-dependencies? #t))
@@ -250,7 +251,8 @@ (define source-url
     (hackage-source-url name version))
 
   (define own-names (cons (cabal-package-name cabal)
-                          (map cabal-library-name (cabal-package-library cabal))))
+                          (filter (lambda (x) (not (eqv? x #f)))
+                            (map cabal-library-name (cabal-package-library cabal)))))
 
   (define hackage-dependencies
     (filter-dependencies (cabal-dependencies->names cabal) own-names))
diff --git a/tests/hackage.scm b/tests/hackage.scm
index a11dd14846..ad2ee4b7f9 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -368,7 +368,8 @@ (define test-cabal-no-final-newline
 (test-assert "hackage->guix-package test without final newline"
   (eval-test-with-cabal test-cabal-no-final-newline match-ghc-foo))
 
-;; Make sure internal libraries will not be part of the dependencies.
+;; Make sure internal libraries will not be part of the dependencies,
+;; ignore case.
 (define test-cabal-internal-library-ignored
   "name: foo
 version: 1.0.0
@@ -379,8 +380,8 @@ (define test-cabal-internal-library-ignored
 executable cabal
   build-depends:
     HTTP       >= 4000.2.5 && < 4000.3,
-    internal
-library internal
+    internAl
+library internaL
   build-depends: mtl        >= 2.0      && < 3
 ")
 
-- 
2.35.1


  reply	other threads:[~2022-06-02 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  8:18 bug#54760: import: hackage: Internal libraries are not filtered out of dependency list Philip Munksgaard
2022-05-22  9:37 ` Lars-Dominik Braun
2022-06-02  9:53   ` Philip Munksgaard
2022-06-02  9:59     ` Philip Munksgaard
2022-06-02 11:31       ` Philip Munksgaard
2022-06-02 11:57         ` Lars-Dominik Braun [this message]
2022-06-02 12:47           ` Philip Munksgaard
2022-06-05  9:43             ` Lars-Dominik Braun
2022-06-06 11:30   ` Lars-Dominik Braun

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=YpiljmAhcSAHsn36@noor.fritz.box \
    --to=lars@6xq.net \
    --cc=54760@debbugs.gnu.org \
    --cc=philip@munksgaard.me \
    /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).