* guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument alternative. --- guix/scripts/size.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 2446b84587..c42f4f7782 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -230,8 +230,8 @@ the name of a PNG file." ;;; (define (show-help) - (display (G_ "Usage: guix size [OPTION]... PACKAGE -Report the size of PACKAGE and its dependencies.\n")) + (display (G_ "Usage: guix size [OPTION]... PACKAGE|STORE-ITEM +Report the size of the PACKAGE or STORE-ITEM, with its dependencies.\n")) (display (G_ " --substitute-urls=URLS fetch substitute from URLS if they are authorized")) -- 2.26.2
* doc/guix.texi (Invoking `guix size'): Add guix size example for store item. --- doc/guix.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 4dbbf96db9..0c4067b52e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10110,6 +10110,13 @@ libraries. (That libc and GCC's libraries represent a large fraction of the closure is not a problem @i{per se} because they are always available on the system anyway.) +Since the command also accepts store file names, assessing the size of +a build result is straightforward: + +@example +guix size $(guix system build config.scm) +@end example + When the package(s) passed to @command{guix size} are available in the store@footnote{More precisely, @command{guix size} looks for the @emph{ungrafted} variant of the given package(s), as returned by -- 2.26.2
Hi, Pierre Neidhardt <mail@ambrevar.xyz> skribis: > * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument > alternative. [...] > * doc/guix.texi (Invoking `guix size'): Add guix size example for store item. [...] > +@example > +guix size $(guix system build config.scm) Please use backquotes instead of $(…), which is Bash-specific. Otherwise LGTM, thank you! Ludo’.
[-- Attachment #1: Type: text/plain, Size: 680 bytes --] Ludovic Courtès <ludo@gnu.org> writes: > Hi, > > Pierre Neidhardt <mail@ambrevar.xyz> skribis: > >> * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument >> alternative. > > [...] > >> * doc/guix.texi (Invoking `guix size'): Add guix size example for store item. > > [...] > >> +@example >> +guix size $(guix system build config.scm) > > Please use backquotes instead of $(…), which is Bash-specific. Actually, it's not, $(...) is POSIX (you can test with Dash). Backquotes are deprecated and have the downside of not nesting. > Otherwise LGTM, thank you! OK to merge, then? -- Pierre Neidhardt https://ambrevar.xyz/ [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --]
Dear, On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote: > >> +@example > >> +guix size $(guix system build config.scm) > > > > Please use backquotes instead of $(…), which is Bash-specific. > > Actually, it's not, $(...) is POSIX (you can test with Dash). > Backquotes are deprecated and have the downside of not nesting. Yes, $(...) is POSIX, AFAIK. And let quote what POSIX says: "Because of these inconsistent behaviors, the backquoted variety of command substitution is not recommended for new applications that nest command substitutions or attempt to embed complex scripts." https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 (I do not know if it is the latest version of the document.) Well, $(...) is already used in the manual. For example, X11 fonts section because of nested. But elsewhere not, see e.g., invoking guix archive or Nteworking Services or Invoking guix system sections. https://guix.gnu.org/manual/devel/en/guix.html#X11-Fonts https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-archive https://guix.gnu.org/manual/devel/en/guix.html#Networking-Services https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-system Therefore, only one should be used. And $(...) is better. So I would be in favour to replace all the backquotes by $(...) in the manual. All the best, simon
Hi,
zimoun <zimon.toutoune@gmail.com> skribis:
> On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
>> >> +@example
>> >> +guix size $(guix system build config.scm)
>> >
>> > Please use backquotes instead of $(…), which is Bash-specific.
>>
>> Actually, it's not, $(...) is POSIX (you can test with Dash).
>> Backquotes are deprecated and have the downside of not nesting.
>
> Yes, $(...) is POSIX, AFAIK.
> And let quote what POSIX says: "Because of these inconsistent
> behaviors, the backquoted variety of command substitution is not
> recommended for new applications that nest command substitutions or
> attempt to embed complex scripts."
>
> https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03
I stand corrected! That’s news to me, but definitely good news.
I’m all for using $(…) from now on.
Thank you!
Ludo’.
[-- Attachment #1: Type: text/plain, Size: 54 bytes --] Merged with 776409c5069de949da328b769132fa009477668c. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --]