Subject: bug#34948: closed (Re: [PATCH 3/3] system: Add 'essential-services' field to <operating-system>.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 25 Mar 2019 23:03:02 +0000

Your bug report

#34948: [PATCH 0/3] Turn 'essential-services' into an <operating-system> field

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
34948: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34948
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH 3/3] system: Add 'essential-services' field to <operating-system>.
From: Ludovic Courtès <[email-masked]>
To: Arun Isaac <[email-masked]>
Cc: [email-masked]
Date: Tue, 26 Mar 2019 00:02:31 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Arun!

Arun Isaac <[email-masked]> skribis:

> This neatly gets rid of all the #:container? arguments. That's very
> nice! :-) I haven't actually built and tested these patches, but these
> LGTM. Just one minor observation below.
>
>> +  (cons (service system-service-type
>> +                 (let ((locale (operating-system-locale-directory os)))
>> +                   (with-monad %store-monad
>> +                     (return `(("locale" ,locale))))))
>> +        (append base (list %containerized-shepherd-service))))
>
> Why not rewrite this using just a call to append, that is remove the
> call to cons? Like so:

No, IIRC ‘system-service-type’ should be the first in the list (?), but
also I find it more pleasant to the eye than an unbalanced ‘append’
call.  :-)

Thanks for your feedback, I’ve pushed it now:

  69cae3d335 system: Add 'essential-services' field to <operating-system>.
  cf848cc0a1 accounts: Add default value for the 'home-directory' field of <user-account>.
  abd4d6b33d records: Allow thunked fields to refer to 'this-record'.

I hope that’ll help address your container use case!

Ludo’.

Subject: [PATCH 0/3] Turn 'essential-services' into an <operating-system> field
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Arun Isaac <[email-masked]>,Ludovic Courtès <[email-masked]>
Date: Fri, 22 Mar 2019 18:21:20 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix!

This is the solution that Arun and I were discussing:

  https://issues.guix.info/issue/28128#17

This series adds support for “self-referential records”: from
the definition of a thunked field, you can use ‘this-record’
to access the record that the field belongs to.

It then uses that to turn ‘essential-services’ into a thunked
field of <operating-system> rather than an inaccessible internal
procedure.

This allows us to remove all the #:container? flags from
(gnu system) and instead of (gnu system linux-container) simply
override ‘essential-services’ as needed.

Thoughts?

Thanks,
Ludo’.

Ludovic Courtès (3):
  records: Allow thunked fields to refer to 'this-record'.
  accounts: Add default value for the 'home-directory' field of
    <user-account>.
  system: Add 'essential-services' field to <operating-system>.

 doc/guix.texi                                |  8 ++-
 gnu/system.scm                               | 71 +++++++++-----------
 gnu/system/accounts.scm                      |  7 +-
 gnu/system/examples/bare-bones.tmpl          |  3 +-
 gnu/system/examples/beaglebone-black.tmpl    |  3 +-
 gnu/system/examples/desktop.tmpl             |  3 +-
 gnu/system/examples/docker-image.tmpl        |  3 +-
 gnu/system/examples/lightweight-desktop.tmpl |  3 +-
 gnu/system/install.scm                       |  3 +-
 gnu/system/linux-container.scm               | 69 ++++++++++++-------
 gnu/system/vm.scm                            | 13 ++--
 gnu/tests.scm                                |  5 +-
 gnu/tests/install.scm                        | 14 ++--
 guix/records.scm                             | 24 ++++++-
 tests/accounts.scm                           |  4 --
 tests/records.scm                            | 40 +++++++++++
 16 files changed, 169 insertions(+), 104 deletions(-)

-- 
2.21.0