unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Vincent Legoll <vincent.legoll@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: profile-collisions linter
Date: Tue, 29 Dec 2020 22:36:38 +0000	[thread overview]
Message-ID: <878s9g9r49.fsf@cbaines.net> (raw)
In-Reply-To: <CAEwRq=ps54u0hC-6hnXji1rdupM_6ZyOxvkZQZiSMVZu1eBAuQ@mail.gmail.com>

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


Vincent Legoll <vincent.legoll@gmail.com> writes:

> I'm having a look at the reported profile-collisions
> linter warnings.
>
> See for example:
> http://data.guix.gnu.org/revision/f521104e344ed9bf259a6b821fd0f3080f8ebf6b/package/python-requests/2.20.1?locale=en_US.UTF-8
>
> I'm trying to remove the duplicated propagated-inputs
> entries (from the inherited package) and then
> concatenating the overrides.
>
> I've come with the attached diff, but it's giving me
> headaches.
>
> Anyone can give it a look and tell me what is wrong
> with my coding ?

It's good to fix lint warnings, although I wonder if these could be
addressed by checking if this old version of python-requests is still
necessary to use. Maybe things that use it could be updated, and use the
normal version?

On your code though, I made the following changes to make run at least:

@@ -2455,9 +2455,11 @@ than Python’s urllib2 library.")
     (license license:asl2.0)))
 
 (define (propagated-inputs-filtered overrides old_inputs)
-  (let* ((overrides_names (map caar overrides))
-         (old_inputs_filtered (remove (lambda i (member (caar i) overrides_names) old_inputs))))
-    (concatenate '(old_inputs_filtered overrides))))
+  (let* ((overrides_names (map car overrides))
+         (old_inputs_filtered
+          (remove (lambda i (member (caar i) overrides_names))
+                  old_inputs)))
+    (append old_inputs_filtered overrides)))
 
 ;; Some software requires an older version of Requests, notably Docker/Docker
 ;; Compose.
@@ -2471,10 +2473,10 @@ than Python’s urllib2 library.")
                       (base32
                        "0qzj6cgv3k9wyj7wlxgz7xq0cfg4jbbkfm24pp8dnhczwl31527a"))))
            (propagated-inputs
-             `,@(propagated-inputs-filtered
-               `(("python-urllib3" ,python-urllib3-1.24)
-                 ("python-idna" ,python-idna-2.7))
-               (package-propagated-inputs python-requests)))))
+            (propagated-inputs-filtered
+             `(("python-urllib3" ,python-urllib3-1.24)
+               ("python-idna" ,python-idna-2.7))
+             (package-propagated-inputs python-requests)))))
 
 (define-public python2-requests
   (package-with-python2 python-requests))


Applying your diff, and running make, I see:

  gnu/packages/python-web.scm:2459:30: warning: possibly wrong number of arguments to `remove'

It's correct, avoiding long lines might help you spot things like this.

caar needs to be car, that'll access the first element in a list. caar
would only work if the list contains a pair/list as the first element.

Because you wrote (concatenate '(old_inputs_filtered overrides)), note
the ', you're trying to concatenate a list of two symbols. The following
would work (concatenate `(,old_inputs_filtered ,overrides)), but you're
better just using append.

Anyway, I don't think having code is useful here. I'd just copy the two
lines from the above package definition and replace
,@(package-propagated-inputs python-requests). This package definition
doesn't need to dynamically change, so that's fine, and the duplication
is simpler than this code.

Note also that the old urllib3 is built with the normal idna version, so
you'll probably need to do something about that to resolve all of the
propagated-input warnings.

Hope that helps,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

      reply	other threads:[~2020-12-29 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 15:05 profile-collisions linter Vincent Legoll
2020-12-29 22:36 ` Christopher Baines [this message]

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=878s9g9r49.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guix-devel@gnu.org \
    --cc=vincent.legoll@gmail.com \
    /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).