GNU bug report logs - #54393
[PATCH 0/2] Add 'guix manifest' to "translate" commands to manifests

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Mon, 14 Mar 2022 21:51:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#54393: closed ([PATCH 0/2] Add 'guix manifest' to "translate"
 commands to manifests)
Date: Mon, 04 Apr 2022 21:17:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 04 Apr 2022 23:16:13 +0200
with message-id <87zgl0r1lu.fsf_-_ <at> gnu.org>
and subject line Re: bug#54393: [PATCH 0/2] Add 'guix manifest' to "translate" commands to manifests
has caused the debbugs.gnu.org bug report #54393,
regarding [PATCH 0/2] Add 'guix manifest' to "translate" commands to manifests
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
54393: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=54393
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/2] Add 'guix manifest' to "translate" commands to manifests
Date: Mon, 14 Mar 2022 22:50:15 +0100
Hello Guix!

Writing manifests can be intimidating: in part because it’s not
well documented, and in part because it’s always hard to start from
a blank page.

We have ‘guix package --export-manifest’ to help with that, but I
realized that colleagues of mine often use ‘guix shell’ more than
‘guix package’, and ‘--export-manifest’ is awkward to use:

  $ guix shell a b c d --transform=whatever=else
  [env]$ guix package --export-manifest -p $GUIX_ENVIRONMENT

I figured that instead of documenting this, we might as well provide
a command that does it in one go:

  guix manifest a b c d --transform=whatever=else > manifest.scm

Voilà!

Thoughts?

Next up: adding a “Writing Manifests” section.

Ludo’.

Ludovic Courtès (2):
  packages: Add 'package-unique-version-prefix'.
  Add 'guix manifest'.

 Makefile.am               |   2 +
 doc/guix.texi             | 146 +++++++++++++++++++++++++++++++-
 gnu/packages.scm          |  21 +++++
 guix/scripts/manifest.scm | 174 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/package.scm  |  20 +----
 po/guix/POTFILES.in       |   1 +
 tests/guix-manifest.sh    |  76 +++++++++++++++++
 tests/packages.scm        |  13 +++
 8 files changed, 434 insertions(+), 19 deletions(-)
 create mode 100644 guix/scripts/manifest.scm
 create mode 100644 tests/guix-manifest.sh


base-commit: 857e5ab22292fe7c2ba5b9855c0829a2ef942d38
-- 
2.34.0



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 54393-done <at> debbugs.gnu.org
Subject: Re: bug#54393: [PATCH 0/2] Add 'guix manifest' to "translate"
 commands to manifests
Date: Mon, 04 Apr 2022 23:16:13 +0200
Hi!

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:


[...]

>> +(define (manifest->code* manifest extra-manifests)
>> +  "Like 'manifest->code', but insert a 'concatenate-manifests' call that
>> +concatenates MANIFESTS, a list of expressions."
>> +  (if (null? (manifest-entries manifest))
>> +      (match extra-manifests
>> +        ((one) one)
>> +        (lst   `(concatenate-manifests ,@extra-manifests)))
>> +      (match (manifest->code manifest
>> +                             #:entry-package-version
>> +                             manifest-entry-version-prefix)
>> +        (('begin exp ... last)
>> +         `(begin
>> +            ,@exp
>> +            ,(match extra-manifests
>> +               (() last)
>> +               (_  `(concatenate-manifests
>> +                     (list ,last ,@extra-manifests)))))))))
>
> Should an "else" clause be added here with a more useful error message
> that the default 'no match for x' or similar?  If that'd be totally
> unexpected and a bug, then it's fine as-is.

Yes, it would be a bug.

>> +  (define (validated-spec spec)
>> +    ;; Return SPEC if it's validate package spec.
>
> As this is an action (proc), perhaps it should be named "validate-spec".
> The comment doc should also be worded as "if SPEC is a valid package
> spec" or similar.

I fixed the comment but kept the name ‘validated-spec’, which is an
attempt at suggesting that it’s returns a meaningful value (whereas
‘validate-spec’ sounds like it’s called for effect and returns
*unspecified*).

> Thank you for addressing the suggestion to reuse an existing sub-command
> to try to keep things neatly organized instead of extending the already
> large set of them :-).

Heheh, thanks!

Pushed as b1e7e64f351fa03a66ce1f9776f9ba84cf2c6294 together with a news
entry.

Ludo’.


This bug report was last modified 3 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.