Message ID | cf9713d087089126b1f8b9102cb8f37a879fa6fd.camel@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C10B127BBEA; Fri, 18 Mar 2022 19:37:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, PP_MIME_FAKE_ASCII_TEXT,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 21F2627BBE9 for <patchwork@mira.cbaines.net>; Fri, 18 Mar 2022 19:37:13 +0000 (GMT) Received: from localhost ([::1]:51648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1nVIPQ-00071S-8O for patchwork@mira.cbaines.net; Fri, 18 Mar 2022 15:37:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nVIPG-0006zW-6U for guix-patches@gnu.org; Fri, 18 Mar 2022 15:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nVIPF-0004rk-Tr for guix-patches@gnu.org; Fri, 18 Mar 2022 15:37:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nVIPF-0000li-SC for guix-patches@gnu.org; Fri, 18 Mar 2022 15:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54454] [PATCH] ui: Describe package outputs. Resent-From: Liliana Marie Prikler <liliana.prikler@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Mar 2022 19:37:01 +0000 Resent-Message-ID: <handler.54454.B.16476321642865@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54454 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54454@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16476321642865 (code B ref -1); Fri, 18 Mar 2022 19:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2022 19:36:04 +0000 Received: from localhost ([127.0.0.1]:58431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1nVIOK-0000k8-2W for submit@debbugs.gnu.org; Fri, 18 Mar 2022 15:36:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:56364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@gmail.com>) id 1nVIOI-0000jx-CT for submit@debbugs.gnu.org; Fri, 18 Mar 2022 15:36:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <liliana.prikler@gmail.com>) id 1nVIOI-0006Kd-6i for guix-patches@gnu.org; Fri, 18 Mar 2022 15:36:02 -0400 Received: from [2a00:1450:4864:20::642] (port=46682 helo=mail-ej1-x642.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <liliana.prikler@gmail.com>) id 1nVIOG-0004hz-IC for guix-patches@gnu.org; Fri, 18 Mar 2022 15:36:01 -0400 Received: by mail-ej1-x642.google.com with SMTP id qx21so18850621ejb.13 for <guix-patches@gnu.org>; Fri, 18 Mar 2022 12:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:content-transfer-encoding:message-id :mime-version; bh=V8dXs04r7IlkuLNSf0Fx5Ljt2kgAGdJguY4DnUtJ/b8=; b=JmDLen5f0WqXrPDhGfb4ydsnde4moN7MWA6YbcVeNizmqKhcP0EchMp8Y1eeI9oC2E VLzn4b5i06bEpdO/L7wJbAIXHJmJASdQt2gPaxQfU68V15A4ZdfeX6b7RUcM+nbZr8Py we5YrqTUT9OT0o9LIFH7TyFvK87Px3fx3beGDtakvXut7oQi7Mqhm0AKZetw3e7cUuk7 b4bM+DzKWihnmNMLGfJoMXY36RpGowbmw/E8o7bDx1w0WaZ5Xx+eJy4Qlmpqhoj/sg1v oeQLkxHwCrXj18+gfj+xB2SwYjmDueB3zl0+4bDHNavD61maJ1Z04NxN+JQIxSNjMDoq Gqgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:content-transfer-encoding :message-id:mime-version; bh=V8dXs04r7IlkuLNSf0Fx5Ljt2kgAGdJguY4DnUtJ/b8=; b=GNWQXfGIQWjJy5NU9wGIHlzMnnAEFFeSeZJGJcIDgWnQCUv0p3e3GoQmvg6/aLZmXd l1Xw0I4WBrR39F6sKzxIJY4tuamj5+o84EWWu4/RhrqeMju7CykPQxDfXnK0IvPWn6da haba4ZkLNXjDgYtaEhCq6BMH5ASVa9eUjCSiNt0uV1bWrhnJDnTq7D0OT+SwlPar04XF ombrsDQmd+EPjLHX5XRR53HoBNxXboD6kToYfJyp++h+nLhOxF5WrVIgTwxWeH5rjQlt 70rt1oymdV6LzdhglXtdYfcucv1hYeKevE8hw9B9KEd7SyN/0Dr5gXWup43KdawQGeOY dbBQ== X-Gm-Message-State: AOAM532ch0niS3h3+xSUv4rpAWhCbT1I9ATAletWIQvn7MyYG3yYxJMU f+78kIvqisYzmOuQp+ZHb8dzAtEClE8= X-Google-Smtp-Source: ABdhPJz4s0U3OrSduIS0MbJDQ5m1/31eejUDpByVxj1kC9XVSeruoZvO4vC1HUwp9bpHoHk61XYNwQ== X-Received: by 2002:a17:906:26da:b0:6d6:da2e:d338 with SMTP id u26-20020a17090626da00b006d6da2ed338mr10306019ejc.700.1647632158503; Fri, 18 Mar 2022 12:35:58 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d7-20020a50cd47000000b004187eacb4d6sm4544514edj.37.2022.03.18.12.35.57 for <guix-patches@gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Mar 2022 12:35:58 -0700 (PDT) From: Liliana Marie Prikler <liliana.prikler@gmail.com> Date: Fri, 18 Mar 2022 20:16:39 +0100 Content-Transfer-Encoding: 8bit Message-ID: <cf9713d087089126b1f8b9102cb8f37a879fa6fd.camel@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::642 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::642; envelope-from=liliana.prikler@gmail.com; helo=mail-ej1-x642.google.com X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 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, PDS_HP_HELO_NORDNS=0.659, PP_MIME_FAKE_ASCII_TEXT=0.999, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#54454] ui: Describe package outputs.
|
|
Commit Message
Liliana Marie Prikler
March 18, 2022, 7:16 p.m. UTC
* guix/ui.scm (package->recutils): Output outputs with their descriptions, one per line. --- Salut Guix, People have been complaining for a while, that outputs are not really discoverable [who?]. This patch attempts to fix that by displaying each on their own line with a (hopefully) helpful description next to it. It is expected, that these descriptions do not span multiple lines. Cheers guix/ui.scm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
Comments
Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]: > + (assoc-ref `(("bin" . ,(G_ "executable programs and scripts.")) > + ("debug" . ,(G_ "debug information.")) > + ("lib" . ,(G_ "shared libraries.")) > + ("static" . ,(G_ "static libraries.")) > + ("out" . ,(G_ "everything else."))) Some other outputs in the wild: "python", "utils", "xpi", "firefox", "chromium", "gui", "doc", "drill", "examples", "pyldns", "nm", "gtk2", "gtk3", "gtk4", "module", "src", "woff2", "headless", "installer", "jdk", "qt", "tester", "pulseaudio", "jack", "image", "opt-viewer", "examples", "metis", "cargo". Greetings, Maxime.
Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]:
> + (G_ "state secrets.")))))
Wouldn't this require #:substitutable? #false?
It's punny but rather inaccurate ...
WDYT of adding a package property to allow packages to document unusual
outputs?
Greetings,
Maxime.
Am Freitag, dem 18.03.2022 um 21:12 +0100 schrieb Maxime Devos: > Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]: > > + (assoc-ref `(("bin" . ,(G_ "executable programs and > > scripts.")) > > + ("debug" . ,(G_ "debug information.")) > > + ("lib" . ,(G_ "shared libraries.")) > > + ("static" . ,(G_ "static libraries.")) > > + ("out" . ,(G_ "everything else."))) > > Some other outputs in the wild: "python", "utils", "xpi", "firefox", > "chromium", "gui", "doc", "drill", "examples", "pyldns", "nm", > "gtk2", > "gtk3", "gtk4", "module", "src", "woff2", "headless", "installer", > "jdk", "qt", "tester", "pulseaudio", "jack", "image", "opt-viewer", > "examples", "metis", "cargo". Oh, right, I just put in the most common ones. Of the ones you cite, "doc", "examples", "gui", "src" "utils", and perhaps "cargo" make sense if defined like this, the others appear rather specific. "python" in particular sounds like it might have multiple meanings. Cheers
Am Freitag, dem 18.03.2022 um 21:16 +0100 schrieb Maxime Devos: > Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]: > > + (G_ "state secrets."))))) > > Wouldn't this require #:substitutable? #false? > It's punny but rather inaccurate ... You can substitute state secrets, but they will be marked to see who leaked them. It's not like all of our outputs are 100% reproducible, are they? :P > WDYT of adding a package property to allow packages to document > unusual outputs? That is literally the first thing I'm doing. It is unimaginatively called 'output-descriptions and checked before either of the fallbacks. Cheers
Liliana Marie Prikler schreef op vr 18-03-2022 om 21:25 [+0100]: > > WDYT of adding a package property to allow packages to document > > unusual outputs? > That is literally the first thing I'm doing. It is unimaginatively > called 'output-descriptions and checked before either of the > fallbacks. Indeed, I overlooked that. That seems like something that needs to be documented though (maybe in ‘package Reference’ or ‘Packages with Multiple Outputs’, perhaps complemented by a linter that checks that outputs without fallbacks are described in 'output-descriptions'). Greetings, Maxime.
Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]:
> + (let ((descs (assq-ref (package-properties package) 'output-descriptions)))
Should the descriptions be thunked, in case the package modules
are loaded before the locale is set, or if the locale changes during
execution? E.g., guix-data-service often changes locales, e.g. in
<https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/model/package-metadata.scm?id=8ab72e633ae700fe58bb3bf72aa155d62c2bc22e#n234>.
I don't know if old processes are reused or new processes are created,
but I'd assume the former.
Greetings,
Maxime.
Am Freitag, dem 18.03.2022 um 21:54 +0100 schrieb Maxime Devos: > Liliana Marie Prikler schreef op vr 18-03-2022 om 20:16 [+0100]: > > + (let ((descs (assq-ref (package-properties package) 'output- > > descriptions))) > > Should the descriptions be thunked, in case the package modules > are loaded before the locale is set, or if the locale changes during > execution? E.g., guix-data-service often changes locales, e.g. in > < > https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/model/package-metadata.scm?id=8ab72e633ae700fe58bb3bf72aa155d62c2bc22e#n234 > >. > I don't know if old processes are reused or new processes are > created, but I'd assume the former. Hmm, that's an interesting question. For what it's worth neither synopsis nor description seem thunked and those are also localized, so I don't think it'd be an issue. Cheers
Liliana Marie Prikler schreef op vr 18-03-2022 om 23:24 [+0100]: > Hmm, that's an interesting question. For what it's worth neither > synopsis nor description seem thunked and those are also localized, so > I don't think it'd be an issue. Those work differently -- they don't use G_ or P_, instead the localisation is delayed to 'package-field-string' and 'package->recutils'.
Am Freitag, dem 18.03.2022 um 23:57 +0100 schrieb Maxime Devos: > Liliana Marie Prikler schreef op vr 18-03-2022 om 23:24 [+0100]: > > Hmm, that's an interesting question. For what it's worth neither > > synopsis nor description seem thunked and those are also localized, > > so > > I don't think it'd be an issue. > > Those work differently -- they don't use G_ or P_, instead the > localisation is delayed to 'package-field-string' and > 'package->recutils'. IOW we'd have to wrap (assoc-ref descs output) in an (and=> <> P_)?
Liliana Marie Prikler schreef op za 19-03-2022 om 00:27 [+0100]:
> IOW we'd have to wrap (assoc-ref descs output) in an (and=> <> P_)?
I don't think that's sufficient, somehow the strings need to end up in
the .po files. IIRC, there's some magic somewhere to add package
descriptions to the .po files even when they aren't wrapped in
(P_ "foo"), but I cannot locate it anywmore.
I was more thinking of:
(package
[...]
(properties
`((output-descriptions
. ,(lambda () ("foo" . ,(G_ "Bar")) ...)))))
though bringing the magic used for package descriptions to
output descriptions would be tidier.
Greetings,
Maxime.
Hi, Maxime Devos <maximedevos@telenet.be> skribis: > I was more thinking of: > > (package > [...] > (properties > `((output-descriptions > . ,(lambda () ("foo" . ,(G_ "Bar")) ...))))) > > though bringing the magic used for package descriptions to > output descriptions would be tidier. Rather: (properties '((output-descriptions ("send-email" (synopsis "send email!"))))) That is, instead of calling ‘G_’, you just use one of the keywords xgettext recognizes (see ‘po/packages/Makevars’). The actual call to ‘gettext’ would then be made in (guix ui). I wonder if we’re going overboard though? Ludo’.
On Fri, Mar 18, 2022 at 08:16:39PM +0100, Liliana Marie Prikler wrote: > * guix/ui.scm (package->recutils): Output outputs with their descriptions, > one per line. > --- > Salut Guix, > > People have been complaining for a while, that outputs are not really > discoverable [who?]. This patch attempts to fix that by displaying each > on their own line with a (hopefully) helpful description next to it. > It is expected, that these descriptions do not span multiple lines. Excellent, thank you for stepping up to work on this!
diff --git a/guix/ui.scm b/guix/ui.scm index 6c194eb3c9..dfa90126bc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com> +;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1543,13 +1544,33 @@ (define (dependencies->recutils packages) (sort packages package<?))) " "))) (split-lines list (string-length "dependencies: ")))) + (define (output->recutils package output) + (let ((descs (assq-ref (package-properties package) 'output-descriptions))) + (string-append + "+ " output ": " + (or + (assoc-ref descs output) + (assoc-ref `(("bin" . ,(G_ "executable programs and scripts.")) + ("debug" . ,(G_ "debug information.")) + ("lib" . ,(G_ "shared libraries.")) + ("static" . ,(G_ "static libraries.")) + ("out" . ,(G_ "everything else."))) + output) + (G_ "state secrets."))))) + + (define (package-outputs/out-last package) + ((compose append partition) + (negate (cut string=? "out" <>)) + (package-outputs package))) + (define (package<? p1 p2) (string<? (package-full-name p1) (package-full-name p2))) ;; Note: Don't i18n field names so that people can post-process it. (format port "name: ~a~%" (package-name p)) (format port "version: ~a~%" (package-version p)) - (format port "outputs: ~a~%" (string-join (package-outputs p))) + (format port "outputs:~%~{~a~%~}" + (map (cut output->recutils p <>) (package-outputs/out-last p))) (format port "systems: ~a~%" (split-lines (string-join (package-transitive-supported-systems p)) (string-length "systems: ")))