From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 08 11:25:47 2022 Received: (at submit) by debbugs.gnu.org; 8 Sep 2022 15:25:47 +0000 Received: from localhost ([127.0.0.1]:59898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJPX-0006E1-13 for submit@debbugs.gnu.org; Thu, 08 Sep 2022 11:25:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:33004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJPV-0006Ds-0U for submit@debbugs.gnu.org; Thu, 08 Sep 2022 11:25:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWJPU-0004av-SB for guix-patches@gnu.org; Thu, 08 Sep 2022 11:25:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWJPU-0006ru-Jz for guix-patches@gnu.org; Thu, 08 Sep 2022 11:25:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=bLc8pk4P2hmxXWvEHBLmnlXgNrkO8Smy/sCzbGVZJ48=; b=seIfFJpekkfpO/ br5+S884wjg2dNRLZ8SBzayLiX1zwYLdbLRzgdgWJQcCUmnjLsWpk6b8gzO9CqvUygEnabO11MBXL Jd8HgCOTduvRpDCfXl8CbI1UfW08oV/DgglCSfAeSqk3CJQNqMuVRPK+4lU8Sg2f3UxgQA9Tqm5tu DT8W8RCWrMViILUPfBYH3kzbxNNoy2XuYIsu5/OU0pVveKVraRTNs4+mJt/EgGxE4gG/R7q4WUCzE i5tGg8yYnEdRfyx59BRxblHhvXICGFee3FJfRgto7JvmJD2iGPRnHq5yhXBlnV8/5o8m7bVWnR/UB hiB+fVpyejzMtb1yWDMA==; Received: from [2a02:587:ac08:6f00:6fbe:4f6e:9429:a4d] (port=48930 helo=meije.lan) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWJP7-00020v-88; Thu, 08 Sep 2022 11:25:39 -0400 From: Mathieu Othacehe To: guix-patches@gnu.org Subject: [PATCH 0/2] image: Add tarball support. Date: Thu, 8 Sep 2022 17:25:12 +0200 Message-Id: <20220908152512.6589-1-othacehe@gnu.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Here's some preliminary work to get https://issues.guix.gnu.org/53912 merged and provide WSL2 image support. I added a (guix compression) module so that (guix system image) can benefit from it. Thanks, Mathieu Alex Griffin (1): system: image: Add tarball support. Mathieu Othacehe (1): guix: Add compression module. Makefile.am | 1 + gnu/image.scm | 2 +- gnu/system/image.scm | 82 ++++++++++++++++++++++++++++++++++++++++++- guix/compression.scm | 69 ++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 46 ++---------------------- 5 files changed, 154 insertions(+), 46 deletions(-) create mode 100644 guix/compression.scm -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 08 11:31:14 2022 Received: (at 57680) by debbugs.gnu.org; 8 Sep 2022 15:31:15 +0000 Received: from localhost ([127.0.0.1]:59915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJUo-0006Pb-Dk for submit@debbugs.gnu.org; Thu, 08 Sep 2022 11:31:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJUj-0006P8-AN for 57680@debbugs.gnu.org; Thu, 08 Sep 2022 11:31:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWJUe-0007wb-3U for 57680@debbugs.gnu.org; Thu, 08 Sep 2022 11:31:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=kL2mDF8+8fA5BLqmtsWWs+y2eqH9PlgTQmqNqdlg4lU=; b=BxwPoxrTY5r7e2 bVBSuM+15qodKncOCcxqFW+OvbuZK32ywpICTmwWYNTtIu1DNuRB/hcouVmr8FLHmerNWzLfr3LZZ JLSSLU89J8827SFZ6omuZ7mDtfuwzZI2aJLys99MTatPoSVq1+kBIpymivVjFQdbEHSIJm4p3pjbK zcbftd/ShkbmHqCOxtwV06U4hyYZYvi4rRAU+h4bo+52toh4ETLOjdGoh5081EoyuPMkgG/xkVdE/ a/V7eByKm7hiyqwsXZe00JN8melZNvCTFisoAfE+TtXuYHYCSuSR097DSbp2svs6MSVjvs0e0DndO T/azk2u8GdvJ2mx9DRjA==; Received: from [2a02:587:ac08:6f00:6fbe:4f6e:9429:a4d] (port=58946 helo=meije.lan) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWJUK-000270-0M; Thu, 08 Sep 2022 11:30:52 -0400 From: Mathieu Othacehe To: 57680@debbugs.gnu.org Subject: [PATCH 1/2] guix: Add compression module. Date: Thu, 8 Sep 2022 17:30:32 +0200 Message-Id: <20220908153033.7016-1-othacehe@gnu.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57680 Cc: Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Move the compression record to a dedicated module so that it can be used outside (guix scripts pack) module. * guix/scripts/pack.scm (, %compressors, lookup-compressor): Move it to ... * guix/compression.scm: ... this new file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/compression.scm | 69 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 46 ++--------------------------- 3 files changed, 72 insertions(+), 44 deletions(-) create mode 100644 guix/compression.scm diff --git a/Makefile.am b/Makefile.am index 22dcc43f99..65b2ec4612 100644 --- a/Makefile.am +++ b/Makefile.am @@ -80,6 +80,7 @@ MODULES = \ guix/base32.scm \ guix/base64.scm \ guix/ci.scm \ + guix/compression.scm \ guix/cpio.scm \ guix/cpu.scm \ guix/deprecation.scm \ diff --git a/guix/compression.scm b/guix/compression.scm new file mode 100644 index 0000000000..10ec4a7cda --- /dev/null +++ b/guix/compression.scm @@ -0,0 +1,69 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix compression) + #:use-module (guix gexp) + #:use-module (guix ui) + #:use-module ((gnu packages compression) #:hide (zip)) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:export (compressor + compressor? + compressor-name + compressor-extension + compressor-command + %compressors + lookup-compressor)) + +;; Type of a compression tool. +(define-record-type + (compressor name extension command) + compressor? + (name compressor-name) ;string (e.g., "gzip") + (extension compressor-extension) ;string (e.g., ".lz") + (command compressor-command)) ;gexp (e.g., #~(list "/gnu/store/…/gzip" + ; "-9n" )) + +(define %compressors + ;; Available compression tools. + (list (compressor "gzip" ".gz" + #~(list #+(file-append gzip "/bin/gzip") "-9n")) + (compressor "lzip" ".lz" + #~(list #+(file-append lzip "/bin/lzip") "-9")) + (compressor "xz" ".xz" + #~(append (list #+(file-append xz "/bin/xz") + "-e") + (%xz-parallel-args))) + (compressor "bzip2" ".bz2" + #~(list #+(file-append bzip2 "/bin/bzip2") "-9")) + (compressor "zstd" ".zst" + ;; The default level 3 compresses better than gzip in a + ;; fraction of the time, while the highest level 19 + ;; (de)compresses more slowly and worse than xz. + #~(list #+(file-append zstd "/bin/zstd") "-3")) + (compressor "none" "" #f))) + +(define (lookup-compressor name) + "Return the compressor object called NAME. Error out if it could not be +found." + (or (find (match-lambda + (($ name*) + (string=? name* name))) + %compressors) + (leave (G_ "~a: compressor not found~%") name))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d3ee69840c..0331ec7b04 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -27,6 +27,7 @@ (define-module (guix scripts pack) #:use-module (guix scripts) #:use-module (guix ui) + #:use-module (guix compression) #:use-module (guix gexp) #:use-module ((guix build utils) #:select (%xz-parallel-args)) #:use-module (guix utils) @@ -61,13 +62,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-26) #:use-module (srfi srfi-37) #:use-module (ice-9 match) - #:export (compressor? - compressor-name - compressor-extension - compressor-command - %compressors - lookup-compressor - self-contained-tarball + #:export (self-contained-tarball debian-archive docker-image squashfs-image @@ -75,34 +70,6 @@ (define-module (guix scripts pack) %formats guix-pack)) -;; Type of a compression tool. -(define-record-type - (compressor name extension command) - compressor? - (name compressor-name) ;string (e.g., "gzip") - (extension compressor-extension) ;string (e.g., ".lz") - (command compressor-command)) ;gexp (e.g., #~(list "/gnu/store/…/gzip" - ; "-9n" )) - -(define %compressors - ;; Available compression tools. - (list (compressor "gzip" ".gz" - #~(list #+(file-append gzip "/bin/gzip") "-9n")) - (compressor "lzip" ".lz" - #~(list #+(file-append lzip "/bin/lzip") "-9")) - (compressor "xz" ".xz" - #~(append (list #+(file-append xz "/bin/xz") - "-e") - (%xz-parallel-args))) - (compressor "bzip2" ".bz2" - #~(list #+(file-append bzip2 "/bin/bzip2") "-9")) - (compressor "zstd" ".zst" - ;; The default level 3 compresses better than gzip in a - ;; fraction of the time, while the highest level 19 - ;; (de)compresses more slowly and worse than xz. - #~(list #+(file-append zstd "/bin/zstd") "-3")) - (compressor "none" "" #f))) - ;; This one is only for use in this module, so don't put it in %compressors. (define bootstrap-xz (compressor "bootstrap-xz" ".xz" @@ -110,15 +77,6 @@ (define bootstrap-xz "-e") (%xz-parallel-args)))) -(define (lookup-compressor name) - "Return the compressor object called NAME. Error out if it could not be -found." - (or (find (match-lambda - (($ name*) - (string=? name* name))) - %compressors) - (leave (G_ "~a: compressor not found~%") name))) - (define not-config? ;; Select (guix …) and (gnu …) modules, except (guix config). (match-lambda -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 08 11:31:17 2022 Received: (at 57680) by debbugs.gnu.org; 8 Sep 2022 15:31:17 +0000 Received: from localhost ([127.0.0.1]:59917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJUq-0006Pl-UF for submit@debbugs.gnu.org; Thu, 08 Sep 2022 11:31:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWJUn-0006PL-AB for 57680@debbugs.gnu.org; Thu, 08 Sep 2022 11:31:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWJUh-0007yT-1A; Thu, 08 Sep 2022 11:31:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=/JKZue/VSSZwV+d8CeDbv9nR3c79ckqdxhRu0gwWZA0=; b=oR4USJjSV7QT22TLpM+6 njZkyrnUPVOwawlje0RVcN/ekhevMedG3CcQEPkcFmMzMQmWNeM6wdNcROMqBZVhPCoamPuW70Yrh IXaxYmFm7wpenWQSCb+2LWg1LVvqvCKQr+IO2YNHmGTZfL0j9o38vKltOuw4iHoswNpZIssE5tiIL /lXWeCMtf2bZxxPgoIL0rlfcZR3tp6E47osPOlvRV9FtOhiaPQED/Z9DVNzQkdyWI+gOtnrKbjJdV wiUMmZI1klSyEeS3jl65sMbgxk9fm3lxTwUpGHWlHzGn5qy/sjpV1qZnnmxkyIBM6Ge8q0KALv19J J6Ph+73OvJB+DQ==; Received: from [2a02:587:ac08:6f00:6fbe:4f6e:9429:a4d] (port=58946 helo=meije.lan) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWJUe-000270-Du; Thu, 08 Sep 2022 11:31:05 -0400 From: Mathieu Othacehe To: 57680@debbugs.gnu.org Subject: [PATCH 2/2] system: image: Add tarball support. Date: Thu, 8 Sep 2022 17:30:33 +0200 Message-Id: <20220908153033.7016-2-othacehe@gnu.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220908153033.7016-1-othacehe@gnu.org> References: <20220908153033.7016-1-othacehe@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57680 Cc: Mathieu Othacehe , Alex Griffin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) From: Alex Griffin * gnu/image.scm ()[fields]: Add tarball to the supported formats. * gnu/system/image.scm (tarball-image, tarball-image-type): New variables. (system-tarball-image): New procedure. (image->root-file-system): Add tarball image support. (system-image): Ditto. Signed-off-by: Mathieu Othacehe --- gnu/image.scm | 2 +- gnu/system/image.scm | 82 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/gnu/image.scm b/gnu/image.scm index 4a0068934e..18e24d3cac 100644 --- a/gnu/image.scm +++ b/gnu/image.scm @@ -152,7 +152,7 @@ (define-with-syntax-properties (name (value properties)) ;; The supported image formats. (define-set-sanitizer validate-image-format format - (disk-image compressed-qcow2 docker iso9660)) + (disk-image compressed-qcow2 docker iso9660 tarball)) ;; The supported partition table types. (define-set-sanitizer validate-partition-table-type partition-table-type diff --git a/gnu/system/image.scm b/gnu/system/image.scm index a04363a130..5e50210523 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli +;;; Copyright © 2022 Alex Griffin ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system image) + #:use-module (guix compression) #:use-module (guix diagnostics) #:use-module (guix discovery) #:use-module (guix gexp) @@ -73,6 +75,7 @@ (define-module (gnu system image) efi-disk-image iso9660-image docker-image + tarball-image raw-with-offset-disk-image image-with-os @@ -82,6 +85,7 @@ (define-module (gnu system image) iso-image-type uncompressed-iso-image-type docker-image-type + tarball-image-type raw-with-offset-image-type image-with-label @@ -149,6 +153,10 @@ (define docker-image (image (format 'docker))) +(define tarball-image + (image + (format 'tarball))) + (define* (raw-with-offset-disk-image #:optional (offset root-offset)) (image (format 'disk-image) @@ -211,6 +219,11 @@ (define docker-image-type (name 'docker) (constructor (cut image-with-os docker-image <>)))) +(define tarball-image-type + (image-type + (name 'tarball) + (constructor (cut image-with-os tarball-image <>)))) + (define raw-with-offset-image-type (image-type (name 'raw-with-offset) @@ -681,6 +694,71 @@ (define builder #:options `(#:references-graphs ((,graph ,os)) #:substitutable? ,substitutable?)))) + +;; +;; Tarball image. +;; + +(define* (system-tarball-image image + #:key + (name "image") + (compressor (srfi-1:first %compressors))) + "Build a tarball of IMAGE. NAME is the base name to use for the +output file." + (let* ((os (image-operating-system image)) + (substitutable? (image-substitutable? image)) + (schema (local-file (search-path %load-path + "guix/store/schema.sql"))) + (name (string-append name ".tar" (compressor-extension compressor))) + (graph "system-graph")) + (define builder + (with-extensions gcrypt-sqlite3&co ;for (guix store database) + (with-imported-modules `(,@(source-module-closure + '((guix build pack) + (guix build store-copy) + (guix build utils) + (guix store database) + (gnu build image)) + #:select? not-config?) + ((guix config) => ,(make-config.scm))) + #~(begin + (use-modules (guix build pack) + (guix build store-copy) + (guix build utils) + (guix store database) + (gnu build image)) + + ;; Set the SQL schema location. + (sql-schema #$schema) + + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (let ((image-root (string-append (getcwd) "/tmp-root")) + (tar #+(file-append tar "/bin/tar"))) + + (mkdir-p image-root) + (initialize-root-partition image-root + #:references-graphs '(#$graph) + #:deduplicate? #f + #:system-directory #$os) + + (with-directory-excursion image-root + (apply invoke tar "-cvf" #$output "." + (tar-base-options + #:tar tar + #:compressor + #+(and=> compressor compressor-command))))))))) + + (computed-file name builder + ;; Allow offloading so that this I/O-intensive process + ;; doesn't run on the build farm's head node. + #:local-build? #f + #:options `(#:references-graphs ((,graph ,os)) + #:substitutable? ,substitutable?)))) + ;; ;; Image creation. @@ -690,7 +768,7 @@ (define (image->root-file-system image) "Return the IMAGE root partition file-system type." (case (image-format image) ((iso9660) "iso9660") - ((docker) "dummy") + ((docker tarball) "dummy") (else (partition-file-system (find-root-partition image))))) @@ -827,6 +905,8 @@ (define target (cond ("bootcfg" ,bootcfg)))) ((memq image-format '(docker)) (system-docker-image image*)) + ((memq image-format '(tarball)) + (system-tarball-image image*)) ((memq image-format '(iso9660)) (system-iso9660-image image* -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 09:50:33 2022 Received: (at 57680) by debbugs.gnu.org; 24 Sep 2022 13:50:33 +0000 Received: from localhost ([127.0.0.1]:42791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc5Y9-0000iD-Gh for submit@debbugs.gnu.org; Sat, 24 Sep 2022 09:50:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc5Y7-0000hp-0g for 57680@debbugs.gnu.org; Sat, 24 Sep 2022 09:50:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc5Y1-0004ve-Qb for 57680@debbugs.gnu.org; Sat, 24 Sep 2022 09:50:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=lUVX4tBhRvhZVh01m69ebxWE/fPZckvI3evHCFXpDs8=; b=iRgL7fav2UlanAkKI89w jiX+yMpXsGFEG31kuDqhrNjmZpI9SQGNHG51IKYxSf/K4ZpH4TUkJHPNdf9cDYEZcZPSF+rYoUmBT sd+vFf6cKj6DL3SpJ/CXI5jjuzi+1Auk4IxuU9y1WrnusG6ebv2E90u1xbSjH7edWGN7+9Upi3dfn tbJpAlqffaOghin91kDHfxDEEbbjHRBZ9KQ0rTt4FyNiMTIgj7CVB+dWAAmtRc1Ay791AQ0TfBnwI xJla6ts/PgbUT10NgQhLt88lR3GvUPeJ2oWan6iWq7FdBU++IHCzd+IxJDn0ccHAA+7i2vjcGalef Zj0ShVzjGomoYQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58342 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc5Y1-0007Oa-6D; Sat, 24 Sep 2022 09:50:25 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#57680: [PATCH 0/2] image: Add tarball support. References: <20220908152512.6589-1-othacehe@gnu.org> <20220908153033.7016-1-othacehe@gnu.org> Date: Sat, 24 Sep 2022 15:50:22 +0200 In-Reply-To: <20220908153033.7016-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Thu, 8 Sep 2022 17:30:32 +0200") Message-ID: <8735cgankx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57680 Cc: 57680@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe skribis: > Move the compression record to a dedicated module so that it can be used > outside (guix scripts pack) module. > > * guix/scripts/pack.scm (, %compressors, lookup-compressor): = Move > it to ... > * guix/compression.scm: ... this new file. > * Makefile.am (MODULES): Add it. I=E2=80=99m pretty sure I commented on this patch as part of another series recently but I can=E2=80=99t find it anymore. The guts of it is: 1. (guix compression) sounds like it could just as well be about offering an abstraction over guile-{zlib,zstd,lzlib} like that currently in (guix utils). So the name is misleading. 2. We cannot refer to (gnu =E2=80=A6) from (guix =E2=80=A6) or, if we rea= lly need to do so, then that should happen lazily at run time (do not miss Josselin=E2=80=99s excellent guided tour at the Ten Years, which inclu= ded a discussion of this! :-)). Hope that makes sense! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 24 09:52:14 2022 Received: (at 57680) by debbugs.gnu.org; 24 Sep 2022 13:52:14 +0000 Received: from localhost ([127.0.0.1]:42796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc5Zl-0000kl-W6 for submit@debbugs.gnu.org; Sat, 24 Sep 2022 09:52:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc5Zk-0000kY-Lb for 57680@debbugs.gnu.org; Sat, 24 Sep 2022 09:52:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc5Zf-000579-89; Sat, 24 Sep 2022 09:52:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=M28exMZ4pf19i8iLnESs2Mbq07IsbIkMiW5qOOu+PCw=; b=o/0g/LNLiOewabgxJq3+ H2W8nFDG0Ph2gd8LLAZ7B+mJkI7WRJ0RgkHhVAtyfvpt6Q6fqIg1wSU5xGByJWiYkL7WGNe01obsq CTWKjuPpv9Yz5QXTyt+qFIpamNqGlHN2Ku07AqLRLvW9R8wYRH3Kc6xzFwEItXrnzkiiTIMy5IGQt bLL2kaBbXnn5z8jvXO/96ITlTU5vpf7uotzgLyvD7cro8VwSwIYMr1BaXFjXmEkDBmuRf5fS9zgua T9T3tid/xBsRO+k3QvA2emR6jfNezc67RA8InB0FBsio6qzCRJaoaiA/GHolxq84DxMYBujbvB2HA GLibzVGYlhHhAA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49628 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc5Ze-0007ab-QG; Sat, 24 Sep 2022 09:52:07 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#57680: [PATCH 0/2] image: Add tarball support. References: <20220908153033.7016-1-othacehe@gnu.org> <20220908153033.7016-2-othacehe@gnu.org> Date: Sat, 24 Sep 2022 15:52:05 +0200 In-Reply-To: <20220908153033.7016-2-othacehe@gnu.org> (Mathieu Othacehe's message of "Thu, 8 Sep 2022 17:30:33 +0200") Message-ID: <87y1u898xm.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57680 Cc: 57680@debbugs.gnu.org, Alex Griffin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Mathieu Othacehe skribis: > From: Alex Griffin > > * gnu/image.scm ()[fields]: Add tarball to the supported formats. > * gnu/system/image.scm (tarball-image, tarball-image-type): New variables. > (system-tarball-image): New procedure. > (image->root-file-system): Add tarball image support. > (system-image): Ditto. > > Signed-off-by: Mathieu Othacehe Nice! Perhaps we need to mention it in the manual? > +;; > +;; Tarball image. > +;; Three semicolons maybe? :-) > +(define* (system-tarball-image image > + #:key > + (name "image") > + (compressor (srfi-1:first %compressors))) > + "Build a tarball of IMAGE. NAME is the base name to use for the > +output file." > + (let* ((os (image-operating-system image)) > + (substitutable? (image-substitutable? image)) > + (schema (local-file (search-path %load-path > + "guix/store/schema.sql"))) > + (name (string-append name ".tar" (compressor-extension compress= or))) > + (graph "system-graph")) > + (define builder > + (with-extensions gcrypt-sqlite3&co ;for (guix store datab= ase) > + (with-imported-modules `(,@(source-module-closure > + '((guix build pack) > + (guix build store-copy) > + (guix build utils) > + (guix store database) > + (gnu build image)) > + #:select? not-config?) > + ((guix config) =3D> ,(make-config.scm))) > + #~(begin > + (use-modules (guix build pack) > + (guix build store-copy) > + (guix build utils) > + (guix store database) > + (gnu build image)) > + > + ;; Set the SQL schema location. > + (sql-schema #$schema) > + > + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be de= coded. > + (setenv "GUIX_LOCPATH" > + #+(file-append glibc-utf8-locales "/lib/locale")) > + (setlocale LC_ALL "en_US.utf8") > + > + (let ((image-root (string-append (getcwd) "/tmp-root")) > + (tar #+(file-append tar "/bin/tar"))) > + > + (mkdir-p image-root) > + (initialize-root-partition image-root > + #:references-graphs '(#$graph) > + #:deduplicate? #f > + #:system-directory #$os) > + > + (with-directory-excursion image-root > + (apply invoke tar "-cvf" #$output "." > + (tar-base-options > + #:tar tar > + #:compressor > + #+(and=3D> compressor compressor-command))))))= ))) > + > + (computed-file name builder > + ;; Allow offloading so that this I/O-intensive process > + ;; doesn't run on the build farm's head node. > + #:local-build? #f > + #:options `(#:references-graphs ((,graph ,os)) > + #:substitutable? ,substitutable?)))) There=E2=80=99s probably something to be factorized with (guix scripts pack= ), but that can be left for later with a TODO. Otherwise LGTM, thank you & Alex! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 25 03:51:01 2022 Received: (at 57680) by debbugs.gnu.org; 25 Sep 2022 07:51:01 +0000 Received: from localhost ([127.0.0.1]:45806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocMPl-0002Z0-9Q for submit@debbugs.gnu.org; Sun, 25 Sep 2022 03:51:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocMPj-0002Yk-AK for 57680@debbugs.gnu.org; Sun, 25 Sep 2022 03:50:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocMPe-0000mg-46; Sun, 25 Sep 2022 03:50:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=bkB9TLGkb58n89H10uuE+bOEiBCaymX9KQSqQqvpWB0=; b=Y5WHckyb8Q/JjRRmFbNT Pmj0fAcaW8HjghjQU4b8JDC8LLuy4QsvFNIixpPBO2jHDryttJ2dXWx3MQJAcXfVYC1m/7Tiboi7H tMdhpb/K1xTu23bB1lFAgltwzVH0IKoA6vxj80mRWXu+KQDAUmUW98wCvion8bPZhOE/Lvhbzuu/a OcnfItOrGET9mKf2NcdC140dlGgCJzJZbKx5Me5aZgPnueQklXM3Ll1fTu0cla+I8X6lrltuSnl5j QBdrzKC6n7kuPlBjwZUyl3FUKhUo6bcT6EteOqZSo1dY4ccr0QoJhFt6Wk/6wYeX1rx3j3Hk5Ci7T B5OZkHyOllePuQ==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2774.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2774]:35056 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocMPY-0003W9-Nr; Sun, 25 Sep 2022 03:50:53 -0400 From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#57680: [PATCH 0/2] image: Add tarball support. References: <20220908152512.6589-1-othacehe@gnu.org> <20220908153033.7016-1-othacehe@gnu.org> <8735cgankx.fsf_-_@gnu.org> Date: Sun, 25 Sep 2022 09:50:45 +0200 In-Reply-To: <8735cgankx.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Sat, 24 Sep 2022 15:50:22 +0200") Message-ID: <87edvzlwoa.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57680 Cc: 57680@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > I=E2=80=99m pretty sure I commented on this patch as part of another seri= es > recently but I can=E2=80=99t find it anymore. Here it was: https://lists.gnu.org/archive/html/guix-devel/2022-09/msg00094= .html > 1. (guix compression) sounds like it could just as well be about > offering an abstraction over guile-{zlib,zstd,lzlib} like that > currently in (guix utils). So the name is misleading. While I agree, I cannot think of another name. Maybe (gnu compressor) as this is the name of the defined record? > 2. We cannot refer to (gnu =E2=80=A6) from (guix =E2=80=A6) or, if we r= eally need to > do so, then that should happen lazily at run time (do not miss > Josselin=E2=80=99s excellent guided tour at the Ten Years, which inc= luded a > discussion of this! :-)). I moved it to (gnu compression) for now. Yeah, I'm polling the 10years page to be able to watch this presentation among others ;). Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 25 07:55:50 2022 Received: (at control) by debbugs.gnu.org; 25 Sep 2022 11:55:51 +0000 Received: from localhost ([127.0.0.1]:46037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocQEg-0002dd-Ke for submit@debbugs.gnu.org; Sun, 25 Sep 2022 07:55:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocQEf-0002dQ-Nd for control@debbugs.gnu.org; Sun, 25 Sep 2022 07:55:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocQEa-0001Jz-Gn for control@debbugs.gnu.org; Sun, 25 Sep 2022 07:55:44 -0400 Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775]:38816 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocQEX-0002f5-IS for control@debbugs.gnu.org; Sun, 25 Sep 2022 07:55:44 -0400 Date: Sun, 25 Sep 2022 13:55:39 +0200 Message-Id: <87mtank6ro.fsf@meije.mail-host-address-is-not-set> To: control@debbugs.gnu.org From: Mathieu Othacehe Subject: control message for bug #57680 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) close 57680 quit From unknown Sat Sep 06 14:23:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 24 Oct 2022 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator