guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#35692] [PATCH] system: vm: Auto-detect if inputs should be register


From: Ludovic Courtès
Subject: [bug#35692] [PATCH] system: vm: Auto-detect if inputs should be registered.
Date: Sun, 12 May 2019 23:31:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hi Maxim,

Maxim Cournoyer <address@hidden> skribis:

> The argument REGISTER-CLOSURE? of the SYSTEM-DOCKER-IMAGE procedure can be
> removed and its value computed automatically, since the operating-system
> definition is available in its context.  When the operating-system definition
> does not contain the GUIX-SERVICE-TYPE, do not register the closure in the
> database of Guix, as it takes time and doesn't serve a purpose.

That’s clever!

> The time saving is close to 2 minutes on my machine for every test using
> a very minimal OS configuration and building it with `guix system
> docker-image my-config.scm'.

Neat.

>>From 59d78c066727d5c3df22a6e269025ae7e058b45c Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <address@hidden>
> Date: Tue, 16 Apr 2019 17:15:02 -0400
> Subject: [PATCH] system: vm: Auto-detect if inputs should be registered.
                   ^
I’d just write “vm:” here.

> The argument REGISTER-CLOSURE? of the SYSTEM-DOCKER-IMAGE procedure can be
> removed and its value computed automatically, since the operating-system
> definition is available in its context.  When the operating-system definition
> does not contain the GUIX-SERVICE-TYPE, do not register the closure in the
> database of Guix, as it takes time and doesn't serve a purpose.
>
> * gnu/system/vm.scm (use-modules): Add (gnu services base).

Nitpick: We don’t usually document ‘use-modules’ changes here.

> (system-docker-image): Remove the REGISTER-CLOSURES? argument, as well as its
> associate documentation in the docstring.
> [has-guix-service-type?] Add predicate and use it to compute the value of the
> REGISTER-CLOSURE? argument of the INITIALIZE procedure.

> +(define (has-guix-service-type? os)
> +  (find (lambda (service)
> +       (eq? (service-kind service) guix-service-type))
> +        (operating-system-services os)))

Please add a docstring and make sure there are not tabs.  :-)

Otherwise LGTM, thank you!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]