From unknown Wed Jun 18 23:18:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62036 <62036@debbugs.gnu.org> To: bug#62036 <62036@debbugs.gnu.org> Subject: Status: [PATCH] guix: packages: Consider 'patches' by 'package-direct-sources'. Reply-To: bug#62036 <62036@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:18:31 +0000 retitle 62036 [PATCH] guix: packages: Consider 'patches' by 'package-direct= -sources'. reassign 62036 guix-patches submitter 62036 Simon Tournier severity 62036 normal tag 62036 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 12:18:47 2023 Received: (at submit) by debbugs.gnu.org; 7 Mar 2023 17:18:47 +0000 Received: from localhost ([127.0.0.1]:47108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZaxa-00042n-N0 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 12:18:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:45514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZaxY-00042f-5P for submit@debbugs.gnu.org; Tue, 07 Mar 2023 12:18:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZaxX-0004h5-QN for guix-patches@gnu.org; Tue, 07 Mar 2023 12:18:43 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZaxW-0007cd-2Q for guix-patches@gnu.org; Tue, 07 Mar 2023 12:18:43 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v16so12952451wrn.0 for ; Tue, 07 Mar 2023 09:18:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678209520; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6QRbDDVH6o/ytumYy8LG8YndqDJXizJUZivCVyCwSlk=; b=UeAmlW4wutQUp9NQ7VDDAGhxgsYCyesh7QasCEwTjrfFy00wpgXoDy7v0eJlgOqfnI oBbDP4A6jMZMjoOCR3GiMg62WVjG3onz9OE3UOiPyvlF/xytTKnGmV1jITwOVYvBZ0gj mPkj+JG+A0i6+dNK5IU8Fs5BN90U5G910J0xyyutw6t61xmhQ5xp4NHtybaIaTJoHtqc K7m4BatWJd4hxaR0nlP80BIeU0jOyf36PZQTIyXBwAADRXdFVYHP5h1fMYxzZ5TMXilX CIBvpd8jBdyWEh6dNpI1F0vI3BQgKijPLdU/8rRdGmZJSxxDdlIcWlhipm4ZPrJlB+bf oTIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678209520; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6QRbDDVH6o/ytumYy8LG8YndqDJXizJUZivCVyCwSlk=; b=vUOvYl8J5jtdGXzKRbesytqWwsfz5cUZVUMIPi4xwk0HIPcn/v47KWywBrNBUMOVCR MN0nee/gjt9S8Wdg2ClFB8LqjI/neXnFY2FOKSIMLricbjV0pPfeTAWz2XfmS63JOxZT UvVJQ4DlXZyRvsggPttpCDl13Q5HQH/AlHAIvckvJG12LTmsEjQeeabrMUTuR3qLI8U9 YLibXZCV41TtF8LkU1orzcMUArVH+lgReRmkliKb+cjckaBba6GI3QwTKdoB9IJlZugb AXbnqQE/hxraUPTleR77IOvKZLkH8c3AYEyUAkcPMJxrPgg/3X03EZvum2z3mioBoB5A gqvQ== X-Gm-Message-State: AO0yUKWaZ5wJ72ubXUiFt30iYWv0OAw5KmoyLdagU135L/E7f05PKHM1 i8tdAcM91oOKs+/oy+PoF8KrSs2AYbI= X-Google-Smtp-Source: AK7set82pLYM0JxDbYApO7tqB0cuGUHpt7bR+i+n6Q0WWwDQnmGvKCKSdv8ruSJA1JYIFgUqog1rIg== X-Received: by 2002:adf:fc0d:0:b0:2c7:1755:30ad with SMTP id i13-20020adffc0d000000b002c7175530admr10984311wrr.2.1678209520378; Tue, 07 Mar 2023 09:18:40 -0800 (PST) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e13-20020a5d65cd000000b002c3f81c51b6sm12807621wrw.90.2023.03.07.09.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 09:18:39 -0800 (PST) From: Simon Tournier To: guix-patches@gnu.org Subject: [PATCH] guix: packages: Consider 'patches' by 'package-direct-sources'. Date: Tue, 7 Mar 2023 18:18:33 +0100 Message-Id: <20230307171833.4170067-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Debbugs-CC: Christopher Baines , Josselin Poiret , , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Simon Tournier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. --- guix/packages.scm | 10 ++++++++-- tests/packages.scm | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) Hi, This patch improves some coverage when listing all the origins (fixed outputs) of some packages. The procedure 'packages-direct-sources' already lists the 'origin' as inputs but is missing the 'origin' as 'patches'. For an instance of such, see the package 'ntp'. Note that it is not recursive. If an 'origin' is listed in 'patches' or 'inputs' and that origin also contains 'patches' which is another 'origin' then it will be missed. For now, it is not covered because it somehow adds complexity without an instance (yet) of such case. Cheers, simon diff --git a/guix/packages.scm b/guix/packages.scm index 041a872f9d..0f88564ab4 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Chris Marusich ;;; Copyright © 2022 Maxime Devos ;;; Copyright © 2022 jgart +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -1239,8 +1240,13 @@ (define-syntax modify-inputs (define (package-direct-sources package) "Return all source origins associated with PACKAGE; including origins in -PACKAGE's inputs." - `(,@(or (and=> (package-source package) list) '()) +PACKAGE's inputs and patches." + (define (expand source) + (append + (list source) + (filter origin? (origin-patches source)))) + + `(,@(or (and=> (package-source package) expand) '()) ,@(filter-map (match-lambda ((_ (? origin? orig) _ ...) orig) diff --git a/tests/packages.scm b/tests/packages.scm index f58c47817b..27fb918f90 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -418,12 +419,15 @@ (define read-at (let* ((o (dummy-origin)) (u (dummy-origin)) (i (dummy-origin)) + (j (dummy-origin (patches (list o)))) (a (dummy-package "a")) (b (dummy-package "b" (inputs (list a i)))) (c (package (inherit b) (source o))) (d (dummy-package "d" (build-system trivial-build-system) - (source u) (inputs (list c))))) + (source u) (inputs (list c)))) + (e (dummy-package "e" (source j))) + (f (package (inherit e) (inputs (list u))))) (test-assert "package-direct-sources, no source" (null? (package-direct-sources a))) (test-equal "package-direct-sources, #f source" @@ -437,6 +441,17 @@ (define read-at (and (= (length (pk 's-sources s)) 2) (member o s) (member i s)))) + (test-assert "package-direct-sources, with patches" + (let ((s (package-direct-sources e))) + (and (= (length (pk 's-sources s)) 2) + (member o s) + (member j s)))) + (test-assert "package-direct-sources, with patches and inputs" + (let ((s (package-direct-sources f))) + (and (= (length (pk 's-sources s)) 3) + (member o s) + (member j s) + (member u s)))) (test-assert "package-transitive-sources" (let ((s (package-transitive-sources d))) (and (= (length (pk 'd-sources s)) 3) base-commit: 723fc5df3e964fcecb09c7c6fd48f00f97e2e806 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 09 14:43:34 2023 Received: (at 62036) by debbugs.gnu.org; 9 Mar 2023 19:43:34 +0000 Received: from localhost ([127.0.0.1]:53124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paMAo-0003Ma-86 for submit@debbugs.gnu.org; Thu, 09 Mar 2023 14:43:34 -0500 Received: from jpoiret.xyz ([206.189.101.64]:38792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paMAn-0003MR-4K for 62036@debbugs.gnu.org; Thu, 09 Mar 2023 14:43:33 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id BD73B185313; Thu, 9 Mar 2023 19:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1678391011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CfNG4kVOSrpqGaj/GjNk2aX/EHVm1/O+h7LiXsnD+JY=; b=psrq5qWNihIYze4AAqgHM/7NAelOIMkDYB4gcsLPsMgr2TCPVpLAGNtloRoRhAc6CopJ1N pngLqh0MoJ6ZdK80HFur8qPv08nOoU4e0qKm5i/IccfNzOmopb/xt7L1Fro65qhPd/t3eu FmMAUdMJmob9N1o0huC9LkbpU2LtA/kmPK/jqK+S8SmYTmTYKjRlR4RU4eS31o6EBkWDUW +e8YSTbevGDHgN/LERfa3phimNQTiPjhg6G/kNN3UoS0ZlWIRny9173xbgw/e0R0tC5qqK lb9o+eDb4FV82ePIAR0GISPdS1OXp7M6o/IrB1HnZ4nqkpLvxj3GvBoVhaNp0A== From: Josselin Poiret To: Simon Tournier , 62036@debbugs.gnu.org Subject: Re: [bug#62036] [PATCH] guix: packages: Consider 'patches' by 'package-direct-sources'. In-Reply-To: <20230307171833.4170067-1-zimon.toutoune@gmail.com> References: <20230307171833.4170067-1-zimon.toutoune@gmail.com> Date: Thu, 09 Mar 2023 20:43:26 +0100 Message-ID: <87lek5d82p.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Level: * X-Spamd-Bar: + X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62036 Cc: Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Simon, Simon Tournier writes: > (define (package-direct-sources package) > "Return all source origins associated with PACKAGE; including origins = in > -PACKAGE's inputs." > - `(,@(or (and=3D> (package-source package) list) '()) > +PACKAGE's inputs and patches." > + (define (expand source) > + (append > + (list source) > + (filter origin? (origin-patches source)))) * cough * (cons source (filter ...)) * cough * Other than that, LGTM! Tests worked fine on my end. No idea what this is used for though :p Best, =2D-=20 Josselin Poiret --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQKNt4QHGRldkBqcG9p cmV0Lnh5egAKCRBQXkC5FhcaigLjC/4z42MulqY4FuyhGqP9YC0JLljEf82HPn02 KLk17Hqv+iyjrchcaSzbk1LdzUEuQOoScy0tfWH1cNVtQ8ixZ+CU6YahP3SkErD4 x5wthA030DacfhZR9jPgHpqxGFNqVjMOaFx9cUa4fG4W2RTw5/UbGvdZ28yeZ8Wm hL+YD5V71h7T+ShRwIY4Ky/uHMV+ehQ2F5ENQDQ5vsyKCkVRfqkeWB+U8wrd8ja8 zS5spTxSY3DUR1HTiSmb9mFJVE/AfHrQtPBK6yEZhEnF5m94F6ZqhJvbYEvxe+yr TTesEgy/kpDIlsukILSreA8lQULmETikpjWAWXDtTMqLcLjTP8ojOoldUYlwX2ev CjVDgoVGiP0Xf3s1Erkua98GRvukXCOEp/x5k3xbHJnmR2Pcbox8q4uCn5qS0mSX t95Yh0nD+5s7biczROPQ4rdS/dTB321YpAUS+3u0CKd9f8BLUujZx/o0rwq1KwDB 2HZok+oderfr2PcX9HogFb7O6Mclj+Q= =sU7q -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:09:24 2023 Received: (at 62036) by debbugs.gnu.org; 10 Mar 2023 12:09:24 +0000 Received: from localhost ([127.0.0.1]:53931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabYp-0005WN-Ej for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:09:24 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:36861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabYn-0005Vn-18 for 62036@debbugs.gnu.org; Fri, 10 Mar 2023 07:09:21 -0500 Received: by mail-wm1-f42.google.com with SMTP id j19-20020a05600c191300b003eb3e1eb0caso5843302wmq.1 for <62036@debbugs.gnu.org>; Fri, 10 Mar 2023 04:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678450155; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KdGCUy7uza2hNlqdj+iZSzz2fkcinNd8dbLWbOMG6Jg=; b=ECMW7mtzcrFhH1EMkR5Pzlq0fTWeBcoX1vxyTPUUrXXUakK3b63XJERoCb5N+Qlxrx EdhGLnw93zYLoTCdWP4V9T0RQEpSmY1bhKkSaVZf1OvfeO2k9t1aAkLo1dMgyiswQfHK uuWEMntpRCq4UOD79lq3+4LQBWeWXifQentX3yb/BXmGPrOrubtm84uKEhxkWd/2MhGU 539JvbX74asInrjTqbiCPLHorIo+Bq6LvohQJA6e/tvt5bw8KoIA6GvKc5EkL2AIkxcN LeFZ+zf4NUw1nInl+7oytnmyu7+hQklJi/vkn1toDI4xr2v9eIRCD1DFoTkEBylDpv5G E8WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678450155; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KdGCUy7uza2hNlqdj+iZSzz2fkcinNd8dbLWbOMG6Jg=; b=ecA8BYUh6X5UGVwdpeG1BlNr549LRS+FOGYP+79PdVZWrKQKBOSHa3IvGs7X0uBNZS COA3ybG8C+50J/Pwfj83ft+Yq5VjsUnGS6cxXgUN7WFNFaK/ZCgl3HGnFSY6v87LNdE6 thImHOYDAEyXB5QhF3+tGzHrjIivbDPvpjA34zulrMj4pJ5/DKIf2g/B+6v8CGsTp9yL k3NGQgfeB17T18M/7d30+hOvW6B+9avpMKwQSTJCkFKQ7jat9QiK6bLUPvlyHlJZoHMJ FCvESK7Sg+T2HGRcDOY6quCgc5yxfeSZYr0iVUCFA5QpEo8EEtmHAxd4sCbyPyUw7UhJ 7UqQ== X-Gm-Message-State: AO0yUKWec1lzHrFBjC5LrjogQ85MMbGFDgfKDgACRdhchWRafQcF5tLc UQTuINkF4FPr7xNI+3izX9o= X-Google-Smtp-Source: AK7set/qayeoKXuTYxKNb75AoyGprlyK1nCaCGyDVhxsEZLalQ8a7l+3RgTCBevY/bkEu5Bhsra4cw== X-Received: by 2002:a05:600c:3b15:b0:3eb:3986:9c03 with SMTP id m21-20020a05600c3b1500b003eb39869c03mr2254294wms.4.1678450154733; Fri, 10 Mar 2023 04:09:14 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id v8-20020a5d6108000000b002c5804b6afasm1993911wrt.67.2023.03.10.04.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 04:09:14 -0800 (PST) From: Simon Tournier To: Josselin Poiret , 62036@debbugs.gnu.org Subject: Re: [bug#62036] [PATCH] guix: packages: Consider 'patches' by 'package-direct-sources'. In-Reply-To: <87lek5d82p.fsf@jpoiret.xyz> References: <20230307171833.4170067-1-zimon.toutoune@gmail.com> <87lek5d82p.fsf@jpoiret.xyz> Date: Fri, 10 Mar 2023 12:33:06 +0100 Message-ID: <87jzzoon7x.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 62036 Cc: Ricardo Wurmus , Mathieu Othacehe , ludo@gnu.org, Tobias Geerinckx-Rice , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Josselin, On jeu., 09 mars 2023 at 20:43, Josselin Poiret via Guix-patches via wrote: >> + (append >> + (list source) >> + (filter origin? (origin-patches source)))) > > * cough * (cons source (filter ...)) * cough * Ahah! Somehow I removed from my mental toolbox cons, car and cdr because I am spending too much time explaining to non-lispers. :-) Thanks for showing me the light. ;-) > Other than that, LGTM! Tests worked fine on my end. No idea what this > is used for though :p For instance, it can be used to list all the =E2=80=99origin=E2=80=99 of a = package. Consider the package =E2=80=99tensorflow=E2=80=99, it reads, --8<---------------cut here---------------start------------->8--- (native-inputs [...] ;; The commit hashes and URLs for third-party source code are taken ;; from "tensorflow/workspace.bzl". ("boringssl-src" ,(let ((commit "ee7aa02") (revision "1")) (origin (method git-fetch) (uri (git-reference (url "https://boringssl.googlesource.com/boringssl") --8<---------------cut here---------------end--------------->8--- where some inputs are not packages but just =E2=80=99origin=E2=80=99. Ther= efore, the procedure allows to get all the =E2=80=99origin=E2=80=99, the one from the = field =E2=80=99origin=E2=80=99 and also the ones from inputs. --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(gnu packages machine-learning) scheme@(guix-user)> ,pp (map origin-uri (package-direct-sources tensorflow)) $1 =3D (#< url: "https://github.com/tensorflow/tensorflow" c= ommit: "v1.9.0" recursive?: #f> #< url: "https://boringssl.googlesource.com/boringssl" comm= it: "ee7aa02" recursive?: #f> [...] --8<---------------cut here---------------end--------------->8--- For some packages as =E2=80=99ntp=E2=80=99, the patches are also a list of = =E2=80=99origin=E2=80=99, --8<---------------cut here---------------start------------->8--- (origin (method url-fetch) (uri (list (string-append "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-" [...] ;; Add an upstream patch to fix build with GCC 10. Taken from ;; . (patches (list (origin (method url-fetch) (uri "https://bugs.ntp.org/attachment.cgi?id=3D1760= &action=3Ddiff&context=3Dpatch&collapsed=3D&headers=3D1&format=3Draw") [...] --8<---------------cut here---------------end--------------->8--- and the patch allows to also extract them: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(gnu packages ntp) scheme@(guix-user)> ,pp (map origin-uri (package-direct-sources ntp)) $2 =3D (("https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p= 15.tar.gz" "http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p15.tar.gz") "https://bugs.ntp.org/attachment.cgi?id=3D1760&action=3Ddiff&context=3Dpat= ch&collapsed=3D&headers=3D1&format=3Draw" "https://bugs.ntp.org/attachment.cgi?id=3D1814&action=3Ddiff&collapsed=3D&= headers=3D1&format=3Draw") --8<---------------cut here---------------end--------------->8--- This way it improves the coverage with Software Heritage. All the source code (origin) is extracted and feed some SWH loader. The code is there: https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/build-pac= kage-metadata.scm#n58 Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:13:07 2023 Received: (at 62036) by debbugs.gnu.org; 10 Mar 2023 12:13:07 +0000 Received: from localhost ([127.0.0.1]:53957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabcR-0005dx-ES for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:13:07 -0500 Received: from jpoiret.xyz ([206.189.101.64]:35394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabcN-0005dk-AM for 62036@debbugs.gnu.org; Fri, 10 Mar 2023 07:13:05 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 4C9DB185324; Fri, 10 Mar 2023 12:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1678450381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4j44n0+umHft8JI6NUOcm3SGGhkfbczALtXx6t/r07Y=; b=WehmuzyaTu9/eE9s2adsF5+yfan7CGdjjT+RlMrTyeFQuzy7CATRGVtPUb4i4CrTmFQFg1 9L2FGxJ4jaB+gOAvwI9A1htDefitQSxAqwoZssE4vMfvQYu6PsCr3fuaTRFbzWvNxiQ6EH txQpHbjIP6R1L13yAWz/rJKngIVF2vNcPBLxcEjk1UTa41lV361Jjy9MIzqUpr4CsQLIzd vwNG8PuxbMLT28uZUWEOaJNhdjgF3twa9aPDqQnSbm6/9Gqxi49GCK+dOrwaI2EzOo9F/y tNmbORPj1+22ZErcLJAam/tWi+ROGrRcLTUUbICLTC4Ys242Ug6pWN4u6h5s2w== From: Josselin Poiret To: Simon Tournier , 62036@debbugs.gnu.org Subject: Re: [bug#62036] [PATCH] guix: packages: Consider 'patches' by 'package-direct-sources'. In-Reply-To: <87jzzoon7x.fsf@gmail.com> References: <20230307171833.4170067-1-zimon.toutoune@gmail.com> <87lek5d82p.fsf@jpoiret.xyz> <87jzzoon7x.fsf@gmail.com> Date: Fri, 10 Mar 2023 13:12:52 +0100 Message-ID: <87jzzoby9n.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Level: * X-Spamd-Bar: + X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62036 Cc: Ricardo Wurmus , Mathieu Othacehe , ludo@gnu.org, Tobias Geerinckx-Rice , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Simon, Simon Tournier writes: > This way it improves the coverage with Software Heritage. All the > source code (origin) is extracted and feed some SWH loader. The code is > there: > > https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/build-p= ackage-metadata.scm#n58 Ahh, that's the part I was missing. Great work! Best, =2D-=20 Josselin Poiret --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQLHsQQHGRldkBqcG9p cmV0Lnh5egAKCRBQXkC5FhcaihUXDACfgl9R1VQfRYZd/hND/0GZFQ6pMCuYb7m8 FyO6RuuL6yt6mR0LeT/9vESJVgTWaNiBJxzX+EPLOcJN2Mhua5qRcvscQJ+JTUCH g65Wj9qD/fyqB7s9Qdov2UHAyfvptUAliB0YJRUt2AjjtzpThbX7e8TUvopwNrvf 2Jd7OobKYhPjsas1WFkNWszTOKZN38oqPV1N2tOXls0/wSX7gUryyqlBguTPH21x tntlkF6YLZH+x72NOLyW6doPn1cIm6paiVFkxHNM0R5Z2Utb7e6vZTwdmCM5RiwT JCY/WQZi0LH7ZdoH2e28zUJ9qvev8X64CbyQV49wUP0BDoZRRbd6GXPkHp0VXHOh 5/1j+aaKjfPbX0fJ6MlAZgkB7YNLNimn4OXG3+NEEyU8cxUfhUdALOd+gFfl08L7 MEzuP8DE1+4GBEzv/WZyjHZLe0/UEMdNlNIUKLCpPpqzynLxSOlyFyQ0OY3enu+V XYnngirofSox6cNwe1IOCS5BZdfoSK4= =Y9iy -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 11:51:28 2023 Received: (at 62036) by debbugs.gnu.org; 11 Mar 2023 16:51:28 +0000 Received: from localhost ([127.0.0.1]:58547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb2RM-00021g-5L for submit@debbugs.gnu.org; Sat, 11 Mar 2023 11:51:28 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:38861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb2RK-00021U-H0 for 62036@debbugs.gnu.org; Sat, 11 Mar 2023 11:51:27 -0500 Received: by mail-wm1-f42.google.com with SMTP id o5-20020a05600c510500b003ec0e4ec6deso2088394wms.3 for <62036@debbugs.gnu.org>; Sat, 11 Mar 2023 08:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678553480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sl7Loj787Rego6/ljF57gluEd/2uTE+v/hAcm+9o5Vw=; b=og1guvKJBZxCHajCarh3BsYCE/Em4DjhTa3v4EibZ9b3Ep94+AwE5VYl9rOm2+WOjH 4bRd+gIom/Jki/U8STswOI28iVtPH1mPngY8btsr74I+5H3Rv/bnwic+GP75fqpxZysy GxwbZyxL7OTxm1ee1VxcHlP3b2uSfIqbvHSBSUYCeYRqaXdbDk9gv7Z4ZPDmaDUNdNRY qdLmCBdkOZgYhz5uEm/qBMdOvVhNRyZXyBj3iXFksQhkndkpUsiytbrt9V1pSs4CSztD 8J20qElFdl+vub4nsJeobanEkCGK6RyBMDQS34XOKqFftTs1BhID7m9eMKgzrIrlrzKw +HJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678553480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sl7Loj787Rego6/ljF57gluEd/2uTE+v/hAcm+9o5Vw=; b=Z+yeO1iBYOY84peBOcvusNBQr0FibzufC0AAVAuWBqcry8DMYiMz2XTVuMmLS7xSkr Xq4CDPLGqQi+2z7B5gJmSdW3rVyVk0oi1gJH61iS4ehffFy3byx/Efvdml6SK8Qgemlj DS0pNePAeM4hgvclEghJk/VCxrhFu4YxiPrhPZoV71OhsJdG42rfTeg2pRaANg40AhkZ OlMlCs42PoLye945mHeW4KmD8CYymkK9htlRpoMSmgquPcn3bgCgK7HhS3NA5fwOCEb+ anSLkcujXPtdZFS8PePQdUpH0xni9//4c0FHPDnjTnRibPxgyLevy4yLL1UKMLDjJlYy kRkA== X-Gm-Message-State: AO0yUKVuraJkorpFyhEtVeW/1u1BNy85ejejlMLsp0mmyv0jrNzeQgBL nuUtdAcHpVBk2+SmxzM21jpk7iunPOw= X-Google-Smtp-Source: AK7set/aJXRk3DXxKVQl3X8CHlrZr4KB/EMj7wvLCvU4Y34VBv43MJAufQEsyDxQPiICfXhixq9YKA== X-Received: by 2002:a05:600c:3b15:b0:3eb:3986:9c03 with SMTP id m21-20020a05600c3b1500b003eb39869c03mr5617718wms.4.1678553480455; Sat, 11 Mar 2023 08:51:20 -0800 (PST) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id m5-20020adffe45000000b002c5801aa9b0sm2929633wrs.40.2023.03.11.08.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Mar 2023 08:51:19 -0800 (PST) From: Simon Tournier To: 62036@debbugs.gnu.org Subject: [PATCH v2] guix: packages: Consider 'patches' by 'package-direct-sources'. Date: Sat, 11 Mar 2023 17:51:10 +0100 Message-Id: <20230311165110.726639-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230307171833.4170067-1-zimon.toutoune@gmail.com> References: <20230307171833.4170067-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62036 Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. --- guix/packages.scm | 10 ++++++++-- tests/packages.scm | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 041a872f9d..7b098e21f0 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Chris Marusich ;;; Copyright © 2022 Maxime Devos ;;; Copyright © 2022 jgart +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -1239,8 +1240,13 @@ (define-syntax modify-inputs (define (package-direct-sources package) "Return all source origins associated with PACKAGE; including origins in -PACKAGE's inputs." - `(,@(or (and=> (package-source package) list) '()) +PACKAGE's inputs and patches." + (define (expand source) + (cons + source + (filter origin? (origin-patches source)))) + + `(,@(or (and=> (package-source package) expand) '()) ,@(filter-map (match-lambda ((_ (? origin? orig) _ ...) orig) diff --git a/tests/packages.scm b/tests/packages.scm index f58c47817b..27fb918f90 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -418,12 +419,15 @@ (define read-at (let* ((o (dummy-origin)) (u (dummy-origin)) (i (dummy-origin)) + (j (dummy-origin (patches (list o)))) (a (dummy-package "a")) (b (dummy-package "b" (inputs (list a i)))) (c (package (inherit b) (source o))) (d (dummy-package "d" (build-system trivial-build-system) - (source u) (inputs (list c))))) + (source u) (inputs (list c)))) + (e (dummy-package "e" (source j))) + (f (package (inherit e) (inputs (list u))))) (test-assert "package-direct-sources, no source" (null? (package-direct-sources a))) (test-equal "package-direct-sources, #f source" @@ -437,6 +441,17 @@ (define read-at (and (= (length (pk 's-sources s)) 2) (member o s) (member i s)))) + (test-assert "package-direct-sources, with patches" + (let ((s (package-direct-sources e))) + (and (= (length (pk 's-sources s)) 2) + (member o s) + (member j s)))) + (test-assert "package-direct-sources, with patches and inputs" + (let ((s (package-direct-sources f))) + (and (= (length (pk 's-sources s)) 3) + (member o s) + (member j s) + (member u s)))) (test-assert "package-transitive-sources" (let ((s (package-transitive-sources d))) (and (= (length (pk 'd-sources s)) 3) base-commit: 7376424844e0dc1103a9d86799c2fb9bd4aa35eb -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 07:15:03 2023 Received: (at 62036-done) by debbugs.gnu.org; 13 Mar 2023 11:15:03 +0000 Received: from localhost ([127.0.0.1]:33721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbg8s-0002G3-Uw for submit@debbugs.gnu.org; Mon, 13 Mar 2023 07:15:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbg8q-0002F3-Q2 for 62036-done@debbugs.gnu.org; Mon, 13 Mar 2023 07:15:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbg8k-0006vF-P3; Mon, 13 Mar 2023 07:14:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=zttvNhUjOhXE9QctCrSZYDfxaY9TGmrevMjK+iqeCkU=; b=HvN0jKRSWupdoYgtDSOQ ID7d5yZejxjvCluKMNbGLfcYOfmns2XrSDLclVqn0Q2jGTbNBh9wPMybBtHlPHUetW+Oz2Dw0CF4W 8M9sorGO4bd9fG4DCKxqmUxghZ4Mc08mLX9cAUiS1cu8+s1QWhlqp6mddCpNArnH2UxpbiseWblso UevfGf9WOp1sEQ+1LkpKyQX5wl6JR8Moy9b6Oo7z6vOOTvwG6PtR5mSok55BzPgORW7fFcldCmjRW 8I0TC5hrrSholtYc3u8OziVHNdeB38NkbqpKGJUHLPVJ/X/iFLVEu9uUFzgpC3/njH1fc4enreRn1 PqZ+AsPqNvgjxg==; Received: from [193.50.110.253] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbg8j-0006Oa-Pq; Mon, 13 Mar 2023 07:14:54 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Simon Tournier Subject: Re: [PATCH v2] guix: packages: Consider 'patches' by 'package-direct-sources'. References: <20230307171833.4170067-1-zimon.toutoune@gmail.com> <20230311165110.726639-1-zimon.toutoune@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 23 =?utf-8?Q?Vent=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du =?utf-8?Q?Cochl=C3=A9aria?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 13 Mar 2023 12:14:51 +0100 In-Reply-To: <20230311165110.726639-1-zimon.toutoune@gmail.com> (Simon Tournier's message of "Sat, 11 Mar 2023 17:51:10 +0100") Message-ID: <87o7ow52dw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62036-done Cc: Josselin Poiret , Tobias Geerinckx-Rice , 62036-done@debbugs.gnu.org, Mathieu Othacehe , Christopher Baines , Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Simon Tournier skribis: > * guix/packages.scm (package-direct-sources): Return 'origin' from 'patch= es'. > * tests/packages.scm: Test it. Applied, thanks! Ludo=E2=80=99. From unknown Wed Jun 18 23:18:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 10 Apr 2023 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator