From patchwork Wed Apr 22 15:08:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 21413 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C82BE27BBE4; Wed, 22 Apr 2020 16:10:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 8A36627BBE1 for ; Wed, 22 Apr 2020 16:10:10 +0100 (BST) Received: from localhost ([::1]:52362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0s-0002pN-3u for patchwork@mira.cbaines.net; Wed, 22 Apr 2020 11:10:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59270) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0l-0002p3-I1 for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH0l-00016f-3W for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH0k-00016G-OG for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH0k-00017Z-H9 for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40770] [PATCH 1/5] profiles: Add lowerable record type. References: <20200422150641.5267-1-ludo@gnu.org> In-Reply-To: <20200422150641.5267-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Apr 2020 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40770@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40770-submit@debbugs.gnu.org id=B40770.15875681434169 (code B ref 40770); Wed, 22 Apr 2020 15:10:02 +0000 Received: (at 40770) by debbugs.gnu.org; 22 Apr 2020 15:09:03 +0000 Received: from localhost ([127.0.0.1]:52853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzm-000156-Fo for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzk-00014L-Qk for 40770@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59984) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRGzf-0006mg-K1; Wed, 22 Apr 2020 11:08:55 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52530 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jRGze-00029i-ON; Wed, 22 Apr 2020 11:08:55 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Apr 2020 17:08:45 +0200 Message-Id: <20200422150849.5432-1-ludo@gnu.org> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/profiles.scm (): New record type. * tests/profiles.scm (""): New test. --- guix/profiles.scm | 36 ++++++++++++++++++++++++++++++++++++ tests/profiles.scm | 13 ++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 88606fa4ce..ab265cce62 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -125,6 +125,15 @@ profile-derivation profile-search-paths + profile + profile? + profile-name + profile-content + profile-hooks + profile-locales? + profile-allow-collisions? + profile-relative-symlinks? + generation-number generation-profile generation-numbers @@ -1656,6 +1665,33 @@ are cross-built for TARGET." . ,(length (manifest-entries manifest)))))))) +;; Declarative profile. +(define-record-type* profile make-profile + profile? + (name profile-name (default "profile")) ;string + (content profile-content) ; + (hooks profile-hooks ;list of procedures + (default %default-profile-hooks)) + (locales? profile-locales? ;Boolean + (default #t)) + (allow-collisions? profile-allow-collisions? ;Boolean + (default #f)) + (relative-symlinks? profile-relative-symlinks? ;Boolean + (default #f))) + +(define-gexp-compiler (profile-compiler (profile ) system target) + "Compile PROFILE to a derivation." + (match profile + (($ name manifest hooks + locales? allow-collisions? relative-symlinks?) + (profile-derivation manifest + #:name name + #:hooks hooks + #:locales? locales? + #:allow-collisions? allow-collisions? + #:relative-symlinks? relative-symlinks? + #:system system #:target target)))) + (define* (profile-search-paths profile #:optional (manifest (profile-manifest profile)) #:key (getenv (const #f))) diff --git a/tests/profiles.scm b/tests/profiles.scm index 21c912a532..055924ba3e 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014 Alex Kost ;;; ;;; This file is part of GNU Guix. @@ -223,6 +223,17 @@ (string=? (dirname (readlink bindir)) (derivation->output-path guile)))))) +(test-assertm "" + (mlet* %store-monad + ((entry -> (package->manifest-entry %bootstrap-guile)) + (profile -> (profile (hooks '()) (locales? #f) + (content (manifest (list entry))))) + (drv (lower-object profile)) + (profile -> (derivation->output-path drv)) + (bindir -> (string-append profile "/bin")) + (_ (built-derivations (list drv)))) + (return (file-exists? (string-append bindir "/guile"))))) + (test-assertm "profile-derivation relative symlinks, one entry" (mlet* %store-monad ((entry -> (package->manifest-entry %bootstrap-guile)) From patchwork Wed Apr 22 15:08:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 21414 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 66D3B27BBE4; Wed, 22 Apr 2020 16:10:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 400D827BBE1 for ; Wed, 22 Apr 2020 16:10:18 +0100 (BST) Received: from localhost ([::1]:52368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0z-00030C-Qr for patchwork@mira.cbaines.net; Wed, 22 Apr 2020 11:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59276) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0l-0002p7-T4 for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH0l-00017H-HG for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH0l-000177-5I for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH0l-00017h-0h for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40770] [PATCH 2/5] system: 'operating-system-directory-base-entries' uses 'profile'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Apr 2020 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40770@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40770-submit@debbugs.gnu.org id=B40770.15875681454185 (code B ref 40770); Wed, 22 Apr 2020 15:10:02 +0000 Received: (at 40770) by debbugs.gnu.org; 22 Apr 2020 15:09:05 +0000 Received: from localhost ([127.0.0.1]:52857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzo-00015Q-Qo for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzm-00014V-Hc for 40770@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59986) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRGzh-0006wW-Bw; Wed, 22 Apr 2020 11:08:57 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52530 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jRGzf-00029i-TD; Wed, 22 Apr 2020 11:08:56 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Apr 2020 17:08:46 +0200 Message-Id: <20200422150849.5432-2-ludo@gnu.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200422150849.5432-1-ludo@gnu.org> References: <20200422150849.5432-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/system.scm (operating-system-directory-base-entries): Use a declarative profile instead of 'profile-derivation'. --- gnu/system.scm | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index fb48fedd7f..739b629367 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -475,17 +475,15 @@ OS." (define* (operating-system-directory-base-entries os) "Return the basic entries of the 'system' directory of OS for use as the value of the SYSTEM-SERVICE-TYPE service." - (let ((locale (operating-system-locale-directory os))) - (mlet* %store-monad ((kernel -> (operating-system-kernel os)) - (modules -> - (operating-system-kernel-loadable-modules os)) - (kernel - (profile-derivation - (packages->manifest - (cons kernel modules)) - #:hooks (list linux-module-database))) - (initrd -> (operating-system-initrd-file os)) - (params -> (operating-system-boot-parameters-file os))) + (let* ((locale (operating-system-locale-directory os)) + (modules (operating-system-kernel-loadable-modules os)) + (kernel (profile + (content (packages->manifest + (cons (operating-system-kernel os) modules))) + (hooks (list linux-module-database)))) + (initrd (operating-system-initrd-file os)) + (params (operating-system-boot-parameters-file os))) + (with-monad %store-monad (return `(("kernel" ,kernel) ("parameters" ,params) ("initrd" ,initrd) From patchwork Wed Apr 22 15:08:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 21415 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ED0FE27BBE4; Wed, 22 Apr 2020 16:10:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C844C27BBE1 for ; Wed, 22 Apr 2020 16:10:19 +0100 (BST) Received: from localhost ([::1]:52372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH10-00030u-Cs for patchwork@mira.cbaines.net; Wed, 22 Apr 2020 11:10:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59282) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0m-0002pE-BB for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH0m-00018W-1k for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH0l-00018A-M9 for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH0l-00017o-F3 for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40770] [PATCH 3/5] services: profile: Use a declarative profile. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Apr 2020 15:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40770@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40770-submit@debbugs.gnu.org id=B40770.15875681454192 (code B ref 40770); Wed, 22 Apr 2020 15:10:03 +0000 Received: (at 40770) by debbugs.gnu.org; 22 Apr 2020 15:09:05 +0000 Received: from localhost ([127.0.0.1]:52859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzp-00015S-4W for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzo-00014X-5q for 40770@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59987) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRGzj-000722-08; Wed, 22 Apr 2020 11:08:59 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52530 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jRGzh-00029i-M3; Wed, 22 Apr 2020 11:08:58 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Apr 2020 17:08:47 +0200 Message-Id: <20200422150849.5432-3-ludo@gnu.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200422150849.5432-1-ludo@gnu.org> References: <20200422150849.5432-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services.scm (packages->profile-entry): Use 'profile' instead of 'profile-derivation'. --- gnu/services.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index 126e0814eb..ada6268a0b 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -691,10 +691,10 @@ executables, making them setuid-root."))) (define (packages->profile-entry packages) "Return a system entry for the profile containing PACKAGES." - (mlet %store-monad ((profile (profile-derivation - (packages->manifest - (delete-duplicates packages eq?))))) - (return `(("profile" ,profile))))) + (with-monad %store-monad + (return `(("profile" ,(profile + (content (packages->manifest + (delete-duplicates packages eq?))))))))) (define profile-service-type ;; The service that populates the system's profile---i.e., From patchwork Wed Apr 22 15:08:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 21417 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4387727BBE4; Wed, 22 Apr 2020 16:10:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 122E427BBE1 for ; Wed, 22 Apr 2020 16:10:31 +0100 (BST) Received: from localhost ([::1]:52380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH1C-0003GR-Kg for patchwork@mira.cbaines.net; Wed, 22 Apr 2020 11:10:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59290) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0m-0002pO-Vx for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH0m-00019l-JJ for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH0m-00018x-7V for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH0m-00017x-2f for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40770] [PATCH 4/5] pack: Use a declarative profile. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Apr 2020 15:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40770@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40770-submit@debbugs.gnu.org id=B40770.15875681494207 (code B ref 40770); Wed, 22 Apr 2020 15:10:04 +0000 Received: (at 40770) by debbugs.gnu.org; 22 Apr 2020 15:09:09 +0000 Received: from localhost ([127.0.0.1]:52863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzt-00015n-CW for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzq-00014g-D9 for 40770@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59990) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRGzl-00079Y-5B; Wed, 22 Apr 2020 11:09:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52530 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jRGzj-00029i-9o; Wed, 22 Apr 2020 11:08:59 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Apr 2020 17:08:48 +0200 Message-Id: <20200422150849.5432-4-ludo@gnu.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200422150849.5432-1-ludo@gnu.org> References: <20200422150849.5432-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/pack.scm (guix-pack): Use a declarative profile instead of 'profile-derivation'. --- guix/scripts/pack.scm | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 6d63fb4b90..f3d1b41c6f 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1071,7 +1071,21 @@ Create a bundle of PACKAGE.\n")) (localstatedir? (assoc-ref opts 'localstatedir?)) (entry-point (assoc-ref opts 'entry-point)) (profile-name (assoc-ref opts 'profile-name)) - (gc-root (assoc-ref opts 'gc-root))) + (gc-root (assoc-ref opts 'gc-root)) + (profile (profile + (content manifest) + + ;; Always produce relative symlinks for + ;; Singularity (see + ;; ). + (relative-symlinks? + (or relocatable? + (eq? 'squashfs pack-format))) + + (hooks (if bootstrap? + '() + %default-profile-hooks)) + (locales? (not bootstrap?))))) (define (lookup-package package) (manifest-lookup manifest (manifest-pattern (name package)))) @@ -1085,22 +1099,7 @@ Create a bundle of PACKAGE.\n")) to your package list."))) (run-with-store store - (mlet* %store-monad ((profile (profile-derivation - manifest - - ;; Always produce relative - ;; symlinks for Singularity (see - ;; ). - #:relative-symlinks? - (or relocatable? - (eq? 'squashfs pack-format)) - - #:hooks (if bootstrap? - '() - %default-profile-hooks) - #:locales? (not bootstrap?) - #:target target)) - (drv (build-image name profile + (mlet* %store-monad ((drv (build-image name profile #:target target #:compressor From patchwork Wed Apr 22 15:08:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 21416 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5181027BBE4; Wed, 22 Apr 2020 16:10:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1221027BBE1 for ; Wed, 22 Apr 2020 16:10:25 +0100 (BST) Received: from localhost ([::1]:52374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH16-00039i-Lp for patchwork@mira.cbaines.net; Wed, 22 Apr 2020 11:10:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59298) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH0n-0002qU-Ja for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH0n-00019x-1f for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH0m-00019q-LG for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH0m-000185-GG for guix-patches@gnu.org; Wed, 22 Apr 2020 11:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40770] [PATCH 5/5] services: system: Initial entries are non-monadic. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Apr 2020 15:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40770@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 40770-submit@debbugs.gnu.org id=B40770.15875681534224 (code B ref 40770); Wed, 22 Apr 2020 15:10:04 +0000 Received: (at 40770) by debbugs.gnu.org; 22 Apr 2020 15:09:13 +0000 Received: from localhost ([127.0.0.1]:52865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzw-000163-M1 for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRGzt-00015J-0i for 40770@debbugs.gnu.org; Wed, 22 Apr 2020 11:09:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59991) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRGzn-0007NT-QE; Wed, 22 Apr 2020 11:09:03 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52530 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jRGzl-00029i-FH; Wed, 22 Apr 2020 11:09:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 22 Apr 2020 17:08:49 +0200 Message-Id: <20200422150849.5432-5-ludo@gnu.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200422150849.5432-1-ludo@gnu.org> References: <20200422150849.5432-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/system.scm (operating-system-directory-base-entries): Return a regular, non-monadic value. * gnu/services.scm (system-derivation): Adjust accordingly. * gnu/system/linux-container.scm (container-essential-services): Likewise. --- gnu/services.scm | 5 ++--- gnu/system.scm | 9 ++++----- gnu/system/linux-container.scm | 6 ++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index ada6268a0b..2e4648bf78 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -318,11 +318,10 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)." ;;; Core services. ;;; -(define (system-derivation mentries mextensions) +(define (system-derivation entries mextensions) "Return as a monadic value the derivation of the 'system' directory containing the given entries." - (mlet %store-monad ((entries mentries) - (extensions (mapm/accumulate-builds identity + (mlet %store-monad ((extensions (mapm/accumulate-builds identity mextensions))) (lower-object (file-union "system" diff --git a/gnu/system.scm b/gnu/system.scm index 739b629367..1872a2ed61 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -483,11 +483,10 @@ value of the SYSTEM-SERVICE-TYPE service." (hooks (list linux-module-database)))) (initrd (operating-system-initrd-file os)) (params (operating-system-boot-parameters-file os))) - (with-monad %store-monad - (return `(("kernel" ,kernel) - ("parameters" ,params) - ("initrd" ,initrd) - ("locale" ,locale)))))) ;used by libc + `(("kernel" ,kernel) + ("parameters" ,params) + ("initrd" ,initrd) + ("locale" ,locale)))) ;used by libc (define (operating-system-default-essential-services os) "Return the list of essential services for OS. These are special services diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index c8807398b3..c5e2e4bf9c 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson -;;; Copyright © 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2019 Arun Isaac ;;; Copyright © 2020 Efraim Flashner ;;; @@ -53,9 +53,7 @@ from OS that are needed on the bare metal and not in a container." (operating-system-default-essential-services os))) (cons (service system-service-type - (let ((locale (operating-system-locale-directory os))) - (with-monad %store-monad - (return `(("locale" ,locale)))))) + `(("locale" ,(operating-system-locale-directory os)))) ;; If network is to be shared with the host, remove network ;; configuration files from etc-service. (if shared-network?