From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:54953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPw5S-0004Zo-Rl for guix-patches@gnu.org; Sun, 12 May 2019 17:32:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPw4f-0004tn-TC for guix-patches@gnu.org; Sun, 12 May 2019 17:32:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPw4f-0004su-PS for guix-patches@gnu.org; Sun, 12 May 2019 17:32:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPw4f-0006up-L5 for guix-patches@gnu.org; Sun, 12 May 2019 17:32:01 -0400 Subject: [bug#35692] [PATCH] system: vm: Auto-detect if inputs should be registered. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87d0kov6kx.fsf@gmail.com> Date: Sun, 12 May 2019 23:31:21 +0200 In-Reply-To: <87d0kov6kx.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 11 May 2019 20:50:54 -0400") Message-ID: <87a7frtl5i.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Maxim Cournoyer Cc: 35692@debbugs.gnu.org Hi Maxim, Maxim Cournoyer 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 defini= tion > 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=E2=80=99s 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 > Date: Tue, 16 Apr 2019 17:15:02 -0400 > Subject: [PATCH] system: vm: Auto-detect if inputs should be registered. ^ I=E2=80=99d just write =E2=80=9Cvm:=E2=80=9D 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 defini= tion > 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=E2=80=99t usually document =E2=80=98use-modules=E2=80=99 ch= anges 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=E2=80=99.