From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 26 21:48:57 2022 Received: (at submit) by debbugs.gnu.org; 27 Apr 2022 01:48:57 +0000 Received: from localhost ([127.0.0.1]:40816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njWnZ-0007vX-G8 for submit@debbugs.gnu.org; Tue, 26 Apr 2022 21:48:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:57492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njWnY-0007vP-1V for submit@debbugs.gnu.org; Tue, 26 Apr 2022 21:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njWnX-0006AS-MY for bug-guix@gnu.org; Tue, 26 Apr 2022 21:48:55 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:35666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njWnV-0008OP-2l for bug-guix@gnu.org; Tue, 26 Apr 2022 21:48:55 -0400 Received: by mail-qk1-x72e.google.com with SMTP id z126so384340qkb.2 for ; Tue, 26 Apr 2022 18:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=1phqMD13WJP4oED0kIy1SX+QR/+iqmM9ut3ARVXJhuc=; b=N2GCblsoWGZgWponjNT3kkHJNVe9Cpi5Ioe49Q0irMHa1TvujPrK4za4A36g1kILPo ES3qbBT79rPq8+CFGnaboXuzRTmKjyyH84bh8EGnTnlAhnIhSGlsmNJMYjtSEoBPopCo F4DVd4scDZC4NebDCkpxejzNpL7h5upOLM43QddJvIdqyDmt0f5P4R4atNvjSQjIw7Dc TITbTvyrK5s8BKbfNWQOt/F0FWWlwaEa8BD6gpys6sMjXM5cPJZuuHhNIpHxVV/knLXr 08aQ0GTtYukSNT/2y/7kX/c1uqS+Xhk0ucAcGFlGHjNOfxCg3cfAb7hY4MZLoBx8UyvD Cvnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=1phqMD13WJP4oED0kIy1SX+QR/+iqmM9ut3ARVXJhuc=; b=cOQ67lJTt1Onu7UpQKMhjb/hiR8NsJ7ot+AANFW6efAx4tJrUzM7tVbETyzrxhvtFU McPjsL0YxNpFDCdr1mFseWbQDaoarjPt6Q2ha/A4jbCRuYZKv45jqh1L7+lGs9eRJbth ykkqDPJR0fqfwBtr6yMFa79pOaAo/+3Hb/H0d4k3aM1qHRjFXb2IpQpm+06slMRMgA/f U7uKKoMH/bN8Hx3n0/JhfNxKk88XOBqZ4CUVWTznhKwPHqLhM62GSxd+mCeGizKmCwWm wWfaWfoGSMXVSmZaToXFqng0Y+XrBP/pW428NkIsB7j/h2rUv8xIXw607SFuIgJGnsti 1/QA== X-Gm-Message-State: AOAM532BjKXAQUBcWAPytprBRT1SLRYPpbsctj/igg/TT+uLW5tpyL2s nUMSHk0MAkckHuvhZOqdK2aVxcW5vFJJog== X-Google-Smtp-Source: ABdhPJwLkDy9opE2fv5y4JzqD/7obCCm6ryTyesTOL3zjEje/IPh3jAINF/Y2SVVyBtA8Tk1N7VTGQ== X-Received: by 2002:a05:620a:2152:b0:69f:6130:fa29 with SMTP id m18-20020a05620a215200b0069f6130fa29mr6717745qkm.126.1651024131121; Tue, 26 Apr 2022 18:48:51 -0700 (PDT) Received: from hurd (dsl-150-50.b2b2c.ca. [66.158.150.50]) by smtp.gmail.com with ESMTPSA id v67-20020a376146000000b0069ec181a0c6sm7452674qkb.10.2022.04.26.18.48.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 18:48:50 -0700 (PDT) From: Maxim Cournoyer To: bug-guix Subject: package-location is wrong for transformed packages Date: Tue, 26 Apr 2022 21:48:49 -0400 Message-ID: <8735hz2t4u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit 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 (--) Hi Guix! --8<---------------cut here---------------start------------->8--- > ,import (gnu packages) (guix packages) > (car (find-packages-by-name "python2-pyalsaaudio")) $1 = # > (package-definition-location-code package $1) $2 = #f > (package-definition-location $2) $3 = #< file: "gnu/packages/audio.scm" line: 4327 column: 2> --8<---------------cut here---------------end--------------->8--- This is wrong though, and gives the location of the parent package (the one it inherited from). This seems to be made on purpose (?) given the code in (gnu build-system python): --8<---------------cut here---------------start------------->8--- (package/inherit p (location (package-location p)) ^ Here, we explicitly set the location to that of its parent. (name (let ((name (package-name p))) (string-append new-prefix (if (string-prefix? old-prefix name) (substring name (string-length old-prefix)) name)))) (arguments (let ((python (if (promise? python) (force python) python))) (ensure-keyword-arguments (package-arguments p) `(#:python ,python))))) --8<---------------cut here---------------end--------------->8--- Another related issue for package-with-python2 packages: --8<---------------cut here---------------start------------->8--- > (package-definition-location-code $1) $4 = #f --8<---------------cut here---------------end--------------->8--- I was expecting to use this to get rid of all leaf Python 2 packages, but it seems that may not work (as easily as I'd hoped). Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 27 08:23:28 2022 Received: (at 55139) by debbugs.gnu.org; 27 Apr 2022 12:23:28 +0000 Received: from localhost ([127.0.0.1]:41477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njghb-0005iT-Sx for submit@debbugs.gnu.org; Wed, 27 Apr 2022 08:23:28 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:11391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njghZ-0005iH-27 for 55139@debbugs.gnu.org; Wed, 27 Apr 2022 08:23:26 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KpHw95b35z3xbl; Wed, 27 Apr 2022 14:23:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1651062201; bh=05p2U4nhnQkPfJUBEJwA6tgzxn8sg0cuFLDLy864wGo=; h=Subject:From:To:Date:In-Reply-To:References; b=XYinASKMhhwdM0BD/gADcqKqdbrTmAo1BAw74ITqA5fc4g6yhO4OuBZYVf+5lVnX8 9ykN605d1Ktn6IkXyW5Id0o2usfmFJv22n6G4O1ry/iS3VYOnKmLp1DMXaL+KxlzFS gyRpccYOL4NT78cIgqaHYyLTVMEND3Lhazh+KXKA= Message-ID: <24e49cc6e3c212973efc4c46b1218ebd1a9acf0a.camel@ist.tugraz.at> Subject: Re: package-location is wrong for transformed packages From: Liliana Marie Prikler To: Maxim Cournoyer , 55139@debbugs.gnu.org Date: Wed, 27 Apr 2022 14:23:20 +0200 In-Reply-To: <8735hz2t4u.fsf@gmail.com> References: <8735hz2t4u.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55139 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 (---) Am Dienstag, dem 26.04.2022 um 21:48 -0400 schrieb Maxim Cournoyer: > Hi Guix! > > --8<---------------cut here---------------start------------->8--- > > ,import (gnu packages) (guix packages) > > (car (find-packages-by-name "python2-pyalsaaudio")) > $1 = # 7f2b76fab160> > > (package-definition-location-code package $1) > $2 = #f > > (package-definition-location $2) > $3 = #< file: "gnu/packages/audio.scm" line: 4327 column: > 2> > --8<---------------cut here---------------end--------------->8--- > > This is wrong though, and gives the location of the parent package > (the one it inherited from).  This seems to be made on purpose (?) > given the code in (gnu build-system python): I'm pretty sure that this is done so that `guix edit' points you to the package you want to edit rather than its wrapper. While thus incorrect, it is most often what you want. Also, the wrapper should be in its vicinity (usually the next package). > --8<---------------cut here---------------start------------->8--- > (package/inherit p >         (location (package-location p)) > >         ^ Here, we explicitly set the location to that of its parent. >         >         (name (let ((name (package-name p))) >                 (string-append new-prefix >                                (if (string-prefix? old-prefix name) >                                    (substring name >                                               (string-length old- > prefix)) >                                    name)))) >         (arguments >          (let ((python (if (promise? python) >                            (force python) >                            python))) >            (ensure-keyword-arguments (package-arguments p) >                                      `(#:python ,python))))) > --8<---------------cut here---------------end--------------->8--- > > Another related issue for package-with-python2 packages: > > --8<---------------cut here---------------start------------->8--- > > (package-definition-location-code $1) > $4 = #f > --8<---------------cut here---------------end--------------->8--- > > I was expecting to use this to get rid of all leaf Python 2 packages, > but it seems that may not work (as easily as I'd hoped). Note, that you can use guix graphs to detect leaves and then grep for the variable name. This still requires you to use Emacs for deleting some three lines rather than doing so programmatically. However, given that you have the location, you could try to filter out the variable name, then detect whether it's in a package-with-python2 call within the same file. Finally, you can try to just locally comment out that setter and it might return the "true" path. Note that I haven't tested this. Since you're probably using this for a more or less one-time script anyway, I wouldn't be too bothered about it being a dirty hack. Cheers :) From debbugs-submit-bounces@debbugs.gnu.org Mon May 02 16:57:55 2022 Received: (at 55139) by debbugs.gnu.org; 2 May 2022 20:57:55 +0000 Received: from localhost ([127.0.0.1]:38111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nld7C-0003ip-Nl for submit@debbugs.gnu.org; Mon, 02 May 2022 16:57:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nld7B-0003ia-FX for 55139@debbugs.gnu.org; Mon, 02 May 2022 16:57:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nld76-0005QN-49; Mon, 02 May 2022 16:57:48 -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=8u5Yeiy0kbK57DtNg/VbIyDnZeVoui2s2mHjc8TN9WA=; b=l8BghTcdY//D00QWCoVe B576IGpLD/qUnSzYelOJmUyXJnejIr6NpCDG98vSDUBS1D16Cm86nV+3Ql02Eb7oBwGeTxM00YtqC HbYNLhr0GCXL/mruoGp49SIbLovgtV+ZV2j2yT2ykYp6Sjc0KNVwC6fXAoApZDxhd74OC63xOxnjg 9UO4KfJacYUUOH1jiFK5ClfiYXx4ehJgJxcFIRSweFBaJUVXTrrlM8Ws9UqZU2V4NV8Nb/auFK0vi H7d0NmWLFt+b3G8B475q44cshP2EFRMHjeh8SrJYR3nQOUVnA/wd52AD76DS27HLxUcfysbDEMOcu bkg20j4CSSx1Wg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:57254 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nld75-0007uI-Mr; Mon, 02 May 2022 16:57:47 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#55139: package-location is wrong for transformed packages References: <8735hz2t4u.fsf@gmail.com> Date: Mon, 02 May 2022 22:57:45 +0200 In-Reply-To: <8735hz2t4u.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 26 Apr 2022 21:48:49 -0400") Message-ID: <87pmkvr6t2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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: 55139 Cc: 55139@debbugs.gnu.org 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 (---) Hi, Maxim Cournoyer skribis: >> ,import (gnu packages) (guix packages) >> (car (find-packages-by-name "python2-pyalsaaudio")) > $1 =3D # >> (package-definition-location-code package $1) > $2 =3D #f >> (package-definition-location $2) > $3 =3D #< file: "gnu/packages/audio.scm" line: 4327 column: 2> > > > This is wrong though, and gives the location of the parent package (the > one it inherited from). This seems to be made on purpose (?) given the > code in (gnu build-system python): > > (package/inherit p > (location (package-location p)) > > ^ Here, we explicitly set the location to that of its parent. Indeed, that=E2=80=99s on purpose; the rationale is that it=E2=80=99s more = useful to see the location of the original package (the Python=C2=A03 variant) than always this one line in gnu/build-system/python.scm. > Another related issue for package-with-python2 packages: > >> (package-definition-location-code $1) > $4 =3D #f Yes, I see it=E2=80=99s annoying, but that=E2=80=99s expected. > I was expecting to use this to get rid of all leaf Python 2 packages, > but it seems that may not work (as easily as I'd hoped). You were willing to have a script that would automatically delete the relevant lines, right? It=E2=80=99s kinda silly but I think the script will have to estimate the definition location by looking for =E2=80=9C(define-public python2-=E2=80= =A6=E2=80=9D. HTH, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun May 22 01:16:42 2022 Received: (at 55139) by debbugs.gnu.org; 22 May 2022 05:16:42 +0000 Received: from localhost ([127.0.0.1]:43461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsdxJ-0002os-P9 for submit@debbugs.gnu.org; Sun, 22 May 2022 01:16:42 -0400 Received: from mail-qt1-f179.google.com ([209.85.160.179]:44546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsdxH-0002hq-1g for 55139@debbugs.gnu.org; Sun, 22 May 2022 01:16:40 -0400 Received: by mail-qt1-f179.google.com with SMTP id b9so4419820qtx.11 for <55139@debbugs.gnu.org>; Sat, 21 May 2022 22:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=XBxAVvx7fb5YOksvBxdBO9sBKkDTXNul67OffdzqFMc=; b=jKSF8u+K1Y20uWdwgblyo7bbQZXhxfBAP5v8ERC6w7RoAfG9b/ogSsOT+DbbTwLb+a WgQu+OOEaaeOV6c8+gpD+2ppiGS4MZxVE5dKp8jr+TqYjyIbERyseRFmEULmG6v1ZL40 Kuk7qVgYsv10lTOV+Jn0HoT9ErvYo2Hdkf1XOdv6zFRx2tsvh021/oXgyCsD9geXvWvp NST1aPDMzxOZEtokiGs8tU2QUhRPFTbo3kfDeTv6l/91MkqzoZogxh9KVm1ObkHfMqTH SHEeX2Lk/40mmfYWumHa8xm09sPAGNgX7uNJ3KMozhEL5azuNbhJHKp5zl61Ohs18ZsV WmAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=XBxAVvx7fb5YOksvBxdBO9sBKkDTXNul67OffdzqFMc=; b=J82cfy64Zc+WMO1NY3Bke1c319a5Q7jengNnm+oOK4bgbBxnhmgNVWNlrjvr3fcNxG xP5+vKVcqWxgMmfUfwef1fT1ItjEMQ6rmE338GZ+/dR/5dqsV3ccJ0yqS49b4ZFxgiCb vtuw/7qskXtoMt3Twz8NvirXD/hKRhunD66TqEz2YYojLeBZ409WDaEjdb5QIviuBkeP Z3J59ttLux29giV4HhgXzDm639M+fMakIfehGDQW2WMjrqg52JJowlOFky/x0+nM7pL4 6Gb0v2S43aXAO2NqQRbzvpRg5UvEkwmqesyJ5wQ0wYmqFmnr4R9lbVhqXAEHNqjRhEog OKrA== X-Gm-Message-State: AOAM530bQfzZeIplLWQSXdPTPP4mUAi4RcHRVXZEsej+K4jew4VzDUzo S/+2BC2YnIYbIv6gEoWoal2QE7p7RcQX23QS X-Google-Smtp-Source: ABdhPJxVO0Lb2mY6FYd3LKNw7wLYXCaIjwx95UfTuciwiz/fwCN3lFzqhDaW0u0IEM+z0QI9dgfgRQ== X-Received: by 2002:ac8:5d92:0:b0:2f9:1f14:b6bc with SMTP id d18-20020ac85d92000000b002f91f14b6bcmr6572093qtx.383.1653196593344; Sat, 21 May 2022 22:16:33 -0700 (PDT) Received: from hurd (dsl-152-80.b2b2c.ca. [66.158.152.80]) by smtp.gmail.com with ESMTPSA id m11-20020a05620a24cb00b0069fc13ce23bsm1726430qkn.108.2022.05.21.22.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 22:16:32 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#55139: package-location is wrong for transformed packages References: <8735hz2t4u.fsf@gmail.com> <87pmkvr6t2.fsf@gnu.org> Date: Sun, 22 May 2022 01:16:32 -0400 In-Reply-To: <87pmkvr6t2.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 02 May 2022 22:57:45 +0200") Message-ID: <87v8ty5eq7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55139 Cc: 55139@debbugs.gnu.org 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, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >>> ,import (gnu packages) (guix packages) >>> (car (find-packages-by-name "python2-pyalsaaudio")) >> $1 =3D # >>> (package-definition-location-code package $1) >> $2 =3D #f >>> (package-definition-location $2) >> $3 =3D #< file: "gnu/packages/audio.scm" line: 4327 column: 2> >> >> >> This is wrong though, and gives the location of the parent package (the >> one it inherited from). This seems to be made on purpose (?) given the >> code in (gnu build-system python): >> >> (package/inherit p >> (location (package-location p)) >> >> ^ Here, we explicitly set the location to that of its parent. > > Indeed, that=E2=80=99s on purpose; the rationale is that it=E2=80=99s mor= e useful to see > the location of the original package (the Python=C2=A03 variant) than alw= ays > this one line in gnu/build-system/python.scm. > >> Another related issue for package-with-python2 packages: >> >>> (package-definition-location-code $1) >> $4 =3D #f > > Yes, I see it=E2=80=99s annoying, but that=E2=80=99s expected. > >> I was expecting to use this to get rid of all leaf Python 2 packages, >> but it seems that may not work (as easily as I'd hoped). > > You were willing to have a script that would automatically delete the > relevant lines, right? > > It=E2=80=99s kinda silly but I think the script will have to estimate the > definition location by looking for =E2=80=9C(define-public python2-=E2=80= =A6=E2=80=9D. Yeah, I ended up with this [0]: --8<---------------cut here---------------start------------->8--- (define (locate-package-via-git name) "Return the location object corresponding to package NAME, searched via g= it." (let* ((input-pipe (open-pipe* OPEN_READ "git" "grep" "-n" "--column" (format #f "^(define-public ~a$" name))) (output (get-string-all input-pipe)) ;file:line:column:match (exit-val (status:exit-val (close-pipe input-pipe)))) (case exit-val ((0) (let ((components (string-split output #\:))) (location (first components) ;file (string->number (second components)) ;1-indexed line ;; FIXME: Comment discrepancy in (guix diagnostics), which ;; says the column is 0-indexed. (and=3D> (string->number (third components)) 1-)))) ;0-indexed co= lumn ((1) #f) ;no match (else (error "git grep failed with status" exit-val))))) --8<---------------cut here---------------end--------------->8--- and it does feel silly to have to shell out to git, but it did the job. Thanks, Maxim [0] https://notabug.org/apteryx/guix-api-examples/src/master/purge-python2= -packages.scm#L42 From debbugs-submit-bounces@debbugs.gnu.org Mon May 23 09:28:19 2022 Received: (at 55139) by debbugs.gnu.org; 23 May 2022 13:28:19 +0000 Received: from localhost ([127.0.0.1]:47664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt86d-0007L2-FA for submit@debbugs.gnu.org; Mon, 23 May 2022 09:28:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt86c-0007Kp-EP for 55139@debbugs.gnu.org; Mon, 23 May 2022 09:28:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nt86X-0007NH-4G; Mon, 23 May 2022 09:28:13 -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=U8HbzI8kuvsqKwJcNmYfj+SeD3Z3kcjDWQLAozcCwUI=; b=LnoLoj229VXPzMJWB7rv UsypbfFQgOiJF9TiBVbFzGom9vvcQScnCq2GeYUX3zOv0xsf9rrTIwJ5WeamFdYG9rJUY30UO2O66 2VqDUN651C1R414daiQMZMi9L+hPaMqvp/dnpVupk3dkNsMtCDPWzVINXokZlQjvY9YbR2RJZVB9L M+zSeYJhrNI61sz0xqpFRvkBqnugSnua38oUXiUomop+kaepy+TH8YiaIig1nGMDBa8a+qGzfwV8E +wHBHJq86RGWC3e09a4So8Nex99V86YtW1lWM6LifkqETdWFmepVKkqwW+5S2Xgsa6pv1KfIJXOKF xOQWVUrGoQVCog==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=40516 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nt86W-0004Fi-NY; Mon, 23 May 2022 09:28:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#55139: package-location is wrong for transformed packages References: <8735hz2t4u.fsf@gmail.com> <87pmkvr6t2.fsf@gnu.org> <87v8ty5eq7.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Prairial an 230 de la =?utf-8?Q?R=C3=A9volution?= 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, 23 May 2022 15:28:10 +0200 In-Reply-To: <87v8ty5eq7.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 22 May 2022 01:16:32 -0400") Message-ID: <87czg47505.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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: 55139 Cc: 55139@debbugs.gnu.org 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 (---) Hi! Maxim Cournoyer skribis: > Yeah, I ended up with this [0]: > > (define (locate-package-via-git name) > "Return the location object corresponding to package NAME, searched via= git." > (let* ((input-pipe (open-pipe* OPEN_READ > "git" "grep" "-n" "--column" > (format #f "^(define-public ~a$" name))) > (output (get-string-all input-pipe)) ;file:line:column:match > (exit-val (status:exit-val (close-pipe input-pipe)))) > (case exit-val > ((0) > (let ((components (string-split output #\:))) > (location > (first components) ;file > (string->number (second components)) ;1-indexed line > ;; FIXME: Comment discrepancy in (guix diagnostics), which > ;; says the column is 0-indexed. > (and=3D> (string->number (third components)) 1-)))) ;0-indexed = column > ((1) #f) ;no match > (else (error "git grep failed with status" exit-val))))) > > and it does feel silly to have to shell out to git, but it did the job. > > Thanks, > > Maxim > > [0] https://notabug.org/apteryx/guix-api-examples/src/master/purge-pytho= n2-packages.scm#L42 Nice, it=E2=80=99s good to have these examples=E2=80=94and hopefully we=E2= =80=99ll soon be able to remove a whole bunch of =E2=80=98python2-=E2=80=99 packages! As for =E2=80=98package-definition-location=E2=80=99, I don=E2=80=99t think= we can reasonably do any better, so I=E2=80=99m tempted to close the bug. WDYT? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 08 17:29:17 2022 Received: (at 55139-done) by debbugs.gnu.org; 8 Jun 2022 21:29:17 +0000 Received: from localhost ([127.0.0.1]:44447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nz3Er-0001wX-Ke for submit@debbugs.gnu.org; Wed, 08 Jun 2022 17:29:17 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:44814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nz3Eq-0001wJ-G5 for 55139-done@debbugs.gnu.org; Wed, 08 Jun 2022 17:29:17 -0400 Received: by mail-qt1-f174.google.com with SMTP id t21so8862254qtw.11 for <55139-done@debbugs.gnu.org>; Wed, 08 Jun 2022 14:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Ax/kF/qZFB5H1TFLrbX6LNfevskd0akVn4SpfdEwskE=; b=eAwrnOiK4nPCgBQzmXYc+mrRhlABsTczl6KilzMGLxikUragOuNRkoyaro2akO19x8 VohlQ/6t1sw9tR/tTOe6FpFE8sO4r9sas/EnV/PDHJHQvuL3myJ/qL6HdqVdaqYg85wl kxi0paYrwFyWsOoadkVvEfRmskTapBEll6442SRvbT3cFuHKBz9Pov3emLVzG0RnwiKC /9KEtv/R4V7DUaZcz+wIGcephx2Fl/PUQNow6f5TGa3O/+UKOkvDHX0kISUaKnlL9AFJ n813YEGVtLnV+kmgxzOtENRsBOGvUHkRL/YGBqEnWOA/BgoSx/j9eDYCRJlOUQhf6U65 Lrkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Ax/kF/qZFB5H1TFLrbX6LNfevskd0akVn4SpfdEwskE=; b=XG9vuGe77ZiyBRjNvU5Odm7ZmLOl1LFjj/MlNSJyVRpvI/GlgEa2txyW+O4xiusaD7 f3tFPb8FPnTAtFs4NuO04H7aJhbyq5PcBx44z6HkNgEC4Rv7sK02/aGOQAY/FQSc5b4g k1uBlZ11+cwwi5IAUk/JYHaWgzJZBN/W5Wq7AfsAcTQf15JtB1KkjSOuBNomEe8r/9rb jq45/y0IHFMlqBbRPcWXDv4+Oc8TLln8ylaEtoqXYQVHddohzjHU6zee/vp+I0lWmaVc 2bA2MxegAfEcaFHXlJz8ZXsq9xWsy5cLRsQTlG+HK1tt8KDOvyrHXKvy0x8m8BQJas4x addA== X-Gm-Message-State: AOAM533+4/UHoX39gcC8UTLRH2d8EDblW9VP7XymVwTMsIDAkfKdp3CD 2ld23PXMNvyzZKTr/2roWL/CPteqoIwNg/ar X-Google-Smtp-Source: ABdhPJwcwaYgllj66SJXh/y0B6o+us224KWNjKU7FHdrlzonF/1hhpel8zLbWQaOEWwFuNSWFcwN+Q== X-Received: by 2002:a05:622a:310:b0:2f3:da5f:337a with SMTP id q16-20020a05622a031000b002f3da5f337amr30030565qtw.562.1654723750264; Wed, 08 Jun 2022 14:29:10 -0700 (PDT) Received: from hurd (dsl-151-172.b2b2c.ca. [66.158.151.172]) by smtp.gmail.com with ESMTPSA id z19-20020ac87f93000000b002f936bae288sm16400191qtj.87.2022.06.08.14.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 14:29:09 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#55139: package-location is wrong for transformed packages References: <8735hz2t4u.fsf@gmail.com> <87pmkvr6t2.fsf@gnu.org> <87v8ty5eq7.fsf@gmail.com> <87czg47505.fsf@gnu.org> Date: Wed, 08 Jun 2022 17:29:08 -0400 In-Reply-To: <87czg47505.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 23 May 2022 15:28:10 +0200") Message-ID: <87tu8uj13v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55139-done Cc: 55139-done@debbugs.gnu.org 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 Ludovic, Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >> Yeah, I ended up with this [0]: >> >> (define (locate-package-via-git name) >> "Return the location object corresponding to package NAME, searched vi= a git." >> (let* ((input-pipe (open-pipe* OPEN_READ >> "git" "grep" "-n" "--column" >> (format #f "^(define-public ~a$" name))) >> (output (get-string-all input-pipe)) ;file:line:column:match >> (exit-val (status:exit-val (close-pipe input-pipe)))) >> (case exit-val >> ((0) >> (let ((components (string-split output #\:))) >> (location >> (first components) ;file >> (string->number (second components)) ;1-indexed line >> ;; FIXME: Comment discrepancy in (guix diagnostics), which >> ;; says the column is 0-indexed. >> (and=3D> (string->number (third components)) 1-)))) ;0-indexed= column >> ((1) #f) ;no match >> (else (error "git grep failed with status" exit-val))))) >> >> and it does feel silly to have to shell out to git, but it did the job. >> >> Thanks, >> >> Maxim >> >> [0] https://notabug.org/apteryx/guix-api-examples/src/master/purge-pyth= on2-packages.scm#L42 > > Nice, it=E2=80=99s good to have these examples=E2=80=94and hopefully we= =E2=80=99ll soon be able > to remove a whole bunch of =E2=80=98python2-=E2=80=99 packages! > > As for =E2=80=98package-definition-location=E2=80=99, I don=E2=80=99t thi= nk we can reasonably do > any better, so I=E2=80=99m tempted to close the bug. OK; thanks for your input. At least it'll be recorded somewhere for the next person stumbling on this behavior to discover. Maxim From unknown Sun Aug 10 16:46:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Jul 2022 11:24:07 +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