From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +jfOK4iv618oSwAA0tVLHw (envelope-from ) for ; Tue, 29 Dec 2020 22:36:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SGFmJ4iv61+pagAA1q6Kng (envelope-from ) for ; Tue, 29 Dec 2020 22:36:56 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3C44E94043A for ; Tue, 29 Dec 2020 22:36:56 +0000 (UTC) Received: from localhost ([::1]:35268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuNbq-00055W-VG for larch@yhetil.org; Tue, 29 Dec 2020 17:36:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuNbi-00055O-Dh for guix-devel@gnu.org; Tue, 29 Dec 2020 17:36:46 -0500 Received: from mira.cbaines.net ([212.71.252.8]:59510) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuNbg-0004Dk-G7 for guix-devel@gnu.org; Tue, 29 Dec 2020 17:36:46 -0500 Received: from localhost (92.41.186.20.threembb.co.uk [92.41.186.20]) by mira.cbaines.net (Postfix) with ESMTPSA id 231FA179E3; Tue, 29 Dec 2020 22:36:43 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 89920205; Tue, 29 Dec 2020 22:36:40 +0000 (UTC) References: User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines To: Vincent Legoll Subject: Re: profile-collisions linter In-reply-to: Date: Tue, 29 Dec 2020 22:36:38 +0000 Message-ID: <878s9g9r49.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 3C44E94043A X-Spam-Score: -4.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: EUkwBbAa/ZCw --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Vincent Legoll writes: > I'm having a look at the reported profile-collisions > linter warnings. > > See for example: > http://data.guix.gnu.org/revision/f521104e344ed9bf259a6b821fd0f3080f8ebf6= b/package/python-requests/2.20.1?locale=3Den_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=E2=80=99s urllib2 library.") (license license:asl2.0))) =20 (define (propagated-inputs-filtered overrides old_inputs) =2D (let* ((overrides_names (map caar overrides)) =2D (old_inputs_filtered (remove (lambda i (member (caar i) overrid= es_names) old_inputs)))) =2D (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))) =20 ;; Some software requires an older version of Requests, notably Docker/Doc= ker ;; Compose. @@ -2471,10 +2473,10 @@ than Python=E2=80=99s urllib2 library.") (base32 "0qzj6cgv3k9wyj7wlxgz7xq0cfg4jbbkfm24pp8dnhczwl3152= 7a")))) (propagated-inputs =2D `,@(propagated-inputs-filtered =2D `(("python-urllib3" ,python-urllib3-1.24) =2D ("python-idna" ,python-idna-2.7)) =2D (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))))) =20 (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 ar= guments 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/rr3ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xf5/xAAqcDWAJqwF65FbfRF1nLwFcxWuW1kZVMk aGBE0NRqauPecJKXxZsjJfGo2yIFyMcshXrpHOcKhYsz1DIadn+PuNIa23R+72q9 h1VvogG2bMR0qrm1nW4nDc1i9KbRwxoyLqcfgxnMPNqe9va9Sr2iXDgFycADzABj 4rpm4SWy+QXvxopov76nz3+2nxF98GEPe84NNwQgBPG4RK+TXOGdpDFaDJqpscY8 FRhYudzmmaUjQLR8wlfZHHMSxmG4aMnvWh3LbMLwhVu8/aA9EXqfwISuxAhIjcSu RiMdrvUGDb27n3ck+tDwHhzcIhdzrxjWx6L0Am4DVlJO/ZlyEvlkCqdO8NylPQaG Yyqb4eINlhsrC1YOymCuzeEWX3Sv0p5MaDJzYeTPVAHVk9EVhNLiJjxTOGWJA0A9 fhn0dRwenxRwXkzTvXRQRuozOQbELD6oxK0JeNXsW9CwL7OcyddgSX2W/qxr0iGh WSuGE1YIGYzDqhqsTVNmHzVBRbdnuQpepTCjQCZEFGLJPlMcoyXq/L7lY5AKOUE/ 4+KARKdgfnWtOz46lCnVbIGvu43CIjuvqlqd7D+ohJLQtgQMFc2luTlwmd6amVoS ENco+2TFhsLAnXlMjw0ZvNiFN5cHsqwybaKapGOk95b+u/GZvZea56v8QzQVdMzw hWYO7hJaIOQ= =w9BU -----END PGP SIGNATURE----- --=-=-=--