From unknown Sat Sep 13 08:10:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49149 <49149@debbugs.gnu.org> To: bug#49149 <49149@debbugs.gnu.org> Subject: Status: [PATCH 0/7] Add deb format for guix pack. Reply-To: bug#49149 <49149@debbugs.gnu.org> Date: Sat, 13 Sep 2025 15:10:03 +0000 retitle 49149 [PATCH 0/7] Add deb format for guix pack. reassign 49149 guix-patches submitter 49149 Maxim Cournoyer severity 49149 normal tag 49149 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:10:53 2021 Received: (at submit) by debbugs.gnu.org; 21 Jun 2021 06:10:53 +0000 Received: from localhost ([127.0.0.1]:35179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvD93-0006X5-8O for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:10:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:53820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvD92-0006Wy-Ia for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:10:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvD92-0007N4-Cw for guix-patches@gnu.org; Mon, 21 Jun 2021 02:10:52 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:36554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvD90-0000AH-Mj for guix-patches@gnu.org; Mon, 21 Jun 2021 02:10:52 -0400 Received: by mail-qk1-x72a.google.com with SMTP id i68so27610852qke.3 for ; Sun, 20 Jun 2021 23:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TPnWixVLnlSf/6kOT8UBYyNGCUz77d1A4nmbB8OsVe4=; b=Ds/ta1Qq2izXOEhclsgd+B/ohGky6QQ0Uw7lVIYNYUqCVxxaBsOhRgaaDDP8PieCrU bX8ByEONrGShkLKmA9NlK3+hTaGO756xwYAs+CEi1teadnfG9cKuDCllhJ10Vewlnhm+ rrOIxt4foa2YXHqUZUFsGZqdTHDRAtpFbgFodt3dBOTlSU9dSuYzmCXPBkmZ6FoQ2QkU /ZiwhGFT8/87XiyR8YhydBjgJQ0FLu43aVh1B+ntZ+1+qOKNeFBrr2qNNfNc40onGgZ3 Q8D6//D1j7pcE9/NtpViQcfyEIrKfrgG3hSowMd20a2em5xKSCm+HFija4xdfC6cBMis fQWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TPnWixVLnlSf/6kOT8UBYyNGCUz77d1A4nmbB8OsVe4=; b=uibVzen9POTTDgDGebOYHaDZ0l0eLMy+3HqvzzH/Ubg9CTaIaayaxRdS14/A9HcexK SHQT05xh0nlKcQfpEYmPMyuShB7xJQhG+LOin0Fexv+TbUwoZT6mqAYCikq1aH5f9BhT Z4M+RbhHT8ZofvGPahrdsfyOyE2ub1a0VqU8cKOrm7/NMtgyu5SnfeEenlsy3icKaVus OLhJvfu6yEWx+/cdfFgaFvbUQEmB3Mx64NYT0IjL0Kgzh3TSuwDpObjqRzkqmKCIsZEX /Bzfv5iaN+FcgnV0UrNoAsDiyotxwG6dwU4AIXOFbdB3r7ZVrV9fJL05tiq+t6FRtGR+ f0Gw== X-Gm-Message-State: AOAM533jZlV1N33VLz96/zDGpMGl0VKk3Sk75olNxDMBEEQ2cxcV18J0 CZpr8hFGNp6Y3+Krwag7kwUncnjQQv5DiA== X-Google-Smtp-Source: ABdhPJzFmBFVhOUUAfEBLVV3ZIvuCm4HoRQQ6O9rZrsGS8sPE8YMhsvcaBK2nBagqt+YaYb7kDlPHw== X-Received: by 2002:a37:a645:: with SMTP id p66mr21686915qke.499.1624255848773; Sun, 20 Jun 2021 23:10:48 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id p3sm10372026qti.31.2021.06.20.23.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:10:48 -0700 (PDT) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/7] Add deb format for guix pack. Date: Mon, 21 Jun 2021 02:10:39 -0400 Message-Id: <20210621061039.31557-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer 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.3 (--) Hello Guix! This patch set adds support to produce Debian archives (.deb packages) via guix pack. It's rudimentary but functional. You can try a simple example like so: $ ./pre-inst-env guix pack -f deb -C xz hello -S /usr/bin/hello=bin/hello Copy the generated .deb to your dpkg-based distribution of choice, then: $ sudo apt install ./91ypmi1j5py9qk034kki5wrgy0n52yz9-hello-deb-pack.deb $ realpath $(which hello) /gnu/store/lk9cmjjhgxpkxxi7m54y0jlv3rqvpb2n-hello-2.10/bin/hello $ hello Hello, world! Fun, no? We can now distribute software built with Guix transparently to any Debian-based distribution. Maxim Cournoyer (7): pack: Extract builder code from self-contained-tarball. pack: Factorize base tar options. pack: Fix typo. pack: Improve naming of the packs store file names. pack: Prevent duplicate files in tar archives. tests: pack: Fix compressor extension. pack: Add support for the deb format. .dir-locals.el | 1 + Makefile.am | 1 + doc/guix.texi | 5 + gnu/system/file-systems.scm | 56 +++-- guix/build/pack.scm | 52 ++++ guix/docker.scm | 20 +- guix/scripts/pack.scm | 471 +++++++++++++++++++++++++----------- tests/file-systems.scm | 7 +- tests/pack.scm | 77 +++++- 9 files changed, 506 insertions(+), 184 deletions(-) create mode 100644 guix/build/pack.scm -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:29 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:29 +0000 Received: from localhost ([127.0.0.1]:35184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAa-0006Zx-K8 for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:29 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:41699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAZ-0006Zk-5c for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:27 -0400 Received: by mail-qk1-f177.google.com with SMTP id 22so6580452qkv.8 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nK+XZhiFPUZF48SwwcEJOQPOaSHkTwT9yOejmrHORIk=; b=Mc+L4hmSt+uB/hrshFoqOiD3TqO+oSEvXW/8hVSjpNvBEcXwbxvQqpyMwY7qDvDq7c laXqBLmkRrZ6xAQdpFBBktb6NccbBokNP9bLWw3RUoYtiZUjEzZQDWA5IQxsb2I0u8TM NuOabm0KajiJLpTddnIEfHDpGQcNmInSsXYn/oSkSVF9RLICT73x3xJuaIGsjmXEpLgY 5PpD9V/NiPxn5zQpWb8a07Gi8CnZjq3OcDxNCJKfRbu1/CfeNq4p2bHDbPSM1Wft9vaF 2rzWtHJdwT2PB4zXl95HFsizCmSEXBWZOQGwNwZ47TF8nSOfDrtFjck01o76T3PLk/L2 YSYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nK+XZhiFPUZF48SwwcEJOQPOaSHkTwT9yOejmrHORIk=; b=lGqtK8vpYBiHs2USjAA3Xu8D3j0dMmmJI4XY2xEJavz6f1xTikYsK9NDLp4vOqn1Q7 VupMNMKPhaOlcUlJ6/Q1bThvwtSVj1PmetPqUrTVDViIIWzmlbrZKHf4c6E6j33yfZF1 52ZJribbCwOL1OrqgA214PzDC0D1rcIyuK4e0hPEiZb9SO8tYSYpj4VqKivp89+xl2Gq CoeOwE0VM0RjpblCOFhS/PmkahqibtF82yi1NRsYVnr+RZO8SJL1hF1PvhKiuNDIwu1k BhJLpHuHPRo3sjXTQ5/jyRZxzYlegOHGQBUQ8wpYqz6fhIrmImWKiBwlu+Gb3iLSUx/J UY9Q== X-Gm-Message-State: AOAM532eB/BdE0NwDHlfVqYQOf6cTym6WmnroNGFIvlmbSfmLUfDKe1d /AdX+Xj1sUpZX/V8fE0ic8EsVogFtmwzhA== X-Google-Smtp-Source: ABdhPJzBl8oxZ0tsoN9oIDp8kGyrqOXE52cFFinhjwwAkToF7DEMkeln88AB5Y5sKJyBU5cITlur9A== X-Received: by 2002:a05:620a:218e:: with SMTP id g14mr21312418qka.290.1624255941431; Sun, 20 Jun 2021 23:12:21 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:21 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 1/7] pack: Extract builder code from self-contained-tarball. Date: Mon, 21 Jun 2021 02:11:58 -0400 Message-Id: <20210621061205.31878-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) This is made to allow reusing it for the debian-archive pack format, added in a subsequent commit. * guix/scripts/pack.scm (self-contained-tarball/builder): New procedure, containing the build code extracted from self-contained-tarball. (self-contained-tarball): Use the above procedure. --- guix/scripts/pack.scm | 270 ++++++++++++++++++++++-------------------- 1 file changed, 141 insertions(+), 129 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 8cb4e6d2cc..ac477850e6 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -172,22 +172,17 @@ dependencies are registered." (computed-file "store-database" build #:options `(#:references-graphs ,(zip labels items)))) -(define* (self-contained-tarball name profile - #:key target - (profile-name "guix-profile") - deduplicate? - entry-point - (compressor (first %compressors)) - localstatedir? - (symlinks '()) - (archiver tar)) - "Return a self-contained tarball containing a store initialized with the -closure of PROFILE, a derivation. The tarball contains /gnu/store; if -LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db -with a properly initialized store database. - -SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be -added to the pack." + +;;; +;;; Tarball format. +;;; +(define* (self-contained-tarball/builder profile + #:key (profile-name "guix-profile") + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return the G-Expression of the builder used for self-contained-tarball." (define database (and localstatedir? (file-append (store-database (list profile)) @@ -209,125 +204,142 @@ added to the pack." (and (not-config? module) (not (equal? '(guix store deduplication) module)))) - (define build - (with-imported-modules (source-module-closure - `((guix build utils) - (guix build union) - (gnu build install)) - #:select? import-module?) - #~(begin - (use-modules (guix build utils) - ((guix build union) #:select (relative-file-name)) - (gnu build install) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 match)) + (with-imported-modules (source-module-closure + `((guix build utils) + (guix build union) + (gnu build install)) + #:select? import-module?) + #~(begin + (use-modules (guix build utils) + ((guix build union) #:select (relative-file-name)) + (gnu build install) + (srfi srfi-1) + (srfi srfi-26) + (ice-9 match)) + + (define %root "root") + + (define symlink->directives + ;; Return "populate directives" to make the given symlink and its + ;; parent directories. + (match-lambda + ((source '-> target) + (let ((target (string-append #$profile "/" target)) + (parent (dirname source))) + ;; Never add a 'directory' directive for "/" so as to + ;; preserve its ownnership when extracting the archive (see + ;; below), and also because this would lead to adding the + ;; same entries twice in the tarball. + `(,@(if (string=? parent "/") + '() + `((directory ,parent))) + (,source + -> ,(relative-file-name parent target))))))) + + (define directives + ;; Fully-qualified symlinks. + (append-map symlink->directives '#$symlinks)) + + ;; The --sort option was added to GNU tar in version 1.28, released + ;; 2014-07-28. For testing, we use the bootstrap tar, which is + ;; older and doesn't support it. + (define tar-supports-sort? + (zero? (system* (string-append #+archiver "/bin/tar") + "cf" "/dev/null" "--files-from=/dev/null" + "--sort=name"))) + + ;; Make sure non-ASCII file names are properly handled. + #+set-utf8-locale + + ;; Add 'tar' to the search path. + (setenv "PATH" #+(file-append archiver "/bin")) + + ;; Note: there is not much to gain here with deduplication and there + ;; is the overhead of the '.links' directory, so turn it off. + ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs + ;; with hard links: + ;; . + (populate-single-profile-directory %root + #:profile #$profile + #:profile-name #$profile-name + #:closure "profile" + #:database #+database) + + ;; Create SYMLINKS. + (for-each (cut evaluate-populate-directive <> %root) + directives) + + ;; Create the tarball. Use GNU format so there's no file name + ;; length limitation. + (with-directory-excursion %root + (apply invoke "tar" + #+@(if (compressor-command compressor) + #~("-I" + (string-join + '#+(compressor-command compressor))) + #~()) + "--format=gnu" + ;; Avoid non-determinism in the archive. + ;; Use mtime = 1, not zero, because that is what the daemon + ;; does for files in the store (see the 'mtimeStore' constant + ;; in local-store.cc.) + (if tar-supports-sort? "--sort=name" "--mtime=@1") + "--owner=root:0" + "--group=root:0" + "--check-links" + "-cvf" #$output + ;; Avoid adding / and /var to the tarball, so + ;; that the ownership and permissions of those + ;; directories will not be overwritten when + ;; extracting the archive. Do not include /root + ;; because the root account might have a + ;; different home directory. + #$@(if localstatedir? + '("./var/guix") + '()) + + (string-append "." (%store-directory)) + + (delete-duplicates + (filter-map (match-lambda + (('directory directory) + (string-append "." directory)) + ((source '-> _) + (string-append "." source)) + (_ #f)) + directives))))))) - (define %root "root") - - (define symlink->directives - ;; Return "populate directives" to make the given symlink and its - ;; parent directories. - (match-lambda - ((source '-> target) - (let ((target (string-append #$profile "/" target)) - (parent (dirname source))) - ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownnership when extracting the archive (see - ;; below), and also because this would lead to adding the - ;; same entries twice in the tarball. - `(,@(if (string=? parent "/") - '() - `((directory ,parent))) - (,source - -> ,(relative-file-name parent target))))))) - - (define directives - ;; Fully-qualified symlinks. - (append-map symlink->directives '#$symlinks)) - - ;; The --sort option was added to GNU tar in version 1.28, released - ;; 2014-07-28. For testing, we use the bootstrap tar, which is - ;; older and doesn't support it. - (define tar-supports-sort? - (zero? (system* (string-append #+archiver "/bin/tar") - "cf" "/dev/null" "--files-from=/dev/null" - "--sort=name"))) - - ;; Make sure non-ASCII file names are properly handled. - #+set-utf8-locale - - ;; Add 'tar' to the search path. - (setenv "PATH" #+(file-append archiver "/bin")) - - ;; Note: there is not much to gain here with deduplication and there - ;; is the overhead of the '.links' directory, so turn it off. - ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs - ;; with hard links: - ;; . - (populate-single-profile-directory %root - #:profile #$profile - #:profile-name #$profile-name - #:closure "profile" - #:database #+database) - - ;; Create SYMLINKS. - (for-each (cut evaluate-populate-directive <> %root) - directives) - - ;; Create the tarball. Use GNU format so there's no file name - ;; length limitation. - (with-directory-excursion %root - (exit - (zero? (apply system* "tar" - #+@(if (compressor-command compressor) - #~("-I" - (string-join - '#+(compressor-command compressor))) - #~()) - "--format=gnu" - - ;; Avoid non-determinism in the archive. Use - ;; mtime = 1, not zero, because that is what the - ;; daemon does for files in the store (see the - ;; 'mtimeStore' constant in local-store.cc.) - (if tar-supports-sort? "--sort=name" "--mtime=@1") - "--mtime=@1" ;for files in /var/guix - "--owner=root:0" - "--group=root:0" - - "--check-links" - "-cvf" #$output - ;; Avoid adding / and /var to the tarball, so - ;; that the ownership and permissions of those - ;; directories will not be overwritten when - ;; extracting the archive. Do not include /root - ;; because the root account might have a - ;; different home directory. - #$@(if localstatedir? - '("./var/guix") - '()) - - (string-append "." (%store-directory)) - - (delete-duplicates - (filter-map (match-lambda - (('directory directory) - (string-append "." directory)) - ((source '-> _) - (string-append "." source)) - (_ #f)) - directives))))))))) +(define* (self-contained-tarball name profile + #:key target + (profile-name "guix-profile") + deduplicate? + entry-point + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return a self-contained tarball containing a store initialized with the +closure of PROFILE, a derivation. The tarball contains /gnu/store; if +LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db +with a properly initialized store database. +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." (when entry-point (warning (G_ "entry point not supported in the '~a' format~%") 'tarball)) - (gexp->derivation (string-append name ".tar" - (compressor-extension compressor)) - build - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation + (string-append name ".tar" + (compressor-extension compressor)) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:target target + #:references-graphs `(("profile" ,profile)))) (define (singularity-environment-file profile) "Return a shell script that defines the environment variables corresponding -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:45 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:45 +0000 Received: from localhost ([127.0.0.1]:35187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAr-0006aa-9V for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:45 -0400 Received: from mail-qt1-f172.google.com ([209.85.160.172]:42567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAp-0006aH-Lk for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:44 -0400 Received: by mail-qt1-f172.google.com with SMTP id x21so3454466qtq.9 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z1X73fhCPAWV4PwnGSeUz2Pz/GvBtru7kZ+p33Emoek=; b=GuVtRoLhhdpOGPTdMwy4gt9GgE4WvLvEzCfMaMuukpbekRumujLdSylI/6F3d8n9pM 79/TgxkIeUhFvSu6QC9lfDd7ahTnA56X9gDbrKlrFeHlvPTKHpZVyIxUxLkEh6eieqy4 fSy9f5BW1PiAuzBl/OV7NrBsLGQ0d1xkqgJ2cq2bshhwbDjohk6MjpF+GyGoW/EsVUbG 3XmYwnEjvIcx/pICaJfNFrdHLbTMkvwqwbtELRfNiUMZypT9xwmodWjzWJOiXBMvuVvk PRP+1bEztvVZ8mvwNGjILazJkfkwxD6YEVruG8NBmbUrVFY4ce0TmMgNYY7anTa6byCY hcXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z1X73fhCPAWV4PwnGSeUz2Pz/GvBtru7kZ+p33Emoek=; b=LkhCCkQYItm/AfKyqsK9twi70loI7xqOkTIYV8AcAGQDmRRpO08zaQlax4GhZ/Rblx OQyWh3G+P+vtMuMFU2FHi6kaGbg30rnjGRnnFlOfbeukZ9lhMzsU89YYEfUWlJLlHht8 3qngbNv3BpYx0DtQJpH62rWchp+Fc8y6C+5BFHcnNgLw9hauRLdCvOEc4MuSmQRUzHNY IEcQ2x/+i31pChYlcdTrhKpEcZ0hpacQSipwYtPQBjjtfvm+C2EAe/WisVFJuTwA6gwN GowYbOKWLP/tyuvKLo4Tk1OctbHIw0FuY5ILyAOwQwHvvCCJPX6y3K0E9RteVZN+gX/L FAyg== X-Gm-Message-State: AOAM5301yz6SJbMJa3Vz1Qai6kkbAg6DpUleDIkrO8GX+rqwBcolfChD fGpnZOJZP+9jVObWYwQZlDwROtTp0jNi7A== X-Google-Smtp-Source: ABdhPJy7aedqmMEGhYnzMyYOWC2VuLOhQuuTQ1+xIYxITN/jYtZ4S57u6YSJf1Pzm65/QAwssLXwvA== X-Received: by 2002:ac8:7516:: with SMTP id u22mr22216679qtq.160.1624255958050; Sun, 20 Jun 2021 23:12:38 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:37 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH] tentatively reuse rlib for cargo-build-system Date: Mon, 21 Jun 2021 02:11:59 -0400 Message-Id: <20210621061205.31878-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) --- guix/build-system/cargo.scm | 3 +- guix/build/cargo-build-system.scm | 78 ++++++++++++++++++++++++++----- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index e53d2a7523..9ef9f6b149 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -271,7 +271,8 @@ any dependent crates. This can be a benefits: (build-inputs `(("cargo" ,rust "cargo") ("rustc" ,rust) ,@(expand-crate-sources cargo-inputs cargo-development-inputs) - ,@native-inputs)) + ,@native-inputs + ,@(if target '() inputs))) (outputs outputs) (build cargo-build) (arguments (strip-keyword-arguments private-keywords arguments))))) diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 0a95672b00..e68f20e463 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,7 +25,7 @@ (define-module (guix build cargo-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build json) - #:use-module (guix build utils) + #:use-module ((guix build utils) #:hide (delete)) #:use-module (guix build cargo-utils) #:use-module (ice-9 popen) #:use-module (ice-9 rdelim) @@ -34,7 +35,10 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases - cargo-build)) + cargo-build + + rust-version + rust-library-prefix)) ;; Commentary: ;; @@ -42,6 +46,25 @@ ;; ;; Code: +(define (rust-version rust) + "Return the version triplet (major.minor.patch) as a string, given RUST, a +store file name." + (let* ((version (last (string-split rust #\-))) + (components (string-split version #\.)) + (major+minor+patch (take components 3))) + (string-join major+minor+patch "."))) + +(define (rust-library-prefix/relative inputs) + "Return the relative versioned Rust library prefix where Rust libraries are +to be installed." + (string-append "lib/rust/" (rust-version (assoc-ref inputs "rustc")))) + +(define (rust-library-prefix inputs outputs) + "Return the absolute versioned Rust library prefix where Rust libraries are +to be installed." + (string-append (assoc-ref outputs "out") "/" + (rust-library-prefix/relative inputs))) + (define (manifest-targets) "Extract all targets from the Cargo.toml manifest" (let* ((port (open-input-pipe "cargo read-manifest")) @@ -73,6 +96,16 @@ Cargo.toml file present at its root." " | cut -d/ -f2" " | grep -q '^Cargo.toml$'"))))) +(define (rlib? file) + "Check if FILE has the .rlib extension." + (string-suffix? ".rlib" file)) + +(define (inputs->directories inputs) + "Extract the directory part from INPUTS." + (match inputs + (((names . directories) ...) + directories))) + (define* (unpack-rust-crates #:key inputs vendor-dir #:allow-other-keys) (define (inputs->rust-inputs inputs) "Filter using the label part from INPUTS." @@ -80,11 +113,6 @@ Cargo.toml file present at its root." (match input ((name . _) (rust-package? name)))) inputs)) - (define (inputs->directories inputs) - "Extract the directory part from INPUTS." - (match inputs - (((names . directories) ...) - directories))) (let ((rust-inputs (inputs->directories (inputs->rust-inputs inputs)))) (unless (null? rust-inputs) @@ -185,6 +213,22 @@ directory = '" port) (generate-all-checksums vendor-dir) #t) +(define* (populate-cargo-cache #:key inputs outputs #:allow-other-keys) + "Populate the 'target/release' directory with any pre-built Rust libraries, +to avoid rebuilding them from sources when possible." + (let* ((rust-lib-prefix (rust-library-prefix/relative inputs)) + (input-dirs (inputs->directories inputs)) + (rust-lib-dirs (filter (lambda (f) + (file-exists? (string-append + f "/" rust-lib-prefix))) + input-dirs)) + (rlibs (delete-duplicates (append-map (cut find-files <> "\\.rlib$") + rust-lib-dirs)))) + (pk 'rust-lib-dirs rust-lib-dirs) + (pk 'rlibs rlibs) + (for-each (cut install-file <> "target/release") rlibs) + (invoke "find" "target"))) + (define* (build #:key skip-build? (features '()) @@ -228,7 +272,9 @@ directory = '" port) "Install a given Cargo package." (let* ((out (assoc-ref outputs "out")) (registry (string-append out "/share/cargo/registry")) - (sources (string-append out "/share/cargo/src"))) + (sources (string-append out "/share/cargo/src")) + (libdir (rust-library-prefix inputs outputs)) + (release-dir "target/release")) (mkdir-p out) ;; Make cargo reuse all the artifacts we just built instead @@ -237,10 +283,17 @@ directory = '" port) ;; Only install crates which include binary targets, ;; otherwise cargo will raise an error. - (or skip-build? - (not (has-executable-target?)) - (invoke "cargo" "install" "--no-track" "--path" "." "--root" out - "--features" (string-join features))) + (unless skip-build? + ;; Install binaries. + (when (has-executable-target?) + (apply invoke "cargo" "install" "--no-track" "--path" "." "--root" out + (if (not (null? features)) + (list "--features" (string-join features)) + '()))) + ;; Install static libraries. + (for-each (lambda (file) + (install-file (string-append release-dir "/" file) libdir)) + (scandir release-dir (cut string-suffix? ".rlib" <>)))) (when install-source? ;; Install crate tarballs and unpacked sources for later use. @@ -260,6 +313,7 @@ directory = '" port) (modify-phases gnu:%standard-phases (delete 'bootstrap) (replace 'configure configure) + (add-before 'build 'populate-cargo-cache populate-cargo-cache) (replace 'build build) (replace 'check check) (replace 'install install) -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:49 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:49 +0000 Received: from localhost ([127.0.0.1]:35191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAu-0006ax-OR for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:49 -0400 Received: from mail-qt1-f169.google.com ([209.85.160.169]:42567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAt-0006aO-17 for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:47 -0400 Received: by mail-qt1-f169.google.com with SMTP id x21so3454528qtq.9 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gc0uudKTiV1MlAuoJBX9RmBclzpzaZS/bhTN4i4HSAc=; b=VMtNAKLThCS/r7L6ITtGefRp+lUh6+YKa6HNuA4eUkWgQfC9yS8b+aB3/c8pV2m88v HP+bGaLadeTHWwOMuabJZCte3ZZgjJ9wU5LiVB5eObHTELeqo1iLr7flYKgMdktZN/lz Z5HToijy6S7slBGekstuSpda4ncm6x5rxW8t1T+nXSKJZfJJuOoTJm0Qx5biAZRy5aWQ 9AE+AJzhWnAo9Jz9EhytqlRx898xw7/Rfbch8rAIzIPtXacK2v0OV7grP5eZjUs8Q04E vqbfhRSxdSRNNr3ukSH6phFP13zyezayRtJUkF4ehXE+MATdauOsD0IZpVJAl7PdRmXR VcFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gc0uudKTiV1MlAuoJBX9RmBclzpzaZS/bhTN4i4HSAc=; b=ixixVNOj8pam9bbTWSRxmu0k/87qdycjtjBRRGs8Zh4cvVNtkGOsXxe58f/2b9+jJt QaUrE4SwJp6IxFB8WBEWrDMQeUOv9piL78NBw2fX3CMP7XN2Gude4Q1DqRuzIF3ZnPy4 u0bgEaWhmQaWiSB026nTkUMf+3g3K1M61xbgb0SyuCjo6JYR3owsChi/uy8PldAEuMZo 9LcvPk90UC848eavsxWrBRufky0dECan4ASoX6pbne6S3PW2qwsH29IlgkadClLP8ksn e1iU1QBEYc4jVlpVQdw3U8PHjBQcmmkVoLpFGIA6jrCtVF0ftOLpN6hX+HToo8i1dJKf 38IQ== X-Gm-Message-State: AOAM530uV017XAIROqlvHbE29ruecc4zdLRtOgPMEOdLNNr8CCWLZHzV 69U1mTR8+WXJAtlX875vM+LxrSRXAiNAvQ== X-Google-Smtp-Source: ABdhPJzSKFErKl79zhc2Cp1FpeRgLiShJJ6JCLbBq47fbd+MYSIQyKBLdLc1/6GhB0rjeMPNmWuBnA== X-Received: by 2002:ac8:6a09:: with SMTP id t9mr3903074qtr.118.1624255961494; Sun, 20 Jun 2021 23:12:41 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:41 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 2/7] pack: Factorize base tar options. Date: Mon, 21 Jun 2021 02:12:00 -0400 Message-Id: <20210621061205.31878-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * guix/docker.scm (%tar-determinism-options): Move to a new module and rename to `tar-base-options'. Adjust references accordingly. * guix/build/pack.scm: New file. * Makefile.am (MODULES): Register it. * guix/scripts/pack.scm (self-contained-tarball/builder): Use it. --- Makefile.am | 1 + guix/build/pack.scm | 52 +++++++++++++++++++++++++++ guix/docker.scm | 20 ++--------- guix/scripts/pack.scm | 81 +++++++++++++++++-------------------------- 4 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 guix/build/pack.scm diff --git a/Makefile.am b/Makefile.am index aa21b5383b..9c4b33c77a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -220,6 +220,7 @@ MODULES = \ guix/build/linux-module-build-system.scm \ guix/build/store-copy.scm \ guix/build/json.scm \ + guix/build/pack.scm \ guix/build/utils.scm \ guix/build/union.scm \ guix/build/profiles.scm \ diff --git a/guix/build/pack.scm b/guix/build/pack.scm new file mode 100644 index 0000000000..05c7a3c594 --- /dev/null +++ b/guix/build/pack.scm @@ -0,0 +1,52 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Maxim Cournoyer +;;; +;;; 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 build pack) + #:use-module (guix build utils) + #:export (tar-base-options)) + +(define* (tar-base-options #:key tar compressor) + "Return the base GNU tar options required to produce deterministic archives +deterministically. When TAR, a GNU tar command file name, is provided, the +`--sort' option is used only if supported. When COMPRESSOR, a command such as +'(\"gzip\" \"-9n\"), is provided, the compressor is explicitly specified via +the `-I' option." + (define (tar-supports-sort? tar) + (zero? (system* tar "cf" "/dev/null" "--files-from=/dev/null" + "--sort=name"))) + + `(,@(if compressor + (list "-I" (string-join compressor)) + '()) + ;; The --sort option was added to GNU tar in version 1.28, released + ;; 2014-07-28. For testing, we use the bootstrap tar, which is older + ;; and doesn't support it. + ,@(if (and=> tar tar-supports-sort?) + '("--sort=name") + '()) + ;; Use GNU format so there's no file name length limitation. + "--format=gnu" + "--mtime=@1" + "--owner=root:0" + "--group=root:0" + ;; The 'nlink' of the store item files leads tar to store hard links + ;; instead of actual copies. However, the 'nlink' count depends on + ;; deduplication in the store; it's an "implicit input" to the build + ;; process. Use '--hard-dereference' to eliminate it. + "--hard-dereference" + "--check-links")) diff --git a/guix/docker.scm b/guix/docker.scm index 889aaeacb5..bd952e45ec 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -21,6 +21,7 @@ (define-module (guix docker) #:use-module (gcrypt hash) #:use-module (guix base16) + #:use-module (guix build pack) #:use-module ((guix build utils) #:select (mkdir-p delete-file-recursively @@ -110,18 +111,6 @@ Return a version of TAG that follows these rules." (rootfs . ((type . "layers") (diff_ids . #(,(layer-diff-id layer))))))) -(define %tar-determinism-options - ;; GNU tar options to produce archives deterministically. - '("--sort=name" "--mtime=@1" - "--owner=root:0" "--group=root:0" - - ;; When 'build-docker-image' is passed store items, the 'nlink' of the - ;; files therein leads tar to store hard links instead of actual copies. - ;; However, the 'nlink' count depends on deduplication in the store; it's - ;; an "implicit input" to the build process. '--hard-dereference' - ;; eliminates it. - "--hard-dereference")) - (define directive-file ;; Return the file or directory created by a 'evaluate-populate-directive' ;; directive. @@ -238,7 +227,7 @@ SRFI-19 time-utc object, as the creation time in metadata." (apply invoke "tar" "-cf" "../layer.tar" `(,@transformation-options - ,@%tar-determinism-options + ,@(tar-base-options) ,@paths ,@(scandir "." (lambda (file) @@ -273,9 +262,6 @@ SRFI-19 time-utc object, as the creation time in metadata." (scm->json (repositories prefix id repository))))) (apply invoke "tar" "-cf" image "-C" directory - `(,@%tar-determinism-options - ,@(if compressor - (list "-I" (string-join compressor)) - '()) + `(,@(tar-base-options #:compressor compressor) ".")) (delete-file-recursively directory))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index ac477850e6..d11f498925 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -205,12 +205,14 @@ dependencies are registered." (not (equal? '(guix store deduplication) module)))) (with-imported-modules (source-module-closure - `((guix build utils) + `((guix build pack) + (guix build utils) (guix build union) (gnu build install)) #:select? import-module?) #~(begin - (use-modules (guix build utils) + (use-modules (guix build pack) + (guix build utils) ((guix build union) #:select (relative-file-name)) (gnu build install) (srfi srfi-1) @@ -240,19 +242,10 @@ dependencies are registered." ;; Fully-qualified symlinks. (append-map symlink->directives '#$symlinks)) - ;; The --sort option was added to GNU tar in version 1.28, released - ;; 2014-07-28. For testing, we use the bootstrap tar, which is - ;; older and doesn't support it. - (define tar-supports-sort? - (zero? (system* (string-append #+archiver "/bin/tar") - "cf" "/dev/null" "--files-from=/dev/null" - "--sort=name"))) - ;; Make sure non-ASCII file names are properly handled. #+set-utf8-locale - ;; Add 'tar' to the search path. - (setenv "PATH" #+(file-append archiver "/bin")) + (define tar #+(file-append archiver "/bin/tar")) ;; Note: there is not much to gain here with deduplication and there ;; is the overhead of the '.links' directory, so turn it off. @@ -269,45 +262,33 @@ dependencies are registered." (for-each (cut evaluate-populate-directive <> %root) directives) - ;; Create the tarball. Use GNU format so there's no file name - ;; length limitation. + ;; Create the tarball. (with-directory-excursion %root - (apply invoke "tar" - #+@(if (compressor-command compressor) - #~("-I" - (string-join - '#+(compressor-command compressor))) - #~()) - "--format=gnu" - ;; Avoid non-determinism in the archive. - ;; Use mtime = 1, not zero, because that is what the daemon - ;; does for files in the store (see the 'mtimeStore' constant - ;; in local-store.cc.) - (if tar-supports-sort? "--sort=name" "--mtime=@1") - "--owner=root:0" - "--group=root:0" - "--check-links" - "-cvf" #$output - ;; Avoid adding / and /var to the tarball, so - ;; that the ownership and permissions of those - ;; directories will not be overwritten when - ;; extracting the archive. Do not include /root - ;; because the root account might have a - ;; different home directory. - #$@(if localstatedir? - '("./var/guix") - '()) - - (string-append "." (%store-directory)) - - (delete-duplicates - (filter-map (match-lambda - (('directory directory) - (string-append "." directory)) - ((source '-> _) - (string-append "." source)) - (_ #f)) - directives))))))) + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor '#+(and=> compressor compressor-command)) + "-cvf" ,#$output + ;; Avoid adding / and /var to the tarball, so + ;; that the ownership and permissions of those + ;; directories will not be overwritten when + ;; extracting the archive. Do not include /root + ;; because the root account might have a + ;; different home directory. + ,#$@(if localstatedir? + '("./var/guix") + '()) + + ,(string-append "." (%store-directory)) + + ,@(delete-duplicates + (filter-map (match-lambda + (('directory directory) + (string-append "." directory)) + ((source '-> _) + (string-append "." source)) + (_ #f)) + directives)))))))) (define* (self-contained-tarball name profile #:key target -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:51 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:51 +0000 Received: from localhost ([127.0.0.1]:35196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAx-0006bL-A0 for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:51 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:45759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAu-0006aQ-9C for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:48 -0400 Received: by mail-qk1-f176.google.com with SMTP id d196so27550604qkg.12 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bR9tBuVVnovRAAc1CVUMdkJDi9V0lhIZZj6dRJ9yP0o=; b=BWOce8oJDqbC97s8D4c5eFV+il2QIg5dsCR3qEjkjNQf9OgyBlv+EIA5q2KHSX7DLb xkW1cnpjWXfmyW3rjdiqP6ytQE/5mpefkOPPfJ/L1P/U1nqVKL+DPuxsEkXRvr7u/adM 2XloMCslDy5Huifu08vsYQwiMc5uYWtPeZHfK9RcYmd3e6XS6NvgrHy8D14HYRRuJshX mRnSrBMBevvZ3+gAF+nsrLG1uiQRwGhJ25e7TZlU2njiVhiHJl7FnkXpFzRoRRLrl6la 4ca1j6MXmxA500XccL7SSKc9mlIUDALY6n90Bfh1GGXUUxm5SM7F9b47WGY78aJyxVBK 6hYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bR9tBuVVnovRAAc1CVUMdkJDi9V0lhIZZj6dRJ9yP0o=; b=dEQx6ra/4DHysfZ6509bLfMTFkLxBEizxZ+ru66EkVjnS0ViyanFaIo96UD6Ish0p3 K+/B1QMb2LJjMXcbxSMoldaS7h0l0coUB4KWU7oYa4yU2BppYFaOZGX4gOW3r4IWZHoO xMfjypdm2y0roakaAMwlMOhQK7sI0w0AMDlGon3+GAD+WwgNV0qKRCDsXiU3VTaRyd83 1qpQaNRmKXQfDvAAYI14u4u0pD6spiZMeeBCM+AfDg8qUB3z9aqEGAWgfLH/umNDTWKi RDkXdotF6zuZ7Zpn33ZxYP7pKtpcSgPmq8cYrJBCeYTazN8k1loMHMQbhVXGZqxqbAjv ZZKQ== X-Gm-Message-State: AOAM530I6dbmgvjBu1aaSxJYY6sIVIbol7wf8Nx4MfddRqavEbg2Gj5U 60X/o1w2RrOvw3JhkaYyq6hClU/yTeZGDw== X-Google-Smtp-Source: ABdhPJytNnR+5KIX9ya27YgyCqL7Wrk/wTk2cJJb7shuSQkvLiEteqEZMOmNTtU5zcslvfjKmdqfAw== X-Received: by 2002:a37:684b:: with SMTP id d72mr21825313qkc.372.1624255962848; Sun, 20 Jun 2021 23:12:42 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:42 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 3/7] pack: Fix typo. Date: Mon, 21 Jun 2021 02:12:01 -0400 Message-Id: <20210621061205.31878-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * guix/scripts/pack.scm (self-contained-tarball/builder): Fix typo. --- guix/scripts/pack.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d11f498925..7ea97a4b7a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -229,7 +229,7 @@ dependencies are registered." (let ((target (string-append #$profile "/" target)) (parent (dirname source))) ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownnership when extracting the archive (see + ;; preserve its ownership when extracting the archive (see ;; below), and also because this would lead to adding the ;; same entries twice in the tarball. `(,@(if (string=? parent "/") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:51 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:51 +0000 Received: from localhost ([127.0.0.1]:35198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAx-0006bN-Gw for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:51 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:35488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAv-0006aX-QZ for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:50 -0400 Received: by mail-qk1-f171.google.com with SMTP id q190so24939267qkd.2 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v/TsY7TUeHjjKKjuzsJGN8fmXHrFAsNNkILKEI0FWYI=; b=psYIXNjXvH5cb+0EF/NWbr4FsWM9hxGZtBWYR7uOi1B35tkfUaSjAZXFWKLuFzLsel qtD9Oo39SCICdu3OdDUMmjLu0J5VaDwUS1yJwDi1i0VD0u8hNNPYz+aeYPawpiySTmck gpffgNAyuxZXGMsKN3nZlfz9gtuUDDzYY0Q4sz2DsGaAZlz/SGdcB5vvTeVe5ylnmnM9 2mOPtzaoi4jmF3879rEqkIuK9fMufbdCAKSy/I6h9M3JNECmE9M0+Dtek6UUDUpxVbDO 8EWgq0OGnpASysqFKnyr5gvbWcPRr31UP1Pdq7sKtdO0MociXU2iAZlj3oqvUyjZ7Kiy nhRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v/TsY7TUeHjjKKjuzsJGN8fmXHrFAsNNkILKEI0FWYI=; b=hA1ZlTMMIGi5WCY0kYsmKFbcOLu91dk+1fskjEDB2aIZ+GmtipeF6UpT8eXi8kAoDW KJOyxdl20gHd3LlmLS2ggoSxwNiPa5ItiwolS/opd+OIWcKjnsaBltCAXAOKzWLNfYo4 zfvytCer1sfcn6h7dpBIs3TENhMQmX4PlFpZMU8brm43UqEG2fE7OXlOtiH83A6u9h71 UeM4ZUSpToAK52WBD0kgAqch/tQkLKCNSKEjWjouC/KUGb51L90V/7Z7/TvImK25iSTR 0O3l9+VQd4o0FBDKXDfFPoMmPsqxCvCuEAwCTJK5Qx6a0NzF+SLWKMcZi010RDedVsd6 v7oA== X-Gm-Message-State: AOAM532VOpkz029g2eZxwWrNBFBWbytR8geNsRohhVQLOuGCNY0vCaqR HDK6QccmmhT0GnEtCXhRejk5J5CEp+B2Jw== X-Google-Smtp-Source: ABdhPJzbtxaphj68wsORpAEvS4vDRtmaaEqjsmZG3TITxky8WVa0EdK3ORNaU1OUejpORE+NrW0/qA== X-Received: by 2002:a37:b881:: with SMTP id i123mr21390929qkf.207.1624255964252; Sun, 20 Jun 2021 23:12:44 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:44 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 4/7] pack: Improve naming of the packs store file names. Date: Mon, 21 Jun 2021 02:12:02 -0400 Message-Id: <20210621061205.31878-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) Instead of just naming them by their pack type, add information from the package(s) they contain to make it easier to differentiate them. * guix/scripts/pack.scm (manifest->friendly-name): Extract procedure from ... (docker-image): ... here. Adjust REPOSITORY argument value accordingly. (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. --- guix/scripts/pack.scm | 44 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7ea97a4b7a..9d4bb9f497 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -172,6 +172,23 @@ dependencies are registered." (computed-file "store-database" build #:options `(#:references-graphs ,(zip labels items)))) +;;; XXX: The following procedure has to *also* be used in the build side +;;; G-Exp, because PROFILE is passed as a derivation in the tests. +(define define-manifest->friendly-name + '(define (manifest->friendly-name manifest) + "Return a friendly name computed from the entries in MANIFEST, a + object." + (let loop ((names (map manifest-entry-name + (manifest-entries manifest)))) + (define str (string-join names "-")) + (if (< (string-length str) 40) + str + (match names + ((_) str) + ((names ... _) (loop names))))))) ;drop one entry + +(eval define-manifest->friendly-name (current-module)) + ;;; ;;; Tarball format. @@ -540,7 +557,7 @@ the image." (file-append (store-database (list profile)) "/db/db.sqlite"))) - (define defmod 'define-module) ;trick Geiser + (define defmod 'define-module) ;trick Geiser (define build ;; Guile-JSON and Guile-Gcrypt are required by (guix docker). @@ -558,6 +575,8 @@ the image." (srfi srfi-1) (srfi srfi-19) (ice-9 match)) + #$define-manifest->friendly-name + (define environment (map (match-lambda ((spec . value) @@ -581,19 +600,6 @@ the image." `((directory "/tmp" ,(getuid) ,(getgid) #o1777) ,@(append-map symlink->directives '#$symlinks))) - (define tag - ;; Compute a meaningful "repository" name, which will show up in - ;; the output of "docker images". - (let ((manifest (profile-manifest #$profile))) - (let loop ((names (map manifest-entry-name - (manifest-entries manifest)))) - (define str (string-join names "-")) - (if (< (string-length str) 40) - str - (match names - ((_) str) - ((names ... _) (loop names))))))) ;drop one entry - (setenv "PATH" #+(file-append archiver "/bin")) (build-docker-image #$output @@ -601,7 +607,8 @@ the image." (call-with-input-file "profile" read-reference-graph)) #$profile - #:repository tag + #:repository (manifest->friendly-name + (profile-manifest #$profile)) #:database #+database #:system (or #$target %host-type) #:environment environment @@ -1209,8 +1216,6 @@ Create a bundle of PACKAGE.\n")) manifest) manifest))) (pack-format (assoc-ref opts 'format)) - (name (string-append (symbol->string pack-format) - "-pack")) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) (compressor (if bootstrap? @@ -1244,7 +1249,10 @@ Create a bundle of PACKAGE.\n")) (hooks (if bootstrap? '() %default-profile-hooks)) - (locales? (not bootstrap?))))) + (locales? (not bootstrap?)))) + (name (string-append (manifest->friendly-name manifest) + "-" (symbol->string pack-format) + "-pack"))) (define (lookup-package package) (manifest-lookup manifest (manifest-pattern (name package)))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:52 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:52 +0000 Received: from localhost ([127.0.0.1]:35200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAx-0006bU-RU for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:52 -0400 Received: from mail-qv1-f41.google.com ([209.85.219.41]:36371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAw-0006aY-B0 for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:50 -0400 Received: by mail-qv1-f41.google.com with SMTP id im10so6893973qvb.3 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9sYSuoxh/TXX0vpZJIGqEGuZnOV29nWz3iCoA1cYbX4=; b=jIeO8o2AdhRHLnGOzTu6AGjp0/kTxZ4lzWCmSNYQ3X/7LL+3v0WSaq9x6FZ3T8x7x5 5o/TImIr9ZXSRqnW3UTXZ9Vw4yf8RysFt1kGT8a9b5bLXE9gtz5+EytNTFJZpY6HLnHN JCObUfKTG2lrO4Ai3FjR+TUI7089/LRAHVUF5WecUf7sBfBmcQTV2qneAG6NDNUYdACh Iz4TyNCvAcd8IzpipIp/HYbUgYGQP9O0eCbtEvEsplyJlyMKAEhGDjW/Bc575fYy/g0J 4mvCHxrax2zZo6WS/O4x5v/ar8Uu31YaFitZWaBTq249/6A19Ka+/F+c+twJpEPjgmzC t5rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9sYSuoxh/TXX0vpZJIGqEGuZnOV29nWz3iCoA1cYbX4=; b=KEo0e1WysN2ez6pFhzgTi3PT4zTnpR5C9EghqVjpdE9KYFouoDS+SVKrxaiT1lsBHn RMyMtK+30qhS4eQO4m4ZHTeVgF9le2QI81U01YaFig+ZIvtBQnSv3lvmNGx3fFeVngfI FUXW2D3xDO2OMYAosgvDK+EFdNJ3I47t/Z77ERckZIoQz1jPbMEGPymK/skGOeHSSfN3 DIG28Pe0xbUrlhzHF0zszTTEWaZFQFFF+Cp9S8IGNFvUXt5ckBKI/Cu2apX/q06Yc7XM i0IwSROnKSrU/oX1r1ksZeORYEqIKYftHnmbU/nvLVWGKm9u3Zhx7HqThusntkkCap+K Prxg== X-Gm-Message-State: AOAM533w14lXECziEQjjPi1RUeJdpRpPRdqSZvHExOSmT9V4QH8+9guS TfNuFoQgzG6qELFPegeAwwst3+fKtE02RA== X-Google-Smtp-Source: ABdhPJwKELnPF5QJFXzuk1HcuLong5Lm4ltkdpl7qGX0ryWnzz/b0dHEZr6hdC7un+BNsGY+lURLhg== X-Received: by 2002:a05:6214:b6c:: with SMTP id ey12mr18374648qvb.48.1624255964788; Sun, 20 Jun 2021 23:12:44 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:44 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 5/7] pack: Prevent duplicate files in tar archives. Date: Mon, 21 Jun 2021 02:12:03 -0400 Message-Id: <20210621061205.31878-6-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) Tar translate duplicate files in the archive into hard links. These can cause problems, as not every tool support them; for example dpkg doesn't. * gnu/system/file-systems.scm (reduce-directories): New procedure. (file-prefix?): Lift the restriction on file prefix. The procedure can be useful for comparing relative file names. Adjust doc. (file-name-depth): New procedure, extracted from ... (btrfs-store-subvolume-file-name): ... here. * guix/scripts/pack.scm (self-contained-tarball/builder): Use reduce-directories. * tests/file-systems.scm ("reduce-directories"): New test. --- gnu/system/file-systems.scm | 56 +++++++++++++++++++++++++------------ guix/scripts/pack.scm | 6 ++-- tests/file-systems.scm | 7 ++++- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 464e87cb18..fb87bfc85b 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -55,6 +55,7 @@ file-system-dependencies file-system-location + reduce-directories file-system-type-predicate btrfs-subvolume? btrfs-store-subvolume-file-name @@ -231,8 +232,8 @@ (char-set-complement (char-set #\/))) (define (file-prefix? file1 file2) - "Return #t if FILE1 denotes the name of a file that is a parent of FILE2, -where both FILE1 and FILE2 are absolute file name. For example: + "Return #t if FILE1 denotes the name of a file that is a parent of FILE2. +For example: (file-prefix? \"/gnu\" \"/gnu/store\") => #t @@ -240,19 +241,41 @@ where both FILE1 and FILE2 are absolute file name. For example: (file-prefix? \"/gn\" \"/gnu/store\") => #f " - (and (string-prefix? "/" file1) - (string-prefix? "/" file2) - (let loop ((file1 (string-tokenize file1 %not-slash)) - (file2 (string-tokenize file2 %not-slash))) - (match file1 - (() - #t) - ((head1 tail1 ...) - (match file2 - ((head2 tail2 ...) - (and (string=? head1 head2) (loop tail1 tail2))) - (() - #f))))))) + (let loop ((file1 (string-tokenize file1 %not-slash)) + (file2 (string-tokenize file2 %not-slash))) + (match file1 + (() + #t) + ((head1 tail1 ...) + (match file2 + ((head2 tail2 ...) + (and (string=? head1 head2) (loop tail1 tail2))) + (() + #f)))))) + +(define (file-name-depth file-name) + (length (string-tokenize file-name %not-slash))) + +(define (reduce-directories file-names) + "Eliminate entries in FILE-NAMES that are children of other entries in +FILE-NAMES. This is for example useful when passing a list of files to GNU +tar, which would otherwise descend into each directory passed and archive the +duplicate files as hard links, which can be undesirable." + (let* ((file-names/sorted + ;; Ascending sort by file hierarchy depth, then by file name length. + (stable-sort (delete-duplicates file-names) + (lambda (f1 f2) + (let ((depth1 (file-name-depth f1)) + (depth2 (file-name-depth f2))) + (if (= depth1 depth2) + (string< f1 f2) + (< depth1 depth2))))))) + (reverse (fold (lambda (file-name results) + (if (find (cut file-prefix? <> file-name) results) + results ;parent found -- skipping + (cons file-name results))) + '() + file-names/sorted)))) (define* (file-system-device->string device #:key uuid-type) "Return the string representations of the DEVICE field of a @@ -624,9 +647,6 @@ store is located, else #f." s (string-append "/" s))) - (define (file-name-depth file-name) - (length (string-tokenize file-name %not-slash))) - (and-let* ((btrfs-subvolume-fs (filter btrfs-subvolume? file-systems)) (btrfs-subvolume-fs* (sort btrfs-subvolume-fs diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 9d4bb9f497..8a108b7a1a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -225,13 +225,15 @@ dependencies are registered." `((guix build pack) (guix build utils) (guix build union) - (gnu build install)) + (gnu build install) + (gnu system file-systems)) #:select? import-module?) #~(begin (use-modules (guix build pack) (guix build utils) ((guix build union) #:select (relative-file-name)) (gnu build install) + ((gnu system file-systems) #:select (reduce-directories)) (srfi srfi-1) (srfi srfi-26) (ice-9 match)) @@ -298,7 +300,7 @@ dependencies are registered." ,(string-append "." (%store-directory)) - ,@(delete-duplicates + ,@(reduce-directories (filter-map (match-lambda (('directory directory) (string-append "." directory)) diff --git a/tests/file-systems.scm b/tests/file-systems.scm index 7f7c373884..80acb6d5b9 100644 --- a/tests/file-systems.scm +++ b/tests/file-systems.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2017 Ludovic Courtès -;;; Copyright © 2020 Maxim Cournoyer +;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +50,11 @@ (device "/foo") (flags '(bind-mount read-only))))))))) +(test-equal "reduce-directories" + '("./opt/gnu/" "./opt/gnuism" "a/b/c") + (reduce-directories '("./opt/gnu/etc" "./opt/gnu/" "./opt/gnu/bin" + "./opt/gnu/lib/debug" "./opt/gnuism" "a/b/c" "a/b/c"))) + (test-assert "does not pull (guix config)" ;; This module is meant both for the host side and "build side", so make ;; sure it doesn't pull in (guix config), which depends on the user's -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:12:52 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:12:52 +0000 Received: from localhost ([127.0.0.1]:35203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAy-0006bc-AU for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:52 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:40746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAw-0006ab-N8 for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:51 -0400 Received: by mail-qk1-f176.google.com with SMTP id q64so21245717qke.7 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qSAIxVQhLym4ockDJVf5oH4DzRJDWkmIYemB/0gAtOg=; b=X3x07glzHH6igBQEDCe1X0VKzpRoXE2wfiaRLbBQUsgp48SEMTsUsykilkvsv3/E7T jybBF+UQ64vkaWFcCyMir/IViAvo1PD+ArsDaxl1jk594t7wgNbne/wqenh61g0s9Gx1 /3HAXftR2IF3qCPiyKy1bR600KtRP+SEtjCMhY5+DgKGFJOWugHkmHQCXAoZ6ot+WTYH QY+frR1f3yRLnF2OdyRF7JTCTFcsNZJBRR9JFflCl9kx/cafUBZsUE11/qFjOEMp0dIq OOfHmjJ5+PVh3rNR2HE4cKqK3rjoySr2LIwuvai7Dws3fCexp9A9YZPzrmlqPVKSPIId EiOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qSAIxVQhLym4ockDJVf5oH4DzRJDWkmIYemB/0gAtOg=; b=qPCyI4FyB0RNLJbJ7F71onsbXWNnLjJOhuA2oPAlP+dX2YLkMFculbh7T2/lu5Yy0Y fxZtBzh+pEMUjURBMGb9Eb0etOyF0y7YHIHtE85UVSHFIzKIIXBVRnvft+ZoBlCMLrE7 lYXO1Dj9y1B0/xS+4OFpaeeaaGgn9nyqA7EgUwMq7hgR2R2z8VcBeSz8GXukq84NHk6s 2ES5gUQc0tmZcdQ2DQ9v1DHQaV9DtFAZNy0RbFLfyUymgCjKwiEgQWjAX0lL4fujf25X qsns+wcRr7Jmuxc5pb4L73BIfF8E2elK/GtgY5lzGfjsv0bTnD9JfXfyTJ5i0VQHo8F5 HqZw== X-Gm-Message-State: AOAM532upURzLa0dbnfYKNh7qoDYnzv/x8jmLmzsZqOB6Ql/gWRwTkXz V9gOh+Rzk71L5oDqD9hcb736bsOPoNuXHA== X-Google-Smtp-Source: ABdhPJx2nFRean3RbgAi3qaimHEW2sROIE8ouTmlwLT/QVo8uupW6mD/oNYcBzx41GD/WVECJuiYwQ== X-Received: by 2002:a05:620a:1241:: with SMTP id a1mr9236193qkl.484.1624255965377; Sun, 20 Jun 2021 23:12:45 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:45 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 6/7] tests: pack: Fix compressor extension. Date: Mon, 21 Jun 2021 02:12:04 -0400 Message-Id: <20210621061205.31878-7-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * tests/pack.scm (%gzip-compressor): Add the missing leading period to the gzip compressor file extension. --- tests/pack.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pack.scm b/tests/pack.scm index e8455b4f37..ae6247a1d5 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -51,7 +51,7 @@ (define %gzip-compressor ;; Compressor that uses the bootstrap 'gzip'. ((@ (guix scripts pack) compressor) "gzip" - "gz" + ".gz" #~(#+(file-append %bootstrap-coreutils&co "/bin/gzip") "-6n"))) (define %tar-bootstrap %bootstrap-coreutils&co) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 02:13:01 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 06:13:01 +0000 Received: from localhost ([127.0.0.1]:35205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDB6-0006c2-NT for submit@debbugs.gnu.org; Mon, 21 Jun 2021 02:13:01 -0400 Received: from mail-qv1-f46.google.com ([209.85.219.46]:34686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvDAx-0006aj-Qh for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 02:12:53 -0400 Received: by mail-qv1-f46.google.com with SMTP id 5so6884565qvf.1 for <49149@debbugs.gnu.org>; Sun, 20 Jun 2021 23:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cP3aVdwN3atijV5JRtQpUyf/pI33KDNEeFpdCFMprWc=; b=SHl1eQKVHKqVuPd/9sH+dgMrG0gkbG6Onx4fQTcAGIb5igKOvLrNdRka+StdZc7E6P Snhp6sioe1DE+rsueqH+infWtBVI8pc3h3l2OrxsDHRIJd/IbWRS7ReFV3coDJcoxp/x CdG/WQWV3NZo4sbeykboIUfETixFX/gHCefzPvtsuow6g/n1cMHOKEJUM6c/RPcb3G1/ A63LJy7lixIwnCyk9M+hlHU2GeIcfMdnkEH9D2woQGDwAx9ohGIysPgQNlnCJ9Ce7W7H txdh8/vlVDh1OVibepWS1gJGlBAsMS+s4ROkW6id/aphkx1XmYxTYA0+FXNNZjpb4iQ1 ++wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cP3aVdwN3atijV5JRtQpUyf/pI33KDNEeFpdCFMprWc=; b=d9fuPxi4f5ITPgEfnC7ZG6LJ3TkjaLyuVepNcGAZIle0RpQcYG2CZkhlV/IVwI149W f+w4DBoXax33Fd6mbG9qsYFHQxvA+Ha3NBt+wAsNnRTG8kF++nAkXXlV4ZRWEOWJKrEz 37RFuc7/eK3VBnaHYQJG5fdYKxv7tvW0lhs8ztFOvtrDTusm8bD/B0wheG+vLbj8Czt9 /dQ/ldm/T0v5azkjI/1yN/ohBKQ+75Uum/lNBsHPAclhmq4ypb0tQVxSlU/q0AzLMq66 +OsaC+2eVH777g5f5jG9IbRKEwS2KTx53yDoOXjIhv/Vknj8063olF26zQSFGsNAjDea weUA== X-Gm-Message-State: AOAM532WJgQUGgoukN78BhRtCpa6k4iV3MevupwA6MxTf2Toa31oaYPv nyT6ejx6J5R8afASZHjePCedIvKzTJ8Kjw== X-Google-Smtp-Source: ABdhPJxx/HJsl7t9dofjGf0B6ZlvfzWbdezhMM/bJtiNAriTHBN5cAzbihvCJocC711Rkkgv5aUkdg== X-Received: by 2002:ad4:4e47:: with SMTP id eb7mr18596338qvb.8.1624255966170; Sun, 20 Jun 2021 23:12:46 -0700 (PDT) Received: from localhost.localdomain (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i11sm8478663qke.74.2021.06.20.23.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:12:45 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH 7/7] pack: Add support for the deb format. Date: Mon, 21 Jun 2021 02:12:05 -0400 Message-Id: <20210621061205.31878-8-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621061205.31878-1-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule. * guix/scripts/pack.scm (debian-archive): New procedure. (%formats): Register the new deb format. (show-formats): Add it to the usage string. * tests/pack.scm (%ar-bootstrap): New variable. (deb archive with symlinks): New test. * doc/guix.texi (Invoking guix pack): Document it. --- .dir-locals.el | 1 + doc/guix.texi | 5 ++ guix/scripts/pack.scm | 178 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 75 ++++++++++++++++++ 4 files changed, 258 insertions(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index 8f07a08eb5..a4fcbfe7ca 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -75,6 +75,7 @@ (eval . (put 'origin 'scheme-indent-function 0)) (eval . (put 'build-system 'scheme-indent-function 0)) (eval . (put 'bag 'scheme-indent-function 0)) + (eval . (put 'gexp->derivation 'scheme-indent-function 1)) (eval . (put 'graft 'scheme-indent-function 0)) (eval . (put 'operating-system 'scheme-indent-function 0)) (eval . (put 'file-system 'scheme-indent-function 0)) diff --git a/doc/guix.texi b/doc/guix.texi index 0930a514c7..7fb8d8e9d2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6016,6 +6016,11 @@ This produces a SquashFS image containing all the specified binaries and symlinks, as well as empty mount points for virtual file systems like procfs. +@item deb +This produces a Debian archive (a package with the @samp{.deb} file +extension) containing all the specified binaries and symlinks, that can +be installed on top of any dpkg-based GNU/Linux distribution. + @quotation Note Singularity @emph{requires} you to provide @file{/bin/sh} in the image. For that reason, @command{guix pack -f squashfs} always implies @code{-S diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 8a108b7a1a..18f003dec0 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Eric Bavier +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +66,7 @@ %compressors lookup-compressor self-contained-tarball + debian-archive docker-image squashfs-image @@ -341,6 +343,10 @@ added to the pack." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Singularity. +;;; (define (singularity-environment-file profile) "Return a shell script that defines the environment variables corresponding to the search paths of PROFILE." @@ -367,6 +373,10 @@ to the search paths of PROFILE." (computed-file "singularity-environment.sh" build)) + +;;; +;;; SquashFS image format. +;;; (define* (squashfs-image name profile #:key target (profile-name "guix-profile") @@ -541,6 +551,10 @@ added to the pack." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Docker image format. +;;; (define* (docker-image name profile #:key target (profile-name "guix-profile") @@ -628,6 +642,165 @@ the image." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Debian archive format. +;;; +;;; TODO: When relocatable option is selected, install to a unique prefix. +;;; This would enable installation of multiple deb packs with conflicting +;;; files at the same time. +;;; TODO: Allow passing a custom control file from the CLI. +;;; TODO: Allow providing a postinst script. +(define* (debian-archive name profile + #:key target + (profile-name "guix-profile") + deduplicate? + entry-point + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return a Debian archive (.deb) containing a store initialized with the +closure of PROFILE, a derivation. The archive contains /gnu/store; if +LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db +with a properly initialized store database. The supported compressors are +\"none\", \"gz\" or \"xz\". + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + ;; For simplicity, limit the supported compressors to the superset of + ;; compressors able to compress both the control file (gz or xz) and the + ;; data tarball (gz, bz2 or xz). + (define %valid-compressors '("gzip" "xz" "none")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid Debian archive compressor. \ +Valid compressors are: ~a~%") compressor-name %valid-compressors))) + + (when entry-point + (warning (G_ "entry point not supported in the '~a' format~%") + 'deb)) + + (define data-tarball + (computed-file (string-append "data.tar" + (compressor-extension compressor)) + (self-contained-tarball/builder + profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:local-build? #f ;allow offloading + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) + + (define build + (with-extensions (list guile-gcrypt) + (with-imported-modules `(((guix config) => ,(make-config.scm)) + ,@(source-module-closure + `((guix build pack) + (guix build utils) + (guix profiles)) + #:select? not-config?)) + #~(begin + (use-modules (guix build pack) + (guix build utils) + (guix profiles) + (ice-9 match) + (srfi srfi-1)) + + (define machine-type + ;; Extract the machine type from the specified target, else from the + ;; current system. + (and=> (or #$target %host-type) (lambda (triplet) + (first (string-split triplet #\-))))) + + (define (gnu-machine-type->debian-machine-type type) + "Translate machine TYPE from the GNU to Debian terminology." + ;; Debian has its own jargon, different from the one used in GNU, for + ;; machine types (see data/cputable in the sources of dpkg). + (match type + ("i686" "i386") + ("x86_64" "amd64") + ("aarch64" "arm64") + ("mipsisa32r6" "mipsr6") + ("mipsisa32r6el" "mipsr6el") + ("mipsisa64r6" "mips64r6") + ("mipsisa64r6el" "mips64r6el") + ("powerpcle" "powerpcel") + ("powerpc64" "ppc64") + ("powerpc64le" "ppc64el") + (machine machine))) + + (define architecture + (gnu-machine-type->debian-machine-type machine-type)) + + #$define-manifest->friendly-name + + (define manifest (profile-manifest #$profile)) + + (define single-entry ;manifest entry + (match (manifest-entries manifest) + ((entry) + entry) + (() #f))) + + (define package-name (or (and=> single-entry manifest-entry-name) + (manifest->friendly-name manifest))) + + (define package-version + (or (and=> single-entry manifest-entry-version) + "0.0.0")) + + (define debian-format-version "2.0") + + ;; Generate the debian-binary file. + (call-with-output-file "debian-binary" + (lambda (port) + (format port "~a~%" debian-format-version))) + + (define data-tarball-file-name (strip-store-file-name + #+data-tarball)) + + (copy-file #+data-tarball data-tarball-file-name) + + (define control-tarball-file-name + (string-append "control.tar" + #$(compressor-extension compressor))) + + ;; Write the compressed control tarball. Only the control file is + ;; mandatory (see: 'man deb' and 'man deb-control'). + (call-with-output-file "control" + (lambda (port) + (format port "\ +Package: ~a +Version: ~a +Description: Debian archive generated by GNU Guix. +Maintainer: GNU Guix +Architecture: ~a +~%" package-name package-version architecture))) + + (define tar (string-append #+archiver "/bin/tar")) + + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor '#+(and=> compressor compressor-command)) + "-cvf" ,control-tarball-file-name + "control")) + + ;; Create the .deb archive using GNU ar. + (invoke (string-append #+binutils "/bin/ar") "-rv" #$output + "debian-binary" + control-tarball-file-name data-tarball-file-name))))) + + (gexp->derivation (string-append name ".deb") + build + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. @@ -960,7 +1133,8 @@ last resort for relocation." ;; Supported pack formats. `((tarball . ,self-contained-tarball) (squashfs . ,squashfs-image) - (docker . ,docker-image))) + (docker . ,docker-image) + (deb . ,debian-archive))) (define (show-formats) ;; Print the supported pack formats. @@ -972,6 +1146,8 @@ last resort for relocation." squashfs Squashfs image suitable for Singularity")) (display (G_ " docker Tarball ready for 'docker load'")) + (display (G_ " + deb Debian archive compatible, installable via dpkg/apt")) (newline)) (define %options diff --git a/tests/pack.scm b/tests/pack.scm index ae6247a1d5..ed461c6887 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module ((gnu packages base) #:select (glibc-utf8-locales)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages compression) #:select (squashfs-tools)) + #:use-module ((gnu packages debian) #:select (dpkg)) #:use-module ((gnu packages guile) #:select (guile-sqlite3)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (srfi srfi-64)) @@ -56,6 +58,8 @@ (define %tar-bootstrap %bootstrap-coreutils&co) +(define %ar-bootstrap %bootstrap-binutils) + (test-begin "pack") @@ -270,6 +274,77 @@ 1) (pk 'guilelink (readlink "bin")))) (mkdir #$output)))))))) + (built-derivations (list check)))) + + (unless store (test-skip 1)) + (test-assertm "deb archive with symlinks" store + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile (profile-derivation (packages->manifest + (list %bootstrap-guile)) + #:hooks '() + #:locales? #f)) + (deb (debian-archive "deb-pack" profile + #:compressor %gzip-compressor + #:symlinks '(("/opt/gnu/bin" -> "bin")) + #:archiver %tar-bootstrap)) + (check + (gexp->derivation "check-deb-pack" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match) + (ice-9 popen) + (ice-9 rdelim) + (ice-9 textual-ports) + (rnrs base)) + + (setenv "PATH" (string-join + (list (string-append #+%tar-bootstrap "/bin") + (string-append #+dpkg "/bin") + (string-append #+%ar-bootstrap "/bin")) + ":")) + + ;; Validate the output of 'dpkg --info'. + (let* ((port (open-pipe* OPEN_READ "dpkg" "--info" #$deb)) + (info (get-string-all port)) + (exit-val (status:exit-val (close-pipe port)))) + (assert (zero? exit-val)) + + (assert (string-contains + info + (string-append "Package: " + #+(package-name %bootstrap-guile)))) + + (assert (string-contains + info + (string-append "Version: " + #+(package-version %bootstrap-guile))))) + + ;; Sanity check .deb contents. + (invoke "ar" "-xv" #$deb) + (assert (file-exists? "debian-binary")) + (assert (file-exists? "data.tar.gz")) + (assert (file-exists? "control.tar.gz")) + + ;; Verify there are no hard links in data.tar.gz, as hard + ;; links would cause dpkg to fail unpacking the archive. + (define hard-links + (let ((port (open-pipe* OPEN_READ "tar" "-tvf" "data.tar.gz"))) + (let loop ((hard-links '())) + (match (pk 'line (read-line port)) + ((? eof-object?) + (assert (zero? (status:exit-val (close-pipe port)))) + hard-links) + (line + (if (string-prefix? "u" line) + (loop (cons line hard-links)) + (loop hard-links))))))) + + (unless (null? hard-links) + (error "hard links found in data.tar.gz" hard-links)) + + (mkdir #$output)))))) (built-derivations (list check))))) (test-end) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 12:44:28 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 16:44:28 +0000 Received: from localhost ([127.0.0.1]:36867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvN2C-0003Tc-3T for submit@debbugs.gnu.org; Mon, 21 Jun 2021 12:44:28 -0400 Received: from mx1.dismail.de ([78.46.223.134]:33557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvN29-0003TI-L0 for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 12:44:26 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 2d6d3e0f for <49149@debbugs.gnu.org>; Mon, 21 Jun 2021 18:44:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to; s=20190914; bh=UN/djcKVwxb/nvLYTXjxXYiLS CdjFQ7NEEatwYHt6vA=; b=Bj63f7uO6X8m4qsWcVgL36Ow1aWxpOlEJI2EM5XKe RuJNjD5EK9BizB8nB5mV0S/686TSAtc5oTM7UBPEHpc/QcTT6a3TMc8G5kaMuAqH XxQhY6Y6t6y+6onDPzloUaGxk7qFIUb8Bhlt1d3ZFO786hqlIT7pmtqP2gKrGhGC /B4LBMq5erkCe1jjcE90yFyRIOtuw++P1CyUjKlsajvisZQ/6FRfipAPf+p2Brmb 7iHxNWc8GLJUby2R0TF1e3mvdyJpUa8thzJIThcP2Bo7LL95NO1NaLA8R39DdoOx rv9CxbZZBVXHX8PJMwf1hLnZHELmXDgeEiMEEwjb3gM8g== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 71d674d0 for <49149@debbugs.gnu.org>; Mon, 21 Jun 2021 18:44:18 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id c5fa4416 for <49149@debbugs.gnu.org>; Mon, 21 Jun 2021 18:44:18 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 287cf94b (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <49149@debbugs.gnu.org>; Mon, 21 Jun 2021 18:44:17 +0200 (CEST) MIME-Version: 1.0 Date: Mon, 21 Jun 2021 16:44:17 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.14.0a From: "jgart" Message-ID: Subject: Re: Add deb format for guix pack. To: 49149@debbugs.gnu.org X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49149 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: -1.7 (-) This is awesome!=0A=0AAre you working on adding a-packs support for alpin= e linux also? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 14:11:59 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 18:11:59 +0000 Received: from localhost ([127.0.0.1]:36899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvOOs-0005rf-Ql for submit@debbugs.gnu.org; Mon, 21 Jun 2021 14:11:59 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:34910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvOOq-0005rU-Mw for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 14:11:57 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id KuBu2500Z0mfAB401uBuWa; Mon, 21 Jun 2021 20:11:55 +0200 Message-ID: <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> Subject: Re: [bug#49149] [PATCH 4/7] pack: Improve naming of the packs store file names. From: Maxime Devos To: Maxim Cournoyer , 49149@debbugs.gnu.org Date: Mon, 21 Jun 2021 20:11:54 +0200 In-Reply-To: <20210621061205.31878-5-maxim.cournoyer@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-5-maxim.cournoyer@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-8RA0mC5LcZqxa4LyAvLR" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1624299115; bh=F11PnPNKY3iLTPO4CTKaD2rqxgs7Tp7LV9eyRXGLbE8=; h=Subject:From:To:Date:In-Reply-To:References; b=Lgz0bdWP+oTalqK2yz/xv2K9oGE51d5R4PBL7m6Acl2rkRgkZck/lbQ7lt6Peqp16 DjNCHMRGIYQXr0QOlrt9X7YLbYDyCnxQUSh8/iywuIEDz6D1GRVr6cjIPjl4lc2RHp 0Hijv5cXNJdNJHlnKyVwUVHoafZohaNjJPlybf5TpjHeYNweIaQzSoHMmqi/hP78XU gGxwA/Q4sBuQoa7VLI4PzLL+kczo2WovJZTTwAZJqehPvAazBn2vUJn2nDf61bXAFZ gdR1XxIWILRRbH5w2V1x8dJxcWRrN3DGTIdyKYjn44LkknwUolN/cSPQeH+t5m2vvO ndwT04dDMrrxg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49149 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: -1.7 (-) --=-8RA0mC5LcZqxa4LyAvLR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxim Cournoyer schreef op ma 21-06-2021 om 02:12 [-0400]: > Instead of just naming them by their pack type, add information from the > package(s) they contain to make it easier to differentiate them. >=20 > * guix/scripts/pack.scm (manifest->friendly-name): Extract procedure from= ... > (docker-image): ... here. Adjust REPOSITORY argument value accordingly. > (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. > --- > guix/scripts/pack.scm | 44 +++++++++++++++++++++++++------------------ > 1 file changed, 26 insertions(+), 18 deletions(-) >=20 > diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm > index 7ea97a4b7a..9d4bb9f497 100644 > --- a/guix/scripts/pack.scm > +++ b/guix/scripts/pack.scm > @@ -172,6 +172,23 @@ dependencies are registered." > (computed-file "store-database" build > #:options `(#:references-graphs ,(zip labels items)))) > =20 > +;;; XXX: The following procedure has to *also* be used in the build side > +;;; G-Exp, because PROFILE is passed as a derivation in the tests. > +(define define-manifest->friendly-name > + '(define (manifest->friendly-name manifest) [...])) > > +(eval define-manifest->friendly-name (current-module)) You can avoid 'eval' here by defining 'manifest->friendly-name in a separate guix/build/pack-utils.scm module. Alternatively, some macroology (untested, may need some tweaks): (define-syntax define-gexp-and-expand ((_ variable code code* ...) (begin (define variable #~(code code* ...)) code code* ...))) (define-gexp-and-expand define-manifest->friendly-name (define (manifest->friendly-name manifest) [... docstring] [... all the code])) Greetings, Maxime. --=-8RA0mC5LcZqxa4LyAvLR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNDWahccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sKxAQDOdX1PX0MmtaFSPl8V6yx9Sv5L kGup4xyOdCTbBlwpowEAm5Lca5nSDDBNkZOxPp0rTHfYlq/fWDzyA2aEJ3iyIAs= =0UGz -----END PGP SIGNATURE----- --=-8RA0mC5LcZqxa4LyAvLR-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 21 16:28:49 2021 Received: (at 49149) by debbugs.gnu.org; 21 Jun 2021 20:28:49 +0000 Received: from localhost ([127.0.0.1]:36989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvQXJ-00039t-4J for submit@debbugs.gnu.org; Mon, 21 Jun 2021 16:28:49 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:41612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvQXF-00039e-RR for 49149@debbugs.gnu.org; Mon, 21 Jun 2021 16:28:48 -0400 Received: by mail-qt1-f173.google.com with SMTP id d9so5020079qtx.8 for <49149@debbugs.gnu.org>; Mon, 21 Jun 2021 13:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=s4v4DpBaQ637zuTXPUxYxAfl+TwQ9YkNOJc+E9fcBKI=; b=h04pABrEZwd/Bl0nHU4EIqB3oK+Qn6yjvxt3TMJpLCWFYglp/ILpr9tMvFqlBw3Ase OiFQByGeulb778MegGzH1EEaFY9soVi5UjYH9KclcKsA1O1a/Wufm1GQ2VL5vb1vJKNa 0GiIhKiKxWcvwP6fK5I8mgJfT+lBOwk51ZUrh253FJXM3gBN1KgRYo0D6/BSZcOLFU94 CmN6dnXISsfAMvOcFdzcWPw3yNTNiWoh580fj3660dbk3Gr16WIlZ1BdCliwJeCRvPwT OJ/X+K5aF7NuQyQUseXIv39u6swCxcSuitv1cqYnCTdCguSsTmbgSbXH5ie3vkvVC9Q3 6vPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=s4v4DpBaQ637zuTXPUxYxAfl+TwQ9YkNOJc+E9fcBKI=; b=jFVAbbDbB+4mbxN87MaXoXJl8rMtbQiSkU9X9GjaxzlMSl9/m8taRX5Q8oTZQc2+Lc OQmRCDN/XLnsX/95KoZiJVua7P1StMMfzEpYee5YRgVAZnp3OnDu3WaA20H4k7zXx7Fu QQ/6+SYZ3dQ38+zCZH1QwCbgOkYdnP2IeBwxXR72KCYP2WAtDUSkI/61yHhFfQbipKxm 6Eh2qjA59Rde4fvSIlw6gaPNlswyOcOm5/stVn8G18Xg+Vv3pKw0HjUcV//YLVFeLb0P PrRwQR9hG31I0tW2lcy/6zabu0eEvxnXXJ6UdbzO+nloeHbON45MHn5VeIu5Byt/S9eM Ns+A== X-Gm-Message-State: AOAM531zOAOMFeBZhKORcjtxxP9Rz/YmSIhj2yxxAnl3NOXn6X3ytEmk gju2y0QowOUgFzCCxzWOKWmTimBOeFl94w== X-Google-Smtp-Source: ABdhPJyL745VcdSK7psC/18Nhb4iTLFpLz9vnWkeoMQQyxhYyFSeR1DlveCc8Ws7cSTpAogApUN3Bw== X-Received: by 2002:ac8:4e2a:: with SMTP id d10mr359834qtw.386.1624307320259; Mon, 21 Jun 2021 13:28:40 -0700 (PDT) Received: from hurd (dsl-148-219.b2b2c.ca. [66.158.148.219]) by smtp.gmail.com with ESMTPSA id i16sm3745294qki.121.2021.06.21.13.28.38 for <49149@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 13:28:39 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: Re: [PATCH] tentatively reuse rlib for cargo-build-system References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-2-maxim.cournoyer@gmail.com> Date: Mon, 21 Jun 2021 16:28:36 -0400 In-Reply-To: <20210621061205.31878-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 21 Jun 2021 02:11:59 -0400") Message-ID: <87k0mnynbf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 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: -1.0 (-) Hello, This one can be safely ignored; it was a stray .patch file in my tree that I sent erroneously with this series. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 22 10:03:28 2021 Received: (at 49149) by debbugs.gnu.org; 22 Jun 2021 14:03:28 +0000 Received: from localhost ([127.0.0.1]:39565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvgzw-0001gD-7O for submit@debbugs.gnu.org; Tue, 22 Jun 2021 10:03:28 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:40876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvgzt-0001fu-Oa for 49149@debbugs.gnu.org; Tue, 22 Jun 2021 10:03:26 -0400 Received: by mail-qk1-f169.google.com with SMTP id q64so33368729qke.7 for <49149@debbugs.gnu.org>; Tue, 22 Jun 2021 07:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MC7CpqWu13kZ0FKlSxOri1k85kTKGPDbXwlPVDilSGA=; b=KOQVrKCSgEedeEBnH/umwp29Wg8D2sbIPBjkoiCG+gpbkwgubI36eB/tPYwOsVuo0y MaAl/bEKQn2jnly7bJe2jlD43KuQqqzHriNlGVG1GhTM/C0cJBXB+Tp++Wc/t5/BKc7c fAWNm2F4WKY+MIiOVSp4oTC4CW9OxkZ2+4LuBxnaPhTXJ7veW1/hken6/8zIWHhRgy91 fRYOWD/ySLiwckAyp2kbZpy7axzU8tUmNiJ1ks/H9wdVDeq6AwtlxNY7yG+ONZKIgGoB DJw6KcG9oblYsWLo6cm8Vkrj5H4hNCH6D7deI/ByN2TY3pJYll3lNKjKu/l9++n/zfEK rHfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MC7CpqWu13kZ0FKlSxOri1k85kTKGPDbXwlPVDilSGA=; b=XoFAy2QnId7s7Kq239QBuUMiRHVORKHuhKkFIkmFJakSqCpP0S8DtQw1Vay4anDfZH z7TGs5MifeWUrm52db05SCXeIYc3Yv7hRCWEJ45hMsQ7+Z6f7LPhSf9V+EdVrKs7FAi2 8xAY2RF5MNEInD4fQiOZcTS9uJroGzSeGJBTT4YZlE7DaGFMZUGf9HVyvp3AxWKlCRm9 3kZg0FCmL5vUDOZZCCfbv9/7vFlHpTk/9/wv71bWzsQ5ZVkDT8cUrOIvesnId201VQ5Y TqeG+jZL/jkzXM2DDh87uGDS7bo7f4q1I9vJZ5U9L8PajrwDISNzO65w7DNZ2UHzetxJ oRKg== X-Gm-Message-State: AOAM530qYSYqx2TkKBZyrX2ZYl6cjPMQo8kPAp3zSx1aRJv2+lburLKB K2CkagJCpbNpyZNYWyUpvZJptElfexirMA== X-Google-Smtp-Source: ABdhPJyfrf60l+59BPoOrwQ6WTBnpTa6rerR3+xnSnrXeWIOPKb5Dvy06DhqW5pAZEYvzkO5KRRPRA== X-Received: by 2002:a37:5d46:: with SMTP id r67mr4506753qkb.12.1624370599913; Tue, 22 Jun 2021 07:03:19 -0700 (PDT) Received: from hurd (dsl-205-236-230-118.b2b2c.ca. [205.236.230.118]) by smtp.gmail.com with ESMTPSA id e14sm1682441qtq.24.2021.06.22.07.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:03:19 -0700 (PDT) From: Maxim Cournoyer To: Maxime Devos Subject: Re: [bug#49149] [PATCH 4/7] pack: Improve naming of the packs store file names. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-5-maxim.cournoyer@gmail.com> <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> Date: Tue, 22 Jun 2021 10:03:17 -0400 In-Reply-To: <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> (Maxime Devos's message of "Mon, 21 Jun 2021 20:11:54 +0200") Message-ID: <87k0mm2dzu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hello Maxime, Maxime Devos writes: > Maxim Cournoyer schreef op ma 21-06-2021 om 02:12 [-0400]: >> Instead of just naming them by their pack type, add information from the >> package(s) they contain to make it easier to differentiate them. >> >> * guix/scripts/pack.scm (manifest->friendly-name): Extract procedure from ... >> (docker-image): ... here. Adjust REPOSITORY argument value accordingly. >> (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. >> --- >> guix/scripts/pack.scm | 44 +++++++++++++++++++++++++------------------ >> 1 file changed, 26 insertions(+), 18 deletions(-) >> >> diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm >> index 7ea97a4b7a..9d4bb9f497 100644 >> --- a/guix/scripts/pack.scm >> +++ b/guix/scripts/pack.scm >> @@ -172,6 +172,23 @@ dependencies are registered." >> (computed-file "store-database" build >> #:options `(#:references-graphs ,(zip labels items)))) >> >> +;;; XXX: The following procedure has to *also* be used in the build side >> +;;; G-Exp, because PROFILE is passed as a derivation in the tests. >> +(define define-manifest->friendly-name >> + '(define (manifest->friendly-name manifest) [...])) >> >> +(eval define-manifest->friendly-name (current-module)) > > You can avoid 'eval' here by defining 'manifest->friendly-name > in a separate guix/build/pack-utils.scm module. > Alternatively, some macroology (untested, may need some tweaks): Thanks for the feedback! I tried moving 'manifest->friendly-name' to (guix build pack), which was already added in an earlier commit, but that didn't work because (guix profiles) needs to be pulled in for 'manifest-entries' and 'manifest-entry-name', and sadly (guix profiles) pulls (guix config), which is not possible/desirable on the build side. > (define-syntax define-gexp-and-expand > ((_ variable code code* ...) > (begin (define variable #~(code code* ...)) > code code* ...))) > > (define-gexp-and-expand define-manifest->friendly-name > (define (manifest->friendly-name manifest) > [... docstring] > [... all the code])) I'm not sure how the expansion would be usable in the module it is defined? It seems I could manage to get 'manifest->friendly-name' to be a procedure returning a gexp, but that gexp wouldn't be readily usable in that module (it could only be used when gexp-unquote from inside another G-Exp), and the expansion in the macro above doesn't bind any identifier, unless I'm missing something? So for now, I'm stuck with the eval, which doesn't seem to bad considering it's only evaluating a safe, static expression. Thank you, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 23 06:22:33 2021 Received: (at 49149) by debbugs.gnu.org; 23 Jun 2021 10:22:33 +0000 Received: from localhost ([127.0.0.1]:40435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw01g-0007Ep-Qs for submit@debbugs.gnu.org; Wed, 23 Jun 2021 06:22:33 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:58518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw01e-0007Eg-Bi for 49149@debbugs.gnu.org; Wed, 23 Jun 2021 06:22:31 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by albert.telenet-ops.be with bizsmtp id LaNU2500A0mfAB406aNU5t; Wed, 23 Jun 2021 12:22:28 +0200 Message-ID: Subject: Re: [bug#49149] [PATCH 4/7] pack: Improve naming of the packs store file names. From: Maxime Devos To: Maxim Cournoyer Date: Wed, 23 Jun 2021 12:22:14 +0200 In-Reply-To: <87k0mm2dzu.fsf@gmail.com> References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-5-maxim.cournoyer@gmail.com> <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> <87k0mm2dzu.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-ndt7Ql6O8sZnBfUhEsC+" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1624443748; bh=bhXPSpC4BiQ28NbRuevrAJ3MY1Sp/17TmNUTP/CCiIA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cie9gGVD/M9mkLXt0VgrGkOCkcJtvOFzv3mxaoDoLfPD9NSUPqA16gMLm2MHr/3z3 IV+vJ+XuuWBi/9EzfMupPyQNZAhgrOaSIkK0evi7vHN5QOJjwdiiDWp/xafY+1ywT6 lBLO5L/A+dcLxJz6zJshgTWM4DPV9I1Wi9XT+90yWC/lkwYsgHM2qARLd1G14LU35K eudD9/3IHkSKqW3Ua8lkz9gi2fPv4ji6erdoOpkthOm85YlYwU9gRwYN24+cE0Tn9M mJN38nDEbo52sw5R8vYIIwqb9cB+E3mK7w5B6PFJIbIFvVgiY+huwzaz6T1bTIreQ0 iwSJ8tVGM1AEQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.7 (-) --=-ndt7Ql6O8sZnBfUhEsC+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > I'm not sure how the expansion would be usable in the module it is > defined? It seems I could manage to get 'manifest->friendly-name' to be > a procedure returning a gexp, but that gexp wouldn't be readily usable > in that module (it could only be used when gexp-unquote from inside > another G-Exp), and the expansion in the macro above doesn't bind any > identifier, unless I'm missing something? The macro does two things: define a procedure manifest->friendly-name that returns a string. (define (manifest->friendly-name manifest) "Return a friendly name computed from the entries in MANIFEST, a object." (let loop ((names (map manifest-entry-name (manifest-entries manifest)))) (define str (string-join names "-")) (if (< (string-length str) 40) str (match names ((_) str) ((names ... _) (loop names))))))) ;drop one entry and also define a G-exp define-manifest->friendly-name (define define-manifest->friendly-nam #~(define (manifest->friendly-name manifes) "Return a friendly name [...]" [...]) Testing from a REPL: $ guix repl (use-modules (guix gexp) (ice-9 match) (guix profiles)) (define-syntax define-gexp-and-expand (syntax-rules () ((_ variable code) ; code* ... turned out to be unnecessary (begin (define variable #~code) code)))) (define-gexp-and-expand define-manifest->friendly-name (define (manifest->friendly-name manifest) "Return a friendly name computed from the entries in MANIFEST, a object." (let loop ((names (map manifest-entry-name (manifest-entries manifest)))) (define str (string-join names "-")) (if (< (string-length str) 40) str (match names ((_) str) ((names ... _) (loop names))))))) ;drop one entry $ define-manifest->friendly-name $3 =3D #friendly-name manifest) "Return a friendly= name computed from the entries in MANIFEST, a\n object." (le= t loop ((names (map manifest-entry-name (manifest- entries manifest)))) (define str (string-join names "-")) (if (< (string-le= ngth str) 40) str (match names ((_) str) ((names ... _) (loop names)))))) 7= f4b3c5ee5a0> $ (manifest->friendly-name (specifications->manifest '("guile"))) $8 =3D "guile" Seems to work. Greetings, Maxime. --=-ndt7Ql6O8sZnBfUhEsC+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNMLVhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7t+vAP9V6t+VgIHZi2Q79PbvjrE7cZH+ HuBJMOsVL76Fv4agIAD/SUeCv2g3AabvZHLKdYs1ukN17fvvjXLh19w9EnP9YQA= =/wKG -----END PGP SIGNATURE----- --=-ndt7Ql6O8sZnBfUhEsC+-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 23 17:17:06 2021 Received: (at 49149) by debbugs.gnu.org; 23 Jun 2021 21:17:06 +0000 Received: from localhost ([127.0.0.1]:41962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwAF8-000600-H5 for submit@debbugs.gnu.org; Wed, 23 Jun 2021 17:17:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwAF5-0005zJ-GH for 49149@debbugs.gnu.org; Wed, 23 Jun 2021 17:17:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51488) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwAEy-0003ub-W6; Wed, 23 Jun 2021 17:16:57 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35356 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwAEy-00009E-4l; Wed, 23 Jun 2021 17:16:56 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-5-maxim.cournoyer@gmail.com> <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> Date: Wed, 23 Jun 2021 23:16:54 +0200 In-Reply-To: <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> (Maxime Devos's message of "Mon, 21 Jun 2021 20:11:54 +0200") Message-ID: <87tulouvqx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@debbugs.gnu.org, Maxim Cournoyer 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, Maxime Devos skribis: > Maxim Cournoyer schreef op ma 21-06-2021 om 02:12 [-0400]: [...] >> +;;; XXX: The following procedure has to *also* be used in the build side >> +;;; G-Exp, because PROFILE is passed as a derivation in the tests. >> +(define define-manifest->friendly-name >> + '(define (manifest->friendly-name manifest) [...])) >> >> +(eval define-manifest->friendly-name (current-module)) > > You can avoid 'eval' here by defining 'manifest->friendly-name > in a separate guix/build/pack-utils.scm module. Seconded! > Alternatively, some macroology (untested, may need some tweaks): See also =E2=80=98define-os-with-source=E2=80=99 in (gnu tests). HTH, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 23 17:28:19 2021 Received: (at 49149) by debbugs.gnu.org; 23 Jun 2021 21:28:19 +0000 Received: from localhost ([127.0.0.1]:41971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwAPz-0006GU-2v for submit@debbugs.gnu.org; Wed, 23 Jun 2021 17:28:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwAPx-0006GI-GV for 49149@debbugs.gnu.org; Wed, 23 Jun 2021 17:28:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51684) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwAPs-0002HO-8s; Wed, 23 Jun 2021 17:28:12 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35366 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwAPr-0005Xg-Q1; Wed, 23 Jun 2021 17:28:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> Date: Wed, 23 Jun 2021 23:28:10 +0200 In-Reply-To: <20210621061039.31557-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 21 Jun 2021 02:10:39 -0400") Message-ID: <87eecsuv85.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hello! Maxim Cournoyer skribis: > This patch set adds support to produce Debian archives (.deb packages) via > guix pack. It's rudimentary but functional. You can try a simple example > like so: > > $ ./pre-inst-env guix pack -f deb -C xz hello -S /usr/bin/hello=3Dbin/hel= lo > > Copy the generated .deb to your dpkg-based distribution of choice, then: > > $ sudo apt install ./91ypmi1j5py9qk034kki5wrgy0n52yz9-hello-deb-pack.deb > > $ realpath $(which hello) > /gnu/store/lk9cmjjhgxpkxxi7m54y0jlv3rqvpb2n-hello-2.10/bin/hello > $ hello > Hello, world! > > Fun, no? We can now distribute software built with Guix transparently to= any > Debian-based distribution. Definitely fun. :-) As briefly discussed on IRC, I wonder what happens when installing multiple such .deb files, and removing them selectively. There=E2=80=99s of course going to be overlapping store items. Apparently, dpkg will happily overwrite them when you install (and that=E2=80=99s fine, if they have the same name, they=E2=80=99re identical)= , but what happens when you remove one of them? Does it, for instance, remove /gnu/store/=E2=80=A6-glibc just because it =E2=80=9Cbelongs=E2=80=9D to tha= t package, without noticing that it also belongs to other installed packages? If dpkg cannot deal with that, it=E2=80=99s equivalent to a tarball pack fo= r all practical purposes, except you=E2=80=99d run =E2=80=9Csudo apt=E2=80=9D ins= tead of =E2=80=9Csudo tar=E2=80=9D. WDYT? Is our official Debian ambassador around? :-) A complementary approach would be to transparently build Guix packages in a Debian VM, with an FHS layout, and with dependencies on Debian packages. I remember there were tools for that in Nixpkgs back in the day, using Checkinstall to generate the actual .deb file. Thanks for the neat hack! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:19 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:19 +0000 Received: from localhost ([127.0.0.1]:42162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB1-0002OQ-4k for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:19 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:39800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHAz-0002Nv-A9 for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:18 -0400 Received: by mail-qk1-f181.google.com with SMTP id j184so11219550qkd.6 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nK+XZhiFPUZF48SwwcEJOQPOaSHkTwT9yOejmrHORIk=; b=Hj8dAtWfuxhvHPFfpDnMNayrdFUzQ8gCmVrVKjk/c91Bi+fNxrYRGsKO1DtBJYVfn4 81q0AXComecleIMJNxyyMqNUC9oWHwoRD4ybUMAq6mCqt48HZAUu2HVZRYyc7GzDw5Uh SVU/49P+5D7rmm4jmovI8lrbcWH9RFtQLL44MBrHMIKpX6l2c/rKeNBkH2hYA83QYG1O n0bW+Ba7HtQt1YbY2yKKD9j1NBn65eRXjqQaLI8/6Z0S47kW19mVwIN3VWqTGPpdtDVf X6XVPSjjp1FqNIb/Z1j+gs4ZUFpnTBo/MMNGd9nfvV6N678MZ2+Gc5NI5Czs40g91tyD aupg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nK+XZhiFPUZF48SwwcEJOQPOaSHkTwT9yOejmrHORIk=; b=MfLZrzbV4v8OtLsKksXwi9sUOslDRO1HpDdPzqtZP2Ws9iudTVNbc44tTH/0igw6Ao oZEMv6qiI3Tn3eO2sWUUEQl0kzAmqRlR5Xyt4Mxqf+OYzFTco33omzfj8XfWZuGdUrqo 7Wlurqh/PNO9sNf5B9Kpwi7Qe2rJpZNFAB02Hm+Wv0dfKh2bjczIu87KnMzTTPwLhOEP MEL1Juf9CRIYKH6oVKzpW796doPZUvkf5Cc2qEu/n5YQx6hNcZIqCSfWSHbly8VCr33c kRltP3fKyUa4w3lWv/O+8Jh9fBHX/imqKiq6OZlhGhCChWsSlPVWBBWxEp2s2zO9A2E0 Yi8A== X-Gm-Message-State: AOAM533nKc7VR6BMd8NL+FyKbmSyH7HPK76RrVUMKgoN+LfNC4+Vtq38 77KBzTHP4ELdQL/Hhy5/x9AatFAEnZIR2w== X-Google-Smtp-Source: ABdhPJwEP3nP1famFNutfg/u+zpOBkjCUnLE/g9MG0oS2n/cdYHeJy2I52jLsDCploIXOnohMSKw+A== X-Received: by 2002:a37:a3d5:: with SMTP id m204mr3653449qke.401.1624509671611; Wed, 23 Jun 2021 21:41:11 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:11 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 1/7] pack: Extract builder code from self-contained-tarball. Date: Thu, 24 Jun 2021 00:40:43 -0400 Message-Id: <20210624044049.17906-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) This is made to allow reusing it for the debian-archive pack format, added in a subsequent commit. * guix/scripts/pack.scm (self-contained-tarball/builder): New procedure, containing the build code extracted from self-contained-tarball. (self-contained-tarball): Use the above procedure. --- guix/scripts/pack.scm | 270 ++++++++++++++++++++++-------------------- 1 file changed, 141 insertions(+), 129 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 8cb4e6d2cc..ac477850e6 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -172,22 +172,17 @@ dependencies are registered." (computed-file "store-database" build #:options `(#:references-graphs ,(zip labels items)))) -(define* (self-contained-tarball name profile - #:key target - (profile-name "guix-profile") - deduplicate? - entry-point - (compressor (first %compressors)) - localstatedir? - (symlinks '()) - (archiver tar)) - "Return a self-contained tarball containing a store initialized with the -closure of PROFILE, a derivation. The tarball contains /gnu/store; if -LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db -with a properly initialized store database. - -SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be -added to the pack." + +;;; +;;; Tarball format. +;;; +(define* (self-contained-tarball/builder profile + #:key (profile-name "guix-profile") + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return the G-Expression of the builder used for self-contained-tarball." (define database (and localstatedir? (file-append (store-database (list profile)) @@ -209,125 +204,142 @@ added to the pack." (and (not-config? module) (not (equal? '(guix store deduplication) module)))) - (define build - (with-imported-modules (source-module-closure - `((guix build utils) - (guix build union) - (gnu build install)) - #:select? import-module?) - #~(begin - (use-modules (guix build utils) - ((guix build union) #:select (relative-file-name)) - (gnu build install) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 match)) + (with-imported-modules (source-module-closure + `((guix build utils) + (guix build union) + (gnu build install)) + #:select? import-module?) + #~(begin + (use-modules (guix build utils) + ((guix build union) #:select (relative-file-name)) + (gnu build install) + (srfi srfi-1) + (srfi srfi-26) + (ice-9 match)) + + (define %root "root") + + (define symlink->directives + ;; Return "populate directives" to make the given symlink and its + ;; parent directories. + (match-lambda + ((source '-> target) + (let ((target (string-append #$profile "/" target)) + (parent (dirname source))) + ;; Never add a 'directory' directive for "/" so as to + ;; preserve its ownnership when extracting the archive (see + ;; below), and also because this would lead to adding the + ;; same entries twice in the tarball. + `(,@(if (string=? parent "/") + '() + `((directory ,parent))) + (,source + -> ,(relative-file-name parent target))))))) + + (define directives + ;; Fully-qualified symlinks. + (append-map symlink->directives '#$symlinks)) + + ;; The --sort option was added to GNU tar in version 1.28, released + ;; 2014-07-28. For testing, we use the bootstrap tar, which is + ;; older and doesn't support it. + (define tar-supports-sort? + (zero? (system* (string-append #+archiver "/bin/tar") + "cf" "/dev/null" "--files-from=/dev/null" + "--sort=name"))) + + ;; Make sure non-ASCII file names are properly handled. + #+set-utf8-locale + + ;; Add 'tar' to the search path. + (setenv "PATH" #+(file-append archiver "/bin")) + + ;; Note: there is not much to gain here with deduplication and there + ;; is the overhead of the '.links' directory, so turn it off. + ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs + ;; with hard links: + ;; . + (populate-single-profile-directory %root + #:profile #$profile + #:profile-name #$profile-name + #:closure "profile" + #:database #+database) + + ;; Create SYMLINKS. + (for-each (cut evaluate-populate-directive <> %root) + directives) + + ;; Create the tarball. Use GNU format so there's no file name + ;; length limitation. + (with-directory-excursion %root + (apply invoke "tar" + #+@(if (compressor-command compressor) + #~("-I" + (string-join + '#+(compressor-command compressor))) + #~()) + "--format=gnu" + ;; Avoid non-determinism in the archive. + ;; Use mtime = 1, not zero, because that is what the daemon + ;; does for files in the store (see the 'mtimeStore' constant + ;; in local-store.cc.) + (if tar-supports-sort? "--sort=name" "--mtime=@1") + "--owner=root:0" + "--group=root:0" + "--check-links" + "-cvf" #$output + ;; Avoid adding / and /var to the tarball, so + ;; that the ownership and permissions of those + ;; directories will not be overwritten when + ;; extracting the archive. Do not include /root + ;; because the root account might have a + ;; different home directory. + #$@(if localstatedir? + '("./var/guix") + '()) + + (string-append "." (%store-directory)) + + (delete-duplicates + (filter-map (match-lambda + (('directory directory) + (string-append "." directory)) + ((source '-> _) + (string-append "." source)) + (_ #f)) + directives))))))) - (define %root "root") - - (define symlink->directives - ;; Return "populate directives" to make the given symlink and its - ;; parent directories. - (match-lambda - ((source '-> target) - (let ((target (string-append #$profile "/" target)) - (parent (dirname source))) - ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownnership when extracting the archive (see - ;; below), and also because this would lead to adding the - ;; same entries twice in the tarball. - `(,@(if (string=? parent "/") - '() - `((directory ,parent))) - (,source - -> ,(relative-file-name parent target))))))) - - (define directives - ;; Fully-qualified symlinks. - (append-map symlink->directives '#$symlinks)) - - ;; The --sort option was added to GNU tar in version 1.28, released - ;; 2014-07-28. For testing, we use the bootstrap tar, which is - ;; older and doesn't support it. - (define tar-supports-sort? - (zero? (system* (string-append #+archiver "/bin/tar") - "cf" "/dev/null" "--files-from=/dev/null" - "--sort=name"))) - - ;; Make sure non-ASCII file names are properly handled. - #+set-utf8-locale - - ;; Add 'tar' to the search path. - (setenv "PATH" #+(file-append archiver "/bin")) - - ;; Note: there is not much to gain here with deduplication and there - ;; is the overhead of the '.links' directory, so turn it off. - ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs - ;; with hard links: - ;; . - (populate-single-profile-directory %root - #:profile #$profile - #:profile-name #$profile-name - #:closure "profile" - #:database #+database) - - ;; Create SYMLINKS. - (for-each (cut evaluate-populate-directive <> %root) - directives) - - ;; Create the tarball. Use GNU format so there's no file name - ;; length limitation. - (with-directory-excursion %root - (exit - (zero? (apply system* "tar" - #+@(if (compressor-command compressor) - #~("-I" - (string-join - '#+(compressor-command compressor))) - #~()) - "--format=gnu" - - ;; Avoid non-determinism in the archive. Use - ;; mtime = 1, not zero, because that is what the - ;; daemon does for files in the store (see the - ;; 'mtimeStore' constant in local-store.cc.) - (if tar-supports-sort? "--sort=name" "--mtime=@1") - "--mtime=@1" ;for files in /var/guix - "--owner=root:0" - "--group=root:0" - - "--check-links" - "-cvf" #$output - ;; Avoid adding / and /var to the tarball, so - ;; that the ownership and permissions of those - ;; directories will not be overwritten when - ;; extracting the archive. Do not include /root - ;; because the root account might have a - ;; different home directory. - #$@(if localstatedir? - '("./var/guix") - '()) - - (string-append "." (%store-directory)) - - (delete-duplicates - (filter-map (match-lambda - (('directory directory) - (string-append "." directory)) - ((source '-> _) - (string-append "." source)) - (_ #f)) - directives))))))))) +(define* (self-contained-tarball name profile + #:key target + (profile-name "guix-profile") + deduplicate? + entry-point + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return a self-contained tarball containing a store initialized with the +closure of PROFILE, a derivation. The tarball contains /gnu/store; if +LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db +with a properly initialized store database. +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." (when entry-point (warning (G_ "entry point not supported in the '~a' format~%") 'tarball)) - (gexp->derivation (string-append name ".tar" - (compressor-extension compressor)) - build - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation + (string-append name ".tar" + (compressor-extension compressor)) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:target target + #:references-graphs `(("profile" ,profile)))) (define (singularity-environment-file profile) "Return a shell script that defines the environment variables corresponding -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:24 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:24 +0000 Received: from localhost ([127.0.0.1]:42168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB5-0002Ow-Py for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:24 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:45823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHAz-0002Nw-W0 for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:18 -0400 Received: by mail-qt1-f181.google.com with SMTP id r7so3887191qta.12 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TbM2uZIlEXZ3guTcWXscZGuwMTdXKJAYrWq+ax3jwSI=; b=Pfxj4MrjBO8ocHNkIHIUaUndb58R76vQ27EU/Akse30jK2uQXKPU+JV5p9a+Z2LPwY /wq5Hw6FRm1qg3Ebu7SHsx33+dm8aT+7LZ2qHFRuAJmr7Rl7sCjwXANYSMmY8jv57RFa XHKfobDfc7KPsbcQvyz7/EycwG8FpT2dZdiXHAjkNCfb7ILuzzat9fNamYOrYrPYqdt1 j/o41NKy5MZ+bsN0gZTLbSY+NzXTcLz3uJpZqqYfkQXHhazA0M3zpFL/djb/LoDDS392 hJDfzML/0ah/pFUL7D5UruLvrqvQymTiCCw3VwbpSd73pDSi5JLAm3lOFEAQEUaOqRQy ++sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TbM2uZIlEXZ3guTcWXscZGuwMTdXKJAYrWq+ax3jwSI=; b=Yt/yBut/BDP1MyD7ak6IH6NE9hNKiiccXaoVd19s+3GHKXKBF219Q9YmeCHmL+q2X1 lLffuQbGqtjv/6HFmQ9b+YMYjaVxj7wlNERs3fsk401AuaCMJKEGxMM5Zqj+d/wyuYhp 1jXsydDuKqwOuwQF0WsDA5ukOr/nQ4rA3e47luyTm8xlYG8uy/d+7sxuxt1rH/xmYNHd SnPYgyhS6GAO2+aY09HGhLm3xL3xnfxra5DZ3vM+sZugX05vcfLrfDmeaUPHhPROEL8g 8/Fduf0/bcQVpHa8I4ecI8/koAHUNmd+ZcL2JDHymY/3OQysdBkNtSh+2nAOn03D7+cP 0chQ== X-Gm-Message-State: AOAM530UIXzJFmKECcNl3/EqAmA5KPEKays0g7J+bz9qXdKMxrNreG8N qhyXVkcqnqTd90eKXfFsLU4P9+0G3PGtgA== X-Google-Smtp-Source: ABdhPJywDy3CJG8zQmNJZ9COqjZdXA2vqKN+R10u3ZAK+/2sa0l1YcCVp7ye/8P1yCzGWG5aNUecxQ== X-Received: by 2002:ac8:4646:: with SMTP id f6mr3180511qto.114.1624509672244; Wed, 23 Jun 2021 21:41:12 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:11 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 2/7] pack: Factorize base tar options. Date: Thu, 24 Jun 2021 00:40:44 -0400 Message-Id: <20210624044049.17906-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * guix/docker.scm (%tar-determinism-options): Move to a new module and rename to `tar-base-options'. Adjust references accordingly. * guix/build/pack.scm: New file. * Makefile.am (MODULES): Register it. * guix/scripts/pack.scm (self-contained-tarball/builder): Use it. --- Makefile.am | 1 + guix/build/pack.scm | 52 +++++++++++++++++++++++++++ guix/docker.scm | 20 ++--------- guix/scripts/pack.scm | 81 +++++++++++++++++-------------------------- 4 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 guix/build/pack.scm diff --git a/Makefile.am b/Makefile.am index 7bb5de007e..15ac03ebd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -220,6 +220,7 @@ MODULES = \ guix/build/linux-module-build-system.scm \ guix/build/store-copy.scm \ guix/build/json.scm \ + guix/build/pack.scm \ guix/build/utils.scm \ guix/build/union.scm \ guix/build/profiles.scm \ diff --git a/guix/build/pack.scm b/guix/build/pack.scm new file mode 100644 index 0000000000..05c7a3c594 --- /dev/null +++ b/guix/build/pack.scm @@ -0,0 +1,52 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Maxim Cournoyer +;;; +;;; 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 build pack) + #:use-module (guix build utils) + #:export (tar-base-options)) + +(define* (tar-base-options #:key tar compressor) + "Return the base GNU tar options required to produce deterministic archives +deterministically. When TAR, a GNU tar command file name, is provided, the +`--sort' option is used only if supported. When COMPRESSOR, a command such as +'(\"gzip\" \"-9n\"), is provided, the compressor is explicitly specified via +the `-I' option." + (define (tar-supports-sort? tar) + (zero? (system* tar "cf" "/dev/null" "--files-from=/dev/null" + "--sort=name"))) + + `(,@(if compressor + (list "-I" (string-join compressor)) + '()) + ;; The --sort option was added to GNU tar in version 1.28, released + ;; 2014-07-28. For testing, we use the bootstrap tar, which is older + ;; and doesn't support it. + ,@(if (and=> tar tar-supports-sort?) + '("--sort=name") + '()) + ;; Use GNU format so there's no file name length limitation. + "--format=gnu" + "--mtime=@1" + "--owner=root:0" + "--group=root:0" + ;; The 'nlink' of the store item files leads tar to store hard links + ;; instead of actual copies. However, the 'nlink' count depends on + ;; deduplication in the store; it's an "implicit input" to the build + ;; process. Use '--hard-dereference' to eliminate it. + "--hard-dereference" + "--check-links")) diff --git a/guix/docker.scm b/guix/docker.scm index 889aaeacb5..bd952e45ec 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -21,6 +21,7 @@ (define-module (guix docker) #:use-module (gcrypt hash) #:use-module (guix base16) + #:use-module (guix build pack) #:use-module ((guix build utils) #:select (mkdir-p delete-file-recursively @@ -110,18 +111,6 @@ Return a version of TAG that follows these rules." (rootfs . ((type . "layers") (diff_ids . #(,(layer-diff-id layer))))))) -(define %tar-determinism-options - ;; GNU tar options to produce archives deterministically. - '("--sort=name" "--mtime=@1" - "--owner=root:0" "--group=root:0" - - ;; When 'build-docker-image' is passed store items, the 'nlink' of the - ;; files therein leads tar to store hard links instead of actual copies. - ;; However, the 'nlink' count depends on deduplication in the store; it's - ;; an "implicit input" to the build process. '--hard-dereference' - ;; eliminates it. - "--hard-dereference")) - (define directive-file ;; Return the file or directory created by a 'evaluate-populate-directive' ;; directive. @@ -238,7 +227,7 @@ SRFI-19 time-utc object, as the creation time in metadata." (apply invoke "tar" "-cf" "../layer.tar" `(,@transformation-options - ,@%tar-determinism-options + ,@(tar-base-options) ,@paths ,@(scandir "." (lambda (file) @@ -273,9 +262,6 @@ SRFI-19 time-utc object, as the creation time in metadata." (scm->json (repositories prefix id repository))))) (apply invoke "tar" "-cf" image "-C" directory - `(,@%tar-determinism-options - ,@(if compressor - (list "-I" (string-join compressor)) - '()) + `(,@(tar-base-options #:compressor compressor) ".")) (delete-file-recursively directory))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index ac477850e6..d11f498925 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -205,12 +205,14 @@ dependencies are registered." (not (equal? '(guix store deduplication) module)))) (with-imported-modules (source-module-closure - `((guix build utils) + `((guix build pack) + (guix build utils) (guix build union) (gnu build install)) #:select? import-module?) #~(begin - (use-modules (guix build utils) + (use-modules (guix build pack) + (guix build utils) ((guix build union) #:select (relative-file-name)) (gnu build install) (srfi srfi-1) @@ -240,19 +242,10 @@ dependencies are registered." ;; Fully-qualified symlinks. (append-map symlink->directives '#$symlinks)) - ;; The --sort option was added to GNU tar in version 1.28, released - ;; 2014-07-28. For testing, we use the bootstrap tar, which is - ;; older and doesn't support it. - (define tar-supports-sort? - (zero? (system* (string-append #+archiver "/bin/tar") - "cf" "/dev/null" "--files-from=/dev/null" - "--sort=name"))) - ;; Make sure non-ASCII file names are properly handled. #+set-utf8-locale - ;; Add 'tar' to the search path. - (setenv "PATH" #+(file-append archiver "/bin")) + (define tar #+(file-append archiver "/bin/tar")) ;; Note: there is not much to gain here with deduplication and there ;; is the overhead of the '.links' directory, so turn it off. @@ -269,45 +262,33 @@ dependencies are registered." (for-each (cut evaluate-populate-directive <> %root) directives) - ;; Create the tarball. Use GNU format so there's no file name - ;; length limitation. + ;; Create the tarball. (with-directory-excursion %root - (apply invoke "tar" - #+@(if (compressor-command compressor) - #~("-I" - (string-join - '#+(compressor-command compressor))) - #~()) - "--format=gnu" - ;; Avoid non-determinism in the archive. - ;; Use mtime = 1, not zero, because that is what the daemon - ;; does for files in the store (see the 'mtimeStore' constant - ;; in local-store.cc.) - (if tar-supports-sort? "--sort=name" "--mtime=@1") - "--owner=root:0" - "--group=root:0" - "--check-links" - "-cvf" #$output - ;; Avoid adding / and /var to the tarball, so - ;; that the ownership and permissions of those - ;; directories will not be overwritten when - ;; extracting the archive. Do not include /root - ;; because the root account might have a - ;; different home directory. - #$@(if localstatedir? - '("./var/guix") - '()) - - (string-append "." (%store-directory)) - - (delete-duplicates - (filter-map (match-lambda - (('directory directory) - (string-append "." directory)) - ((source '-> _) - (string-append "." source)) - (_ #f)) - directives))))))) + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor '#+(and=> compressor compressor-command)) + "-cvf" ,#$output + ;; Avoid adding / and /var to the tarball, so + ;; that the ownership and permissions of those + ;; directories will not be overwritten when + ;; extracting the archive. Do not include /root + ;; because the root account might have a + ;; different home directory. + ,#$@(if localstatedir? + '("./var/guix") + '()) + + ,(string-append "." (%store-directory)) + + ,@(delete-duplicates + (filter-map (match-lambda + (('directory directory) + (string-append "." directory)) + ((source '-> _) + (string-append "." source)) + (_ #f)) + directives)))))))) (define* (self-contained-tarball name profile #:key target -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:24 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:24 +0000 Received: from localhost ([127.0.0.1]:42170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB6-0002Oz-CT for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:24 -0400 Received: from mail-qk1-f174.google.com ([209.85.222.174]:43997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB0-0002Ny-Cs for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:18 -0400 Received: by mail-qk1-f174.google.com with SMTP id c23so11165666qkc.10 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bR9tBuVVnovRAAc1CVUMdkJDi9V0lhIZZj6dRJ9yP0o=; b=ncVINzS/Ub82NtbwuSj6rV+u5Y/w/VfjKUjl/FcsCAG5paR5p8X3lA/TYPnuzl9tNP agID8JaXTK50ukNHu4NJAGIc3vgdBAbDraLKSgSclC9qzJLopM4Sr2pBfKSe9rA72Xft /SVRIojHQ/R3MAoG7d2EAxRqbs9IOP/kx1nlhmYttLxb/2ShBmyeOHG+WrOqXHLd9Cvx 3IWWJu+xzfoHMeMsmNFyfcNMwyMu+Zgk72NAxW+C8dP/P3SmwzsOb7qlMjPH87h4UAFa 21n1V0xnavSsOyfrM9xk8t7Bj7OgrQZ0yu5JJ8gMc2ti7wTtrirrEwm3I3FwWQHE9CFz GINA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bR9tBuVVnovRAAc1CVUMdkJDi9V0lhIZZj6dRJ9yP0o=; b=Z6Wrjl2CEzAjGgbDWDz5b/hYvRJXLi5s8DGPiaSIjino6Qb1qr3K1oI+6Ub2jFEB45 Etd1+6NJWqbLK99dRy2GsaYMGhPv1M5x3uwpC3bA0NedxKouhM4Eatn1854nstGD+jna 8xk5AgGRNNwn+Ji7UM1ZCS84ak9dV+j7/ymctopu0OReftrp8w/KEBZ6i9in5j0efRdZ y91p++JwX1bLNt1FBcFVHCiIUiFA3p4DqLj1yy9oELFGC9klQgn4ioF5lEgQpSFuafe9 7PWGkZHXSX4EQ2B8qANVwZarPb++zn1QAZxTj56czx7kTSiQFvr9DI9d9qoC9uEERXap MjNw== X-Gm-Message-State: AOAM5317Byj68llPk/Odaw8xZIZY+vj4jZxZuSd3Fguqo0jpnixtSdxF Q2WfvP1M7ILDKfbp3enQjZk6JKq+2k+scg== X-Google-Smtp-Source: ABdhPJzrXdI4GZmoBgdr+mIWlOU/wu+lp8Qq6roxWC+ftBvxq2OxO590enEvWmlEtNZS4dUn4FSZng== X-Received: by 2002:ae9:f312:: with SMTP id p18mr3642857qkg.206.1624509672916; Wed, 23 Jun 2021 21:41:12 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:12 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 3/7] pack: Fix typo. Date: Thu, 24 Jun 2021 00:40:45 -0400 Message-Id: <20210624044049.17906-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * guix/scripts/pack.scm (self-contained-tarball/builder): Fix typo. --- guix/scripts/pack.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d11f498925..7ea97a4b7a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -229,7 +229,7 @@ dependencies are registered." (let ((target (string-append #$profile "/" target)) (parent (dirname source))) ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownnership when extracting the archive (see + ;; preserve its ownership when extracting the archive (see ;; below), and also because this would lead to adding the ;; same entries twice in the tarball. `(,@(if (string=? parent "/") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:25 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:25 +0000 Received: from localhost ([127.0.0.1]:42172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB6-0002P6-KN for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:24 -0400 Received: from mail-qv1-f49.google.com ([209.85.219.49]:46865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB1-0002O0-Jc for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:20 -0400 Received: by mail-qv1-f49.google.com with SMTP id u2so2642690qvp.13 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kE7TyvdDvkatZ9Rb0jmWVOLl69bHGgulZpTCfUj3VEk=; b=a+Fo45O/NqkS0dfS7FawrG8up4eVV/R4/+d80kV35LolIvrs+WmbKelkkfpkN2vKm5 GRu+qINk47N3PwNP1qcm3CrWQquw8BhPDsRc+rQoMrpGIHb88efgwI+aYadcgmWi//zm oqKsKXpC0c3bdQM7pYcqIxsym9Uo0cOpZ9nwau1HCipi5R8CYZjbzPOMOtSD9BZOvTPc OSDz73MJPu2s9rH7HoOtdzmCftfbpTprxL+TUtgaDXm/E/lukAVMAscxPj8VP0Nj8w/X FyY8WRB9KbTBBFgDtjRzHMNZP6TFdU4QYqLYNEvwVm1cq0fbxHbbEyGU9LPuZUHRYoxj zloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kE7TyvdDvkatZ9Rb0jmWVOLl69bHGgulZpTCfUj3VEk=; b=dp3tQV5/9d1uzJVQC6Dvo6sdUTCWmGRjA/kQxSATrnvS0wbHt61ZPMGlB1cpBPoqsw NW8FIcZUH3YV536wwipkLjPcuKKky7bgqyRA2BonuRyDks3qKV/Hhh3BbR2XOWWoy9V1 pFjKGBdAv7hhgqlePukSlKq5iYQ3jAiVv4Be2a6085DQVCcqetCazGCAzN0CS5meUikk lYsBbj9YS0+dhZWFlDjWw8irqrJNpD1F25wiV2ROU9ZnJD+qEJOyYS5PpYdGQ02XoJqM DISWcianyOsPBzxtwznp7u11Lsbm+a2d7H9JEzzOFyfGZo7O0y/lkRt3NzRQj8847oGp dZzA== X-Gm-Message-State: AOAM533AhQLKoQdjCWTa/r1Ab+rFILoCptdWfUpj0T34ZX4Ts7ARDkr/ mVQi/hXncgQrInJaqskQETFrZpdYZ7N3tw== X-Google-Smtp-Source: ABdhPJy6kxFYDEYjxL3zkHtFPRVBBfBqtuWNSEMgsV8X5FGQqrjWjCIUu/rzXlisHzPLaQrn3eIIzw== X-Received: by 2002:ad4:55eb:: with SMTP id bu11mr3620611qvb.2.1624509674035; Wed, 23 Jun 2021 21:41:14 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:13 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 4/7] pack: Improve naming of the packs store file names. Date: Thu, 24 Jun 2021 00:40:46 -0400 Message-Id: <20210624044049.17906-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) Instead of just naming them by their pack type, add information from the package(s) they contain to make it easier to differentiate them. * guix/scripts/pack.scm (define-with-source): New macro. (manifest->friendly-name): Extract procedure from ... (docker-image): ... here, now defined via the above macro. Adjust REPOSITORY argument value accordingly. (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. --- guix/scripts/pack.scm | 49 +++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7ea97a4b7a..ad432f2b63 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -172,6 +172,28 @@ dependencies are registered." (computed-file "store-database" build #:options `(#:references-graphs ,(zip labels items)))) +(define-syntax-rule (define-with-source (variable args ...) body body* ...) + "Bind VARIABLE to a procedure accepting ARGS defined as BODY, also setting +its source property." + (begin + (define (variable args ...) + body) + (eval-when (load eval) + (set-procedure-property! variable 'source + '(define (variable args ...) body body* ...))))) + +(define-with-source (manifest->friendly-name manifest) + "Return a friendly name computed from the entries in MANIFEST, a + object." + (let loop ((names (map manifest-entry-name + (manifest-entries manifest)))) + (define str (string-join names "-")) + (if (< (string-length str) 40) + str + (match names + ((_) str) + ((names ... _) (loop names)))))) + ;;; ;;; Tarball format. @@ -540,7 +562,7 @@ the image." (file-append (store-database (list profile)) "/db/db.sqlite"))) - (define defmod 'define-module) ;trick Geiser + (define defmod 'define-module) ;trick Geiser (define build ;; Guile-JSON and Guile-Gcrypt are required by (guix docker). @@ -558,6 +580,8 @@ the image." (srfi srfi-1) (srfi srfi-19) (ice-9 match)) + #$(procedure-source manifest->friendly-name) + (define environment (map (match-lambda ((spec . value) @@ -581,19 +605,6 @@ the image." `((directory "/tmp" ,(getuid) ,(getgid) #o1777) ,@(append-map symlink->directives '#$symlinks))) - (define tag - ;; Compute a meaningful "repository" name, which will show up in - ;; the output of "docker images". - (let ((manifest (profile-manifest #$profile))) - (let loop ((names (map manifest-entry-name - (manifest-entries manifest)))) - (define str (string-join names "-")) - (if (< (string-length str) 40) - str - (match names - ((_) str) - ((names ... _) (loop names))))))) ;drop one entry - (setenv "PATH" #+(file-append archiver "/bin")) (build-docker-image #$output @@ -601,7 +612,8 @@ the image." (call-with-input-file "profile" read-reference-graph)) #$profile - #:repository tag + #:repository (manifest->friendly-name + (profile-manifest #$profile)) #:database #+database #:system (or #$target %host-type) #:environment environment @@ -1209,8 +1221,6 @@ Create a bundle of PACKAGE.\n")) manifest) manifest))) (pack-format (assoc-ref opts 'format)) - (name (string-append (symbol->string pack-format) - "-pack")) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) (compressor (if bootstrap? @@ -1244,7 +1254,10 @@ Create a bundle of PACKAGE.\n")) (hooks (if bootstrap? '() %default-profile-hooks)) - (locales? (not bootstrap?))))) + (locales? (not bootstrap?)))) + (name (string-append (manifest->friendly-name manifest) + "-" (symbol->string pack-format) + "-pack"))) (define (lookup-package package) (manifest-lookup manifest (manifest-pattern (name package)))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:25 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:25 +0000 Received: from localhost ([127.0.0.1]:42174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB7-0002PD-0k for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:25 -0400 Received: from mail-qt1-f170.google.com ([209.85.160.170]:42700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB2-0002O3-7u for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:20 -0400 Received: by mail-qt1-f170.google.com with SMTP id x21so3905103qtq.9 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cj+VO9kGHPIMPZNWQUldz/0xcId7j7VDvjBbQZGXql0=; b=YU1FjtLQn8BlWbX0D8VUv7XwwSA6kCWWDTZrYdcA/FjlLCSCBmRNj3IUaxJVXIk0mX 0dhWdWe7zWBltqa9O+EnB40mFjvKoJftlFbue5dNnawX6WtbSS0VnY1Cx1XI+SBf+B7b H+MdIlavlaRQwMMVk4mErQMF3cREySrhsLrhFqSZxHr5HsYNYagiQZF+XTTGr4jtKRmv N+jf01MeHsNR0TVhL0baKsRrVXHKXY7dIXEzb0FaESRVytKlRmDdmmPVgdzta3+/0fKR WzVBQOoKnV0v5vP68LjW8o78YPmp/3hT20Ut4gtBNC7stByf6f46PILkVgl7BZLzGjya 2hzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cj+VO9kGHPIMPZNWQUldz/0xcId7j7VDvjBbQZGXql0=; b=kHBzlWUYKyQoYax96gBpykcf/iJ60aqiZR5tbArvxN/0yD691Cn6yAwBB4TSblZq1l psT0+/MDRXWRR/j3EQXV2ArJGHOSZorgEt/FcoJM5vF1+xRDliP1Z3Y276y9ChrzwF/o 6/XQv6maOfoosjvtx3QN+o/7F0fg1aEvmUweLFIkjB5Frh7PBg0Butzi77DdaAaGyCBL B4HpLWdDMswGMhwPHGG4wUME4jOEJD9AGqRQNaDmPQ4FqPUHIEgllamXo+unyEgJEg4/ CMw7g3aJrw0uwvqD3YcAuwdY3XYDOhlxmRd5FOkh06pGzvEjC4iK9HNhNXvqzxkcd524 zdUg== X-Gm-Message-State: AOAM533AHyLpbjSJLf4QU7SQaiyGExyPBQVcX3wuEHGbAJydevweU9WH mdvQ2/I+YaZPhacpsV60H2qJhtmm/SxzKQ== X-Google-Smtp-Source: ABdhPJxNUP7LsqUUr/9IH7AsdrSifIp5JeNUTZtZ5jfTdqtPIHpcQ7m9eBNaUF9HA+HmKCgKl48Juw== X-Received: by 2002:ac8:7f94:: with SMTP id z20mr3142236qtj.17.1624509674678; Wed, 23 Jun 2021 21:41:14 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:14 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 5/7] pack: Prevent duplicate files in tar archives. Date: Thu, 24 Jun 2021 00:40:47 -0400 Message-Id: <20210624044049.17906-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) Tar translate duplicate files in the archive into hard links. These can cause problems, as not every tool support them; for example dpkg doesn't. * gnu/system/file-systems.scm (reduce-directories): New procedure. (file-prefix?): Lift the restriction on file prefix. The procedure can be useful for comparing relative file names. Adjust doc. (file-name-depth): New procedure, extracted from ... (btrfs-store-subvolume-file-name): ... here. * guix/scripts/pack.scm (self-contained-tarball/builder): Use reduce-directories. * tests/file-systems.scm ("reduce-directories"): New test. --- gnu/system/file-systems.scm | 56 +++++++++++++++++++++++++------------ guix/scripts/pack.scm | 6 ++-- tests/file-systems.scm | 7 ++++- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 464e87cb18..fb87bfc85b 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -55,6 +55,7 @@ file-system-dependencies file-system-location + reduce-directories file-system-type-predicate btrfs-subvolume? btrfs-store-subvolume-file-name @@ -231,8 +232,8 @@ (char-set-complement (char-set #\/))) (define (file-prefix? file1 file2) - "Return #t if FILE1 denotes the name of a file that is a parent of FILE2, -where both FILE1 and FILE2 are absolute file name. For example: + "Return #t if FILE1 denotes the name of a file that is a parent of FILE2. +For example: (file-prefix? \"/gnu\" \"/gnu/store\") => #t @@ -240,19 +241,41 @@ where both FILE1 and FILE2 are absolute file name. For example: (file-prefix? \"/gn\" \"/gnu/store\") => #f " - (and (string-prefix? "/" file1) - (string-prefix? "/" file2) - (let loop ((file1 (string-tokenize file1 %not-slash)) - (file2 (string-tokenize file2 %not-slash))) - (match file1 - (() - #t) - ((head1 tail1 ...) - (match file2 - ((head2 tail2 ...) - (and (string=? head1 head2) (loop tail1 tail2))) - (() - #f))))))) + (let loop ((file1 (string-tokenize file1 %not-slash)) + (file2 (string-tokenize file2 %not-slash))) + (match file1 + (() + #t) + ((head1 tail1 ...) + (match file2 + ((head2 tail2 ...) + (and (string=? head1 head2) (loop tail1 tail2))) + (() + #f)))))) + +(define (file-name-depth file-name) + (length (string-tokenize file-name %not-slash))) + +(define (reduce-directories file-names) + "Eliminate entries in FILE-NAMES that are children of other entries in +FILE-NAMES. This is for example useful when passing a list of files to GNU +tar, which would otherwise descend into each directory passed and archive the +duplicate files as hard links, which can be undesirable." + (let* ((file-names/sorted + ;; Ascending sort by file hierarchy depth, then by file name length. + (stable-sort (delete-duplicates file-names) + (lambda (f1 f2) + (let ((depth1 (file-name-depth f1)) + (depth2 (file-name-depth f2))) + (if (= depth1 depth2) + (string< f1 f2) + (< depth1 depth2))))))) + (reverse (fold (lambda (file-name results) + (if (find (cut file-prefix? <> file-name) results) + results ;parent found -- skipping + (cons file-name results))) + '() + file-names/sorted)))) (define* (file-system-device->string device #:key uuid-type) "Return the string representations of the DEVICE field of a @@ -624,9 +647,6 @@ store is located, else #f." s (string-append "/" s))) - (define (file-name-depth file-name) - (length (string-tokenize file-name %not-slash))) - (and-let* ((btrfs-subvolume-fs (filter btrfs-subvolume? file-systems)) (btrfs-subvolume-fs* (sort btrfs-subvolume-fs diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index ad432f2b63..84f2f14343 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -230,13 +230,15 @@ its source property." `((guix build pack) (guix build utils) (guix build union) - (gnu build install)) + (gnu build install) + (gnu system file-systems)) #:select? import-module?) #~(begin (use-modules (guix build pack) (guix build utils) ((guix build union) #:select (relative-file-name)) (gnu build install) + ((gnu system file-systems) #:select (reduce-directories)) (srfi srfi-1) (srfi srfi-26) (ice-9 match)) @@ -303,7 +305,7 @@ its source property." ,(string-append "." (%store-directory)) - ,@(delete-duplicates + ,@(reduce-directories (filter-map (match-lambda (('directory directory) (string-append "." directory)) diff --git a/tests/file-systems.scm b/tests/file-systems.scm index 7f7c373884..80acb6d5b9 100644 --- a/tests/file-systems.scm +++ b/tests/file-systems.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2017 Ludovic Courtès -;;; Copyright © 2020 Maxim Cournoyer +;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +50,11 @@ (device "/foo") (flags '(bind-mount read-only))))))))) +(test-equal "reduce-directories" + '("./opt/gnu/" "./opt/gnuism" "a/b/c") + (reduce-directories '("./opt/gnu/etc" "./opt/gnu/" "./opt/gnu/bin" + "./opt/gnu/lib/debug" "./opt/gnuism" "a/b/c" "a/b/c"))) + (test-assert "does not pull (guix config)" ;; This module is meant both for the host side and "build side", so make ;; sure it doesn't pull in (guix config), which depends on the user's -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:25 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:25 +0000 Received: from localhost ([127.0.0.1]:42176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB7-0002PL-GL for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:25 -0400 Received: from mail-qv1-f51.google.com ([209.85.219.51]:37825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB2-0002O5-Ow for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:21 -0400 Received: by mail-qv1-f51.google.com with SMTP id x6so2669469qvx.4 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qSAIxVQhLym4ockDJVf5oH4DzRJDWkmIYemB/0gAtOg=; b=fv4GXaPommwKi2bBdeavCeZdqemT0VQdFXwktrr7ZiW/+RuwTH+H7QSiDRlizvy12o 0cprt1yhzbUQv1Yy0AwkjGLthRhYQxTEKwJE2H6czMxX9nT+iIqIzSBwV1kuaCqrvQnT 97W53eHGpOaBgwaAWpN4OZeJYSGUjmuliJk1I/XkULHYwmSzxyfIASt/F5PEys4Nq3+n PQQ7vZY5xI79x3ZCmkUQd0vlUcqLACt+RVQcAtHr9WueJhHMNNinbaNqJ4p6qsD5AJBs qyH89ZN1Ihdww1f9ELK00znYQ4UNiyiRP6TS8V6Jg1BJ3KeOpr0Y+E/azs2J/O/eisNs 8Ztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qSAIxVQhLym4ockDJVf5oH4DzRJDWkmIYemB/0gAtOg=; b=iPaoQmHp3QM69cqQdw+AWZTTsVjBMDKzlWmIvvZQTgkHqRYtwByCl8ZcQbf4KWcgs4 ou+mtt1omV4FAmpwWRhA0gIrJNTwcgB2PGP20a5Jv0jiKMw/aAQJ7VEhP1Xp/ZHVR8Zs bKyJvDdrpeou8rswSXDYsdSoMrwM8MwJ6Rgif//1q5G2DLiLF6KQjfqY0WWnVIAW9jWa piRC/hQn2wIcejp3CxHTSmmEUBUDxbiKxqCb9UoVvAu/ZhXPfmEwbNJBzuJZZfcMl2sx x1hlZ4EB1yBNLwVS0P8VHxZuSy39sdDEkWy4t2sU8vWTOqPhwQWeYsF81tDfyOvsFfPG XMpA== X-Gm-Message-State: AOAM531sgHgZ7cYfp1bWV/K6S5m6EOnN4wijaY5mbVpnGQBNDXtoa5c2 lf+hoJBv44RHfnTXysMAO0KQ1dU9/nNAqA== X-Google-Smtp-Source: ABdhPJwVti/njtenVcKg4dDMGxpSplY5w/Ax4KitcF4S0UG+GsEPU4gQ0EpzfsVdAtn+yofroZeo6A== X-Received: by 2002:ad4:5343:: with SMTP id v3mr3515931qvs.45.1624509675293; Wed, 23 Jun 2021 21:41:15 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:14 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 6/7] tests: pack: Fix compressor extension. Date: Thu, 24 Jun 2021 00:40:48 -0400 Message-Id: <20210624044049.17906-6-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * tests/pack.scm (%gzip-compressor): Add the missing leading period to the gzip compressor file extension. --- tests/pack.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pack.scm b/tests/pack.scm index e8455b4f37..ae6247a1d5 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -51,7 +51,7 @@ (define %gzip-compressor ;; Compressor that uses the bootstrap 'gzip'. ((@ (guix scripts pack) compressor) "gzip" - "gz" + ".gz" #~(#+(file-append %bootstrap-coreutils&co "/bin/gzip") "-6n"))) (define %tar-bootstrap %bootstrap-coreutils&co) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:41:38 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:41:38 +0000 Received: from localhost ([127.0.0.1]:42179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHBJ-0002Pr-PS for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:38 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:34455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHB3-0002O7-Hw for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:41:23 -0400 Received: by mail-qk1-f181.google.com with SMTP id g4so11279929qkl.1 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rls3Hb6sj4/2cHidCCg+vAj3YdiwdkeQFPh8443keHo=; b=TWz7pci1VkeZtC2G0nAGxBxPeT+8t7aThlwAacMyuEFIDzfhLihfOhEEGOMOFG8NeA d9SyTW7iWvObuqoeQk7xOLyqZ/ggrVbC2tXAlwyzaDnw0u13wQWZ3MEzi59WvRmFlDdq HwtY5B0apG1CtfADSEBArnT2uNZFYHTy6lQA5UXLAd6qO3/B1twic2CpfKfmSbeOLbzp SvfTQvcnILJgJXgFJl/rgjPsjc0EzpA4Ekio8C4lpFzlcySnjrUrTrgD2u5oC4XGGHRk dyG1bbHb8w0ISrr8Kr/xMI98r8SDBfxryCKqaEcJO9d9dwgtGbe6WH2rP1giH6K+KLrN xhAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rls3Hb6sj4/2cHidCCg+vAj3YdiwdkeQFPh8443keHo=; b=RlSdTla+JuI5MzC7xwxkxkg1Sl+cZ323vqXuVgfXEtqg+RkjB7QntluJZccxCZ6Iv4 bXL81NiHFPGfEP3xYw7BkC+z0+lwakRlc4HpNh7nx43sFgue0Vb4eRnKrlwL7yRy/sU1 dc8pGqmNSU+zZzE0txDnMRB+C3c3Gr07Qxn3c2wgQ8dFWvubOsm7uH1yQ1CdLTLXiwvb evQgSoIQRL2JOxsKNDActQ/KVDfl8PwBM80XqWGz04H6iz2PgCOFaoqKneLRlIy/Y2Y1 Vnu0OxfZnwPw6AYXajnGDcaWcSkRwDD3G1PUF4Q1c2FC42dZcLITq+/mN7VyaueYRcwR 7uZg== X-Gm-Message-State: AOAM533pcmWfcf+qcp+tjeYWJ2N4gwWiTHGJjNouNCsWJU8zj+zqBqN1 /kF1rraOWe6EWZL8nZDM5TD/mITQfFq9GA== X-Google-Smtp-Source: ABdhPJzi/yW3mJhpPvugsQYfrh90K38WH2k1GGNyNf860qFKgb7l+KF8alMk8Voha68DC1CcV6SdJA== X-Received: by 2002:a37:620f:: with SMTP id w15mr3788651qkb.99.1624509676051; Wed, 23 Jun 2021 21:41:16 -0700 (PDT) Received: from localhost.localdomain ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id q199sm1603880qka.112.2021.06.23.21.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:41:15 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: [PATCH v2 7/7] pack: Add support for the deb format. Date: Thu, 24 Jun 2021 00:40:49 -0400 Message-Id: <20210624044049.17906-7-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210624044049.17906-1-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Maxim Cournoyer 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: -1.0 (-) * .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule. * guix/scripts/pack.scm (debian-archive): New procedure. (%formats): Register the new deb format. (show-formats): Add it to the usage string. * tests/pack.scm (%ar-bootstrap): New variable. (deb archive with symlinks): New test. * doc/guix.texi (Invoking guix pack): Document it. --- .dir-locals.el | 1 + doc/guix.texi | 5 ++ guix/scripts/pack.scm | 178 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 75 ++++++++++++++++++ 4 files changed, 258 insertions(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index 8f07a08eb5..a4fcbfe7ca 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -75,6 +75,7 @@ (eval . (put 'origin 'scheme-indent-function 0)) (eval . (put 'build-system 'scheme-indent-function 0)) (eval . (put 'bag 'scheme-indent-function 0)) + (eval . (put 'gexp->derivation 'scheme-indent-function 1)) (eval . (put 'graft 'scheme-indent-function 0)) (eval . (put 'operating-system 'scheme-indent-function 0)) (eval . (put 'file-system 'scheme-indent-function 0)) diff --git a/doc/guix.texi b/doc/guix.texi index 15e8999447..70de6b16ae 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6025,6 +6025,11 @@ This produces a SquashFS image containing all the specified binaries and symlinks, as well as empty mount points for virtual file systems like procfs. +@item deb +This produces a Debian archive (a package with the @samp{.deb} file +extension) containing all the specified binaries and symlinks, that can +be installed on top of any dpkg-based GNU/Linux distribution. + @quotation Note Singularity @emph{requires} you to provide @file{/bin/sh} in the image. For that reason, @command{guix pack -f squashfs} always implies @code{-S diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 84f2f14343..7de061d7ae 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Eric Bavier +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +66,7 @@ %compressors lookup-compressor self-contained-tarball + debian-archive docker-image squashfs-image @@ -346,6 +348,10 @@ added to the pack." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Singularity. +;;; (define (singularity-environment-file profile) "Return a shell script that defines the environment variables corresponding to the search paths of PROFILE." @@ -372,6 +378,10 @@ to the search paths of PROFILE." (computed-file "singularity-environment.sh" build)) + +;;; +;;; SquashFS image format. +;;; (define* (squashfs-image name profile #:key target (profile-name "guix-profile") @@ -546,6 +556,10 @@ added to the pack." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Docker image format. +;;; (define* (docker-image name profile #:key target (profile-name "guix-profile") @@ -633,6 +647,165 @@ the image." #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; Debian archive format. +;;; +;;; TODO: When relocatable option is selected, install to a unique prefix. +;;; This would enable installation of multiple deb packs with conflicting +;;; files at the same time. +;;; TODO: Allow passing a custom control file from the CLI. +;;; TODO: Allow providing a postinst script. +(define* (debian-archive name profile + #:key target + (profile-name "guix-profile") + deduplicate? + entry-point + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (archiver tar)) + "Return a Debian archive (.deb) containing a store initialized with the +closure of PROFILE, a derivation. The archive contains /gnu/store; if +LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db +with a properly initialized store database. The supported compressors are +\"none\", \"gz\" or \"xz\". + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + ;; For simplicity, limit the supported compressors to the superset of + ;; compressors able to compress both the control file (gz or xz) and the + ;; data tarball (gz, bz2 or xz). + (define %valid-compressors '("gzip" "xz" "none")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid Debian archive compressor. \ +Valid compressors are: ~a~%") compressor-name %valid-compressors))) + + (when entry-point + (warning (G_ "entry point not supported in the '~a' format~%") + 'deb)) + + (define data-tarball + (computed-file (string-append "data.tar" + (compressor-extension compressor)) + (self-contained-tarball/builder + profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:local-build? #f ;allow offloading + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) + + (define build + (with-extensions (list guile-gcrypt) + (with-imported-modules `(((guix config) => ,(make-config.scm)) + ,@(source-module-closure + `((guix build pack) + (guix build utils) + (guix profiles)) + #:select? not-config?)) + #~(begin + (use-modules (guix build pack) + (guix build utils) + (guix profiles) + (ice-9 match) + (srfi srfi-1)) + + (define machine-type + ;; Extract the machine type from the specified target, else from the + ;; current system. + (and=> (or #$target %host-type) (lambda (triplet) + (first (string-split triplet #\-))))) + + (define (gnu-machine-type->debian-machine-type type) + "Translate machine TYPE from the GNU to Debian terminology." + ;; Debian has its own jargon, different from the one used in GNU, for + ;; machine types (see data/cputable in the sources of dpkg). + (match type + ("i686" "i386") + ("x86_64" "amd64") + ("aarch64" "arm64") + ("mipsisa32r6" "mipsr6") + ("mipsisa32r6el" "mipsr6el") + ("mipsisa64r6" "mips64r6") + ("mipsisa64r6el" "mips64r6el") + ("powerpcle" "powerpcel") + ("powerpc64" "ppc64") + ("powerpc64le" "ppc64el") + (machine machine))) + + (define architecture + (gnu-machine-type->debian-machine-type machine-type)) + + #$(procedure-source manifest->friendly-name) + + (define manifest (profile-manifest #$profile)) + + (define single-entry ;manifest entry + (match (manifest-entries manifest) + ((entry) + entry) + (() #f))) + + (define package-name (or (and=> single-entry manifest-entry-name) + (manifest->friendly-name manifest))) + + (define package-version + (or (and=> single-entry manifest-entry-version) + "0.0.0")) + + (define debian-format-version "2.0") + + ;; Generate the debian-binary file. + (call-with-output-file "debian-binary" + (lambda (port) + (format port "~a~%" debian-format-version))) + + (define data-tarball-file-name (strip-store-file-name + #+data-tarball)) + + (copy-file #+data-tarball data-tarball-file-name) + + (define control-tarball-file-name + (string-append "control.tar" + #$(compressor-extension compressor))) + + ;; Write the compressed control tarball. Only the control file is + ;; mandatory (see: 'man deb' and 'man deb-control'). + (call-with-output-file "control" + (lambda (port) + (format port "\ +Package: ~a +Version: ~a +Description: Debian archive generated by GNU Guix. +Maintainer: GNU Guix +Architecture: ~a +~%" package-name package-version architecture))) + + (define tar (string-append #+archiver "/bin/tar")) + + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor '#+(and=> compressor compressor-command)) + "-cvf" ,control-tarball-file-name + "control")) + + ;; Create the .deb archive using GNU ar. + (invoke (string-append #+binutils "/bin/ar") "-rv" #$output + "debian-binary" + control-tarball-file-name data-tarball-file-name))))) + + (gexp->derivation (string-append name ".deb") + build + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. @@ -965,7 +1138,8 @@ last resort for relocation." ;; Supported pack formats. `((tarball . ,self-contained-tarball) (squashfs . ,squashfs-image) - (docker . ,docker-image))) + (docker . ,docker-image) + (deb . ,debian-archive))) (define (show-formats) ;; Print the supported pack formats. @@ -977,6 +1151,8 @@ last resort for relocation." squashfs Squashfs image suitable for Singularity")) (display (G_ " docker Tarball ready for 'docker load'")) + (display (G_ " + deb Debian archive installable via dpkg/apt")) (newline)) (define %options diff --git a/tests/pack.scm b/tests/pack.scm index ae6247a1d5..9473d4f384 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module ((gnu packages base) #:select (glibc-utf8-locales)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages compression) #:select (squashfs-tools)) + #:use-module ((gnu packages debian) #:select (dpkg)) #:use-module ((gnu packages guile) #:select (guile-sqlite3)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (srfi srfi-64)) @@ -56,6 +58,8 @@ (define %tar-bootstrap %bootstrap-coreutils&co) +(define %ar-bootstrap %bootstrap-binutils) + (test-begin "pack") @@ -270,6 +274,77 @@ 1) (pk 'guilelink (readlink "bin")))) (mkdir #$output)))))))) + (built-derivations (list check)))) + + (unless store (test-skip 1)) + (test-assertm "deb archive with symlinks" store + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile (profile-derivation (packages->manifest + (list %bootstrap-guile)) + #:hooks '() + #:locales? #f)) + (deb (debian-archive "deb-pack" profile + #:compressor %gzip-compressor + #:symlinks '(("/opt/gnu/bin" -> "bin")) + #:archiver %tar-bootstrap)) + (check + (gexp->derivation "check-deb-pack" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match) + (ice-9 popen) + (ice-9 rdelim) + (ice-9 textual-ports) + (rnrs base)) + + (setenv "PATH" (string-join + (list (string-append #+%tar-bootstrap "/bin") + (string-append #+dpkg "/bin") + (string-append #+%ar-bootstrap "/bin")) + ":")) + + ;; Validate the output of 'dpkg --info'. + (let* ((port (open-pipe* OPEN_READ "dpkg" "--info" #$deb)) + (info (get-string-all port)) + (exit-val (status:exit-val (close-pipe port)))) + (assert (zero? exit-val)) + + (assert (string-contains + info + (string-append "Package: " + #+(package-name %bootstrap-guile)))) + + (assert (string-contains + info + (string-append "Version: " + #+(package-version %bootstrap-guile))))) + + ;; Sanity check .deb contents. + (invoke "ar" "-xv" #$deb) + (assert (file-exists? "debian-binary")) + (assert (file-exists? "data.tar.gz")) + (assert (file-exists? "control.tar.gz")) + + ;; Verify there are no hard links in data.tar.gz, as hard + ;; links would cause dpkg to fail unpacking the archive. + (define hard-links + (let ((port (open-pipe* OPEN_READ "tar" "-tvf" "data.tar.gz"))) + (let loop ((hard-links '())) + (match (read-line port) + ((? eof-object?) + (assert (zero? (status:exit-val (close-pipe port)))) + hard-links) + (line + (if (string-prefix? "u" line) + (loop (cons line hard-links)) + (loop hard-links))))))) + + (unless (null? hard-links) + (error "hard links found in data.tar.gz" hard-links)) + + (mkdir #$output)))))) (built-derivations (list check))))) (test-end) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 24 00:44:23 2021 Received: (at 49149) by debbugs.gnu.org; 24 Jun 2021 04:44:23 +0000 Received: from localhost ([127.0.0.1]:42197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHDz-0002Vf-6n for submit@debbugs.gnu.org; Thu, 24 Jun 2021 00:44:23 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:41806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwHDw-0002VQ-M8 for 49149@debbugs.gnu.org; Thu, 24 Jun 2021 00:44:21 -0400 Received: by mail-qk1-f181.google.com with SMTP id bl4so11201983qkb.8 for <49149@debbugs.gnu.org>; Wed, 23 Jun 2021 21:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UjmKYON8A5LaJojxIww1p3rwxOApi45Y4XFQkGoYkCw=; b=vR0qWEXl6JiW1JRqewFKf1zOuF96VtPGRS7ukQvDGTyjF0xcMPgsfUdt6daAw3vVvV t5O9H4gLUdoxwSh+ig4qsPXDmdPyGifWa/eypk7exK9IFXAAHhgG7MbmbwnZQ4nOW48J L0VtjSE3Or1JeAO2bWDWSO/97WWWW4EoaUg/FNrIKF9oUazY2Ad2Li5Rlgt6h9mNBmr1 ciL5+rzLlgyz87EagVO/jHhq4i8Utp56CDx9y1jQ2b4HNDssAb2ne2z0m+BcsXVEIk9t cNHRJPsLttyus19Kz5DhaJfJmLeIu5LUIPye1smYMwgmrQiqr/Qr9ioPZCIDTY85aSkB EsRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UjmKYON8A5LaJojxIww1p3rwxOApi45Y4XFQkGoYkCw=; b=VY3xyKF4ID3XeNgE89GjEdUH0y3QdmzZL7P2dAERstObiHs/9BZX6z4RfVDtQRUIfQ cEBNe40kXaAgDf/EraEua3Hgq36z6qbEO0wRaJe5HDUyYSdMBuijm0irtG6OT9drgjiq f5qBFaoRoKvV8LP5UEuQr8T7Xh0FEA2JjMk1S9mwtCmYMa/X0PA/G445R8XJ5HesmULR DsWdFdnFHW3k9s0Y3LraFZCB5q356fnT0KhT7uJp6XCZIhIMHqipvbY0p7d9t8eQ/RX3 9yGew9MpouZPYuiqPj8MZiLeTbEVcNtoRn3c06DxNKw7xTIKqlcgJ13tOKZHCNkLARR5 KoJQ== X-Gm-Message-State: AOAM530Ovp1Hfr5QZKrWiWjkPdHyHMaMIudVzHU2d78nIflOZu1dCa8l 61PV/QeJPm/6ZlBoA15zEH6OlLU6KFqa1g== X-Google-Smtp-Source: ABdhPJyFGVXfe7GlzeizNHn8MVu9zjFCApskChilfmlLuZhsiy8JoKm0u8LqdUwLYUAiXgdY6orfdA== X-Received: by 2002:a37:6c4:: with SMTP id 187mr3789469qkg.95.1624509855264; Wed, 23 Jun 2021 21:44:15 -0700 (PDT) Received: from hurd ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id s81sm1649543qka.82.2021.06.23.21.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 21:44:14 -0700 (PDT) From: Maxim Cournoyer To: Maxime Devos Subject: Re: [bug#49149] [PATCH 4/7] pack: Improve naming of the packs store file names. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-5-maxim.cournoyer@gmail.com> <66838991d056aed2ab4c198e27df0a7fa4357a74.camel@telenet.be> <87k0mm2dzu.fsf@gmail.com> Date: Thu, 24 Jun 2021 00:44:13 -0400 In-Reply-To: (Maxime Devos's message of "Wed, 23 Jun 2021 12:22:14 +0200") Message-ID: <87y2az27oi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hello Maxime & Ludovic, Maxime Devos writes: >> I'm not sure how the expansion would be usable in the module it is >> defined? It seems I could manage to get 'manifest->friendly-name' to be >> a procedure returning a gexp, but that gexp wouldn't be readily usable >> in that module (it could only be used when gexp-unquote from inside >> another G-Exp), and the expansion in the macro above doesn't bind any >> identifier, unless I'm missing something? > > The macro does two things: define a procedure manifest->friendly-name > that returns a string. > > (define (manifest->friendly-name manifest) > "Return a friendly name computed from the entries in MANIFEST, a > object." > (let loop ((names (map manifest-entry-name > (manifest-entries manifest)))) > (define str (string-join names "-")) > (if (< (string-length str) 40) > str > (match names > ((_) str) > ((names ... _) (loop names))))))) ;drop one entry > > and also define a G-exp define-manifest->friendly-name > > (define define-manifest->friendly-nam > #~(define (manifest->friendly-name manifes) > "Return a friendly name [...]" > [...]) Thanks a lot for persevering in your explanations, that made it clear and with some ideas from the fine folks in #guile was able to come up with this: --8<---------------cut here---------------start------------->8--- (define-syntax-rule (define-with-source (variable args ...) body body* ...) "Bind VARIABLE to a procedure accepting ARGS defined as BODY, also setting its source property." (begin (define (variable args ...) body) (eval-when (load eval) (set-procedure-property! variable 'source '(define (variable args ...) body body* ...))))) (define-with-source (manifest->friendly-name manifest) "Return a friendly name computed from the entries in MANIFEST, a object." (let loop ((names (map manifest-entry-name (manifest-entries manifest)))) (define str (string-join names "-")) (if (< (string-length str) 40) str (match names ((_) str) ((names ... _) (loop names)))))) --8<---------------cut here---------------end--------------->8--- And then use it inside the build G-Exp via: #$(procedure-source manifest->friendly-name) The pack tests are still passing. Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 01:03:40 2021 Received: (at 49149) by debbugs.gnu.org; 26 Jun 2021 05:03:40 +0000 Received: from localhost ([127.0.0.1]:47049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx0Tj-00039l-VW for submit@debbugs.gnu.org; Sat, 26 Jun 2021 01:03:40 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:38789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lx0Th-00039P-Ej for 49149@debbugs.gnu.org; Sat, 26 Jun 2021 01:03:38 -0400 Received: by mail-qk1-f170.google.com with SMTP id 65so4054612qko.5 for <49149@debbugs.gnu.org>; Fri, 25 Jun 2021 22:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=rNSw8qnrRpIOdrB3ohVnWx66Uk4+wR4BzfjPGzivJ/0=; b=kyLEG9ETvhfYM7/Feo2MQRJIS9uRwK549ZYOk04sglYrT8E8W0CCANEK5sgAKq5yOk AY3zh0+y2YhQMq+lcGDmz9bpDp2njpOY8Wp6MH8Cpi7XelfqGTogZWAJnjAXePJ04Iuj 4V5teBziB6r9uX3kEhuMjIgTkYCo7CreMGemHGmxpsbnv5g+rB13Zna2eyFTGjrTmr39 sJTDKDSJ/RBrUoG2NUYgDaLG39uB7uZ1iKS6DJBASdw1h/1zz44tZr4967rdPoVteEnb ft4CG+DK/8I6LzI5x0Mrd9GrrGpOQ0AmsFR06+IqTatoK+VPnkYIsGvJfZ+NT5ctfEj5 6cDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rNSw8qnrRpIOdrB3ohVnWx66Uk4+wR4BzfjPGzivJ/0=; b=F3C2IHgIigJcf7nI8Ncc7fh4ybwIuKe4MfMOf/k0s7VY0h1nzjIgNMNPmihhiu3JwY k0XnIce+CbUF/gvTRuxrNGAkhLrofZ8pb0DOTVT8y0p59Rv7K1sbXphFaHgFxv+lFkNK vnpH8o0b/hAtZ5HMH1ODGSgv1SiTRSw1SDtNPmhY9gN8+5VV4GKhFFmV2P1GOLZKWZkV 1Rg+2hQv6Hpjls1CKfNVd2Iu/SxN6NqWqrOwnq1qbyi8vl8fnHQ9WzLR3wUsnKl+5wDT eqXjiXWeEUEMF0mMJe27rnp+gXRL3zWIl+XW3WLgJMIH6aZHA877iPi3h0OvMKwArnVl klbQ== X-Gm-Message-State: AOAM530Bm+2t1srIknZM9pzu/QD9TI2j+MNVi9L/AJg3mAwv3Y6dUugz 0eHjuNqlYktMU4d9eOA39tEGT3+sdIJjgYYj X-Google-Smtp-Source: ABdhPJwxOW5Fz5G6imJlIhldfiPYMFhPNtSUdo7V2aTkpOIuILYgmTuzw9lsKF2Qs5bbr+To4rbqIw== X-Received: by 2002:a37:a20c:: with SMTP id l12mr7118102qke.479.1624683811830; Fri, 25 Jun 2021 22:03:31 -0700 (PDT) Received: from hurd (dsl-10-149-111.b2b2c.ca. [72.10.149.111]) by smtp.gmail.com with ESMTPSA id w3sm6596014qkp.55.2021.06.25.22.03.30 for <49149@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 22:03:31 -0700 (PDT) From: Maxim Cournoyer To: 49149@debbugs.gnu.org Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> Date: Sat, 26 Jun 2021 01:03:30 -0400 In-Reply-To: <20210624044049.17906-4-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Thu, 24 Jun 2021 00:40:46 -0400") Message-ID: <87wnqhw731.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 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: -1.0 (-) Hi, Maxim Cournoyer writes: [...] > +(define-syntax-rule (define-with-source (variable args ...) body body* ...) > + "Bind VARIABLE to a procedure accepting ARGS defined as BODY, also setting > +its source property." > + (begin > + (define (variable args ...) > + body) Some typo slipped here. It should have been body body* ..., as in the template. > + (eval-when (load eval) > + (set-procedure-property! variable 'source > + '(define (variable args ...) body body* ...))))) > + Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 12:58:40 2021 Received: (at 49149) by debbugs.gnu.org; 26 Jun 2021 16:58:41 +0000 Received: from localhost ([127.0.0.1]:48571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBdg-0006Uh-OP for submit@debbugs.gnu.org; Sat, 26 Jun 2021 12:58:40 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:43034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBdc-0006UT-2B for 49149@debbugs.gnu.org; Sat, 26 Jun 2021 12:58:38 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id Msya250030mfAB401syalP; Sat, 26 Jun 2021 18:58:34 +0200 Message-ID: <55cd0daaf579eff0d00e99213ca8205575b6752a.camel@telenet.be> Subject: Re: [bug#49149] [PATCH v2 7/7] pack: Add support for the deb format. From: Maxime Devos To: Maxim Cournoyer , 49149@debbugs.gnu.org Date: Sat, 26 Jun 2021 18:58:28 +0200 In-Reply-To: <20210624044049.17906-7-maxim.cournoyer@gmail.com> References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-7-maxim.cournoyer@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-DR0T/0WQtBaOOk51aLE8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1624726714; bh=ii+ftbrh9jkTAFoSSMQD8ZSQAZWGthz9vBg/Kag9Umk=; h=Subject:From:To:Date:In-Reply-To:References; b=t0/YL8HXUx+t++o0SNwXE3tebK4C/67KKKR7jcRXucWmSc9c5bi6Gnt5FE/c2IJM/ 9ZMMXsRw5qhWiTu1+sbPit0s5lybOqUOMOo6+5WaJGrOjAG68TgTiFQfgRB9F9aJyx 2oqpZmFVraKSnnEZh0D5YgCT67oqE0EAut4t3W61jlC6/m1utQC+SRYoqo+ljMeAwh p9kOb0xWJrRktEdrZIYWs1do3SgiaAWiT36OrC19flY5WNZUrk3PrfbryOzdZU6x4h QVCvshXBlg8A/nI8K4zMJDKaG1sBc5CTFvgt0i19fUTp8McP/twC5bJUemmQnG+Bm3 dogDWq5oRhkQg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49149 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: -1.7 (-) --=-DR0T/0WQtBaOOk51aLE8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxim Cournoyer schreef op do 24-06-2021 om 00:40 [-0400]: > + (define (gnu-machine-type->debian-machine-type type) > + "Translate machine TYPE from the GNU to Debian terminology= ." > + ;; Debian has its own jargon, different from the one used = in GNU, for > + ;; machine types (see data/cputable in the sources of dpkg= ). > + (match type > + ("i686" "i386") > + ("x86_64" "amd64") I'd add i586->i386 here as well, to allow the "i586-gnu" target (for the Hu= rd). (Debian has a Hurd port: https://www.debian.org/ports/hurd/). Maybe more is needed for proper Hurd support though. For completeness, I'd also add i486->i386, to allow "guix pack hello --target=3Di486-linux-gnu --format=3Dtarball" as well. Ok, i486-linux-gnu isn't a =E2=80=98supported=E2=80=99 cross-targe= t, but why not? Greetings, Maxime. --=-DR0T/0WQtBaOOk51aLE8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNdctBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lHuAQClGAlrD6VcLntpYtK78uJpCVHS 0ZNcoV2j2G6MSrMbdwEA4Dq0xNj7+xo3kZcZkE0xNWPTJf65++oHUVgBQFEYHQo= =yaSx -----END PGP SIGNATURE----- --=-DR0T/0WQtBaOOk51aLE8-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 13:49:27 2021 Received: (at 49149) by debbugs.gnu.org; 29 Jun 2021 17:49:27 +0000 Received: from localhost ([127.0.0.1]:55268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyHrT-0003XA-1L for submit@debbugs.gnu.org; Tue, 29 Jun 2021 13:49:27 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:40810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyHrR-0003Wv-C2 for 49149@debbugs.gnu.org; Tue, 29 Jun 2021 13:49:25 -0400 Received: by mail-qt1-f182.google.com with SMTP id t9so16726420qtw.7 for <49149@debbugs.gnu.org>; Tue, 29 Jun 2021 10:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=L6ca82scihmb1jsxvcTgxMHO6XrFaHsMzadKlDoMPGk=; b=FB3Jid1Lzfdr4AFKyzI6yivHtMWZJxpZk/MqnkVgvWuG4ZNt7V2/yk1uZgDhX3B/K+ YVo1l4pT4O+12njqrhoSU9xm2rwDcLAoCgXwHn4QO1MTYZKTgVDAmqpcbL7pb8aR6uYu Qgmu3kMH0Y0ds5p1WlBo0c3MNDWKf72kCeRibhiS2kiqSttI1Y02CGLiyyt4c3CLgshJ waLCPIOmUyQG+zrTuPR1M6sjvkDKxuzetadmMo0RfdJ0WP/RnThlIrb7AZ6gSTvKEOiJ MYuFolCz69xCRIrit/zhrX08aFxS469ezjaVx1QcsCufXzItWIgAW7kqUNr2hdQsr2qb w4UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=L6ca82scihmb1jsxvcTgxMHO6XrFaHsMzadKlDoMPGk=; b=rqDUGzPDLsQdEthHlIlWaq6M6xpqEPod7BWggyMZW4bCKcMEtfAFo0RYMU5bqUiE3L 5XUbxTo9sJBdj4jyP9zR5CkUu0NKwFXUNmAHiJVpioKfu5iulm7VC8pURDdFlDdUY6hj xCXv3MTWv9xRYoOZsqGZmh1dAbC+ujtuRYBPB4Sxf18EBCQqX73hgvUHmqm83R/e8UuL 47WedAWXhQUYeX9ET7iM+ppkuy90Dc/boCIwec02YeX3F1uN3oqvEiNAU9oDm0nHwaCK InpI1iqlCzetOLPh07mvfYBqiPV6T7tlfMlxBEhFJdkKRDifS/d4d7BJifxfL3Dt4/cm LbQg== X-Gm-Message-State: AOAM533AFBBnuSj9BF+Wam1ChyQXYSLCOxZkSAFNCu04RzY0hPayrKOn UUzRpmjBMFErjYHV3nmR5voJ67Ad6+1JBA== X-Google-Smtp-Source: ABdhPJwpQqIjSuRor6oae9bin4pj2AnBkmxRLy2lkenQNuvpk5MhrRhp9A/HKEbP1CvFYEU34SwlBA== X-Received: by 2002:a05:622a:170d:: with SMTP id h13mr27587305qtk.264.1624988959627; Tue, 29 Jun 2021 10:49:19 -0700 (PDT) Received: from hurd (dsl-10-148-155.b2b2c.ca. [72.10.148.155]) by smtp.gmail.com with ESMTPSA id h1sm4107957qkm.50.2021.06.29.10.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 10:49:19 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> Date: Tue, 29 Jun 2021 13:49:18 -0400 In-Reply-To: <87eecsuv85.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 23 Jun 2021 23:28:10 +0200") Message-ID: <87k0mcv9wh.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hello! Seems this one had fallen into the cracks of my hundred something long mailbox. Sorry! Ludovic Court=C3=A8s writes: > Hello! > > Maxim Cournoyer skribis: > >> This patch set adds support to produce Debian archives (.deb packages) v= ia >> guix pack. It's rudimentary but functional. You can try a simple examp= le >> like so: >> >> $ ./pre-inst-env guix pack -f deb -C xz hello -S /usr/bin/hello=3Dbin/he= llo >> >> Copy the generated .deb to your dpkg-based distribution of choice, then: >> >> $ sudo apt install ./91ypmi1j5py9qk034kki5wrgy0n52yz9-hello-deb-pack.deb >> >> $ realpath $(which hello) >> /gnu/store/lk9cmjjhgxpkxxi7m54y0jlv3rqvpb2n-hello-2.10/bin/hello >> $ hello >> Hello, world! >> >> Fun, no? We can now distribute software built with Guix transparently t= o any >> Debian-based distribution. > > Definitely fun. :-) > > As briefly discussed on IRC, I wonder what happens when installing > multiple such .deb files, and removing them selectively. There=E2=80=99s= of > course going to be overlapping store items. > Apparently, dpkg will happily overwrite them when you install (and > that=E2=80=99s fine, if they have the same name, they=E2=80=99re identica= l), but what > happens when you remove one of them? Does it, for instance, remove > /gnu/store/=E2=80=A6-glibc just because it =E2=80=9Cbelongs=E2=80=9D to t= hat package, without > noticing that it also belongs to other installed packages? Actually, dpkg will error with a conflict message if two distinct packages try to install the same file. Only a package with the same name can overwrite itself. > If dpkg cannot deal with that, it=E2=80=99s equivalent to a tarball pack = for all > practical purposes, except you=E2=80=99d run =E2=80=9Csudo apt=E2=80=9D i= nstead of =E2=80=9Csudo tar=E2=80=9D. Given you can't install two conflicting packages, the issue of removing the files of another package cannot arise. In practice that means that the current implementation of 'guix pack -f deb' would only allow installing *one* such .deb package on a system at a time (most applications will carry the glibc and thus conflict for example). For a multi deb-pack scenario, we could have each .deb install their own files under for example /opt/guix/deb-packs/$name/gnu/store... via the relocatable option. > WDYT? Is our official Debian ambassador around? :-) > > A complementary approach would be to transparently build Guix packages > in a Debian VM, with an FHS layout, and with dependencies on Debian > packages. I remember there were tools for that in Nixpkgs back in the > day, using Checkinstall to generate the actual .deb file. It could be fun! Although my next 'guix pack' hack will have to be --format=3Drpm, to complement this one ;-). Thanks! Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 15:20:30 2021 Received: (at 49149-done) by debbugs.gnu.org; 29 Jun 2021 19:20:30 +0000 Received: from localhost ([127.0.0.1]:55477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJHa-0005pN-1m for submit@debbugs.gnu.org; Tue, 29 Jun 2021 15:20:30 -0400 Received: from mail-qv1-f51.google.com ([209.85.219.51]:39931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyJHZ-0005pA-3l for 49149-done@debbugs.gnu.org; Tue, 29 Jun 2021 15:20:29 -0400 Received: by mail-qv1-f51.google.com with SMTP id j14so1945726qvu.6 for <49149-done@debbugs.gnu.org>; Tue, 29 Jun 2021 12:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=g8oKQLV4zfjP4ihigZ4/lo4rX14lILgTJpaDcIxkPls=; b=SpHr6ZhUaa42tio0LgjDWDj9aE+zvJXkxKKuMY1UhACQrfDHHZelJK91lJBUvuF/1e el5YWoIRLI+o+etNX4tzEoSGkbWCQjMYrxUvgWK6sLSM4cv9mkIy6Ux2TrVC20/o7yQl yFbpv+oAdKPLgSnYa1jFK5bzDPw5Oo8vC63NhYmtP8F9HfFp2mcXB91sBpEf1KuSvi8X K+58f8HUmSCv3soMXxiAttTPk8oDOJaMRLulor2XL2UXhvXgr2g0JJGo/3aDHsgUFdmP VQrVfh+tTA94Ro65fUMlf7ejoyW4uAiYrgPihYWCHhMxSXPgeSTYdYmF7N1SqD3080Qt leYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=g8oKQLV4zfjP4ihigZ4/lo4rX14lILgTJpaDcIxkPls=; b=jdrwBz2wuJnZ3DN37tyO2VGzS7B0LBm/UX9HuGk19/7rhCH8yEMYLpK6wSp3STqXL9 eoM21/G9adXGgPFmM4nSnMKtbLHpaHlwjvD0E/6LklE0e+8MkUvse7MsTfi7wZlZJrOk JsPZx8t+YSsY0W3KMqCcDztrH4/AmIfbSh2TzL8uWcnRioPWm2LsSN6ydHCiMPZRmntJ H3jECZ6PDxcnp0dwZSwR1fQ4It/NPpuXm+mvapl7WKeMRDkM71tYFPMnwmLkH1lirFLe 50erHVViVZugLkF69Lb/bb920MBzeFbYsgex3612qcp11E7X73V26N3kwfgzFtoYhNBx k+8w== X-Gm-Message-State: AOAM530+OQJhC/Y911Of4kBXkdiy56w5KzH3/GEMjU/4RX+j/pQrTzHF F75vJ1rxI7egnI/rFsxl8rql1WI6ynH3vA== X-Google-Smtp-Source: ABdhPJwnfgY01NyL/fzwjlS54aahg41aVQYpEGcgqXizZlCyZETk9qUg9i2tkZ+nWS1xl2FHS1sRzw== X-Received: by 2002:a0c:f60a:: with SMTP id r10mr32752216qvm.53.1624994423483; Tue, 29 Jun 2021 12:20:23 -0700 (PDT) Received: from hurd (dsl-10-148-155.b2b2c.ca. [72.10.148.155]) by smtp.gmail.com with ESMTPSA id h6sm9739367qta.65.2021.06.29.12.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 12:20:23 -0700 (PDT) From: Maxim Cournoyer To: Maxime Devos Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-7-maxim.cournoyer@gmail.com> <55cd0daaf579eff0d00e99213ca8205575b6752a.camel@telenet.be> Date: Tue, 29 Jun 2021 15:20:21 -0400 In-Reply-To: <55cd0daaf579eff0d00e99213ca8205575b6752a.camel@telenet.be> (Maxime Devos's message of "Sat, 26 Jun 2021 18:58:28 +0200") Message-ID: <87czs4v5oq.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149-done Cc: 49149-done@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: -1.0 (-) Hello! Maxime Devos writes: > Maxim Cournoyer schreef op do 24-06-2021 om 00:40 [-0400]: >> + (define (gnu-machine-type->debian-machine-type type) >> + "Translate machine TYPE from the GNU to Debian terminolog= y." >> + ;; Debian has its own jargon, different from the one used= in GNU, for >> + ;; machine types (see data/cputable in the sources of dpk= g). >> + (match type >> + ("i686" "i386") >> + ("x86_64" "amd64") > > I'd add i586->i386 here as well, to allow the "i586-gnu" target (for the = Hurd). > (Debian has a Hurd port: https://www.debian.org/ports/hurd/). > Maybe more is needed for proper Hurd support though. > > For completeness, I'd also add i486->i386, > to allow "guix pack hello --target=3Di486-linux-gnu --format=3Dtarball" > as well. Ok, i486-linux-gnu isn't a =E2=80=98supported=E2=80=99 cross-tar= get, but why not? Done. Series pushed in commit 6396f0c235231d4d41d11fffa021251ea6aa90a7. Thanks for the review! Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 05:15:40 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 09:15:40 +0000 Received: from localhost ([127.0.0.1]:56437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyWJo-0007a7-4p for submit@debbugs.gnu.org; Wed, 30 Jun 2021 05:15:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyWJm-0007Zs-9K for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 05:15:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32886) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyWJh-0006N5-3i; Wed, 30 Jun 2021 05:15:33 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42572 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyWJg-00058P-Sj; Wed, 30 Jun 2021 05:15:33 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 30 Jun 2021 11:15:31 +0200 In-Reply-To: <87k0mcv9wh.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Tue, 29 Jun 2021 13:49:18 -0400") Message-ID: <87bl7npvbg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Howdy! Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> Apparently, dpkg will happily overwrite them when you install (and >> that=E2=80=99s fine, if they have the same name, they=E2=80=99re identic= al), but what >> happens when you remove one of them? Does it, for instance, remove >> /gnu/store/=E2=80=A6-glibc just because it =E2=80=9Cbelongs=E2=80=9D to = that package, without >> noticing that it also belongs to other installed packages? > > Actually, dpkg will error with a conflict message if two distinct > packages try to install the same file. Only a package with the same > name can overwrite itself. Ah OK. Also, what happens if you do: sudo apt install guix guix install stuff =E2=80=A6 sudo apt install ./guix-pack-generated.deb ? Will that overwrite things in /gnu/store? Admittedly it makes little sense to do something like this, but that=E2=80= =99s something one could do. >> If dpkg cannot deal with that, it=E2=80=99s equivalent to a tarball pack= for all >> practical purposes, except you=E2=80=99d run =E2=80=9Csudo apt=E2=80=9D = instead of =E2=80=9Csudo tar=E2=80=9D. > > Given you can't install two conflicting packages, the issue of removing > the files of another package cannot arise. In practice that means that > the current implementation of 'guix pack -f deb' would only allow > installing *one* such .deb package on a system at a time (most > applications will carry the glibc and thus conflict for example). I see. So the main value over =E2=80=9Csudo tar xf=E2=80=9D is that dpkg k= nows which files were installed, right? > For a multi deb-pack scenario, we could have each .deb install their own > files under for example /opt/guix/deb-packs/$name/gnu/store... via the > relocatable option. Hmm yeah, though it doesn=E2=80=99t sound pretty. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 06:06:42 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 10:06:43 +0000 Received: from localhost ([127.0.0.1]:56497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyX7C-0000TO-Ky for submit@debbugs.gnu.org; Wed, 30 Jun 2021 06:06:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyX7A-0000TA-SW for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 06:06:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33782) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyX75-00015r-Nf; Wed, 30 Jun 2021 06:06:35 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42580 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyX75-0005zv-G3; Wed, 30 Jun 2021 06:06:35 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-6-maxim.cournoyer@gmail.com> Date: Wed, 30 Jun 2021 12:06:34 +0200 In-Reply-To: <20210621061205.31878-6-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 21 Jun 2021 02:12:03 -0400") Message-ID: <87wnqboedx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hi, Maxim Cournoyer skribis: > Tar translate duplicate files in the archive into hard links. These can = cause > problems, as not every tool support them; for example dpkg doesn't. > > * gnu/system/file-systems.scm (reduce-directories): New procedure. > (file-prefix?): Lift the restriction on file prefix. The procedure can be > useful for comparing relative file names. Adjust doc. > (file-name-depth): New procedure, extracted from ... > (btrfs-store-subvolume-file-name): ... here. > * guix/scripts/pack.scm (self-contained-tarball/builder): Use > reduce-directories. > * tests/file-systems.scm ("reduce-directories"): New test. [...] > (define (file-prefix? file1 file2) > - "Return #t if FILE1 denotes the name of a file that is a parent of FIL= E2, > -where both FILE1 and FILE2 are absolute file name. For example: > + "Return #t if FILE1 denotes the name of a file that is a parent of FIL= E2. > +For example: >=20=20 > (file-prefix? \"/gnu\" \"/gnu/store\") > =3D> #t > @@ -240,19 +241,41 @@ where both FILE1 and FILE2 are absolute file name. = For example: > (file-prefix? \"/gn\" \"/gnu/store\") > =3D> #f > " > - (and (string-prefix? "/" file1) > - (string-prefix? "/" file2) Doesn=E2=80=99t it have the effect that now: (file-prefix? "gnu" "/gnu/store") =3D> #t ? I=E2=80=99d rather insist on absolute file names and preserve the initial semantics, to avoid bad surprises. > +(define (reduce-directories file-names) > + "Eliminate entries in FILE-NAMES that are children of other entries in > +FILE-NAMES. This is for example useful when passing a list of files to = GNU > +tar, which would otherwise descend into each directory passed and archiv= e the > +duplicate files as hard links, which can be undesirable." > + (let* ((file-names/sorted > + ;; Ascending sort by file hierarchy depth, then by file name l= ength. > + (stable-sort (delete-duplicates file-names) > + (lambda (f1 f2) > + (let ((depth1 (file-name-depth f1)) > + (depth2 (file-name-depth f2))) > + (if (=3D depth1 depth2) > + (string< f1 f2) > + (< depth1 depth2))))))) > + (reverse (fold (lambda (file-name results) > + (if (find (cut file-prefix? <> file-name) results) > + results ;parent found -- skipping > + (cons file-name results))) > + '() > + file-names/sorted)))) Likewise, I suspect it doesn=E2=80=99t work as intended if there are relati= ve file names in the list, no? Perhaps we could add an example to the docstring. Also, the word =E2=80=9Creduce=E2=80=9D doesn=E2=80=99t appear in the docstring, which to = me suggests suboptimal naming. ;-) Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 06:10:12 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 10:10:12 +0000 Received: from localhost ([127.0.0.1]:56501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyXAa-0000YZ-6Z for submit@debbugs.gnu.org; Wed, 30 Jun 2021 06:10:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyXAY-0000YF-OQ for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 06:10:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33818) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyXAR-0003It-Qh; Wed, 30 Jun 2021 06:10:04 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42582 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyXAQ-0006E5-29; Wed, 30 Jun 2021 06:10:02 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-7-maxim.cournoyer@gmail.com> Date: Wed, 30 Jun 2021 12:10:00 +0200 In-Reply-To: <20210624044049.17906-7-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Thu, 24 Jun 2021 00:40:49 -0400") Message-ID: <87sg0zoe87.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Maxim Cournoyer skribis: > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -6025,6 +6025,11 @@ This produces a SquashFS image containing all the = specified binaries and > symlinks, as well as empty mount points for virtual file systems like > procfs. >=20=20 > +@item deb > +This produces a Debian archive (a package with the @samp{.deb} file > +extension) containing all the specified binaries and symlinks, that can > +be installed on top of any dpkg-based GNU/Linux distribution. =E2=80=9CGNU/Linux (or GNU/Hurd)=E2=80=9D maybe. Perhaps it should explain that the .deb contains the whole store and installs it as /gnu/store, and that only one such pack can be installed at a time? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 06:13:13 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 10:13:14 +0000 Received: from localhost ([127.0.0.1]:56505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyXDV-0000d6-LK for submit@debbugs.gnu.org; Wed, 30 Jun 2021 06:13:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyXDU-0000co-2N for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 06:13:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33922) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyXDO-0005dy-T4; Wed, 30 Jun 2021 06:13:06 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42584 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyXDO-0006m9-LZ; Wed, 30 Jun 2021 06:13:06 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> Date: Wed, 30 Jun 2021 12:13:05 +0200 In-Reply-To: <20210624044049.17906-4-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Thu, 24 Jun 2021 00:40:46 -0400") Message-ID: <87lf6roe32.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Maxim Cournoyer skribis: > Instead of just naming them by their pack type, add information from the > package(s) they contain to make it easier to differentiate them. > > * guix/scripts/pack.scm (define-with-source): New macro. > (manifest->friendly-name): Extract procedure from ... > (docker-image): ... here, now defined via the above macro. Adjust REPOSI= TORY > argument value accordingly. > (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. [...] > - (define tag > - ;; Compute a meaningful "repository" name, which will show= up in > - ;; the output of "docker images". > - (let ((manifest (profile-manifest #$profile))) > - (let loop ((names (map manifest-entry-name > - (manifest-entries manifest)))) > - (define str (string-join names "-")) > - (if (< (string-length str) 40) > - str > - (match names > - ((_) str) > - ((names ... _) (loop names))))))) ;drop one entry I think this should not be factorized because the requirements are very Docker-dependent. Once factorized, it becomes easy to overlook this. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 09:58:36 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 13:58:36 +0000 Received: from localhost ([127.0.0.1]:58360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyajc-00012y-Gd for submit@debbugs.gnu.org; Wed, 30 Jun 2021 09:58:36 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:56079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyaja-00012k-ID for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 09:58:34 -0400 Received: by mail-wm1-f48.google.com with SMTP id j34so2134902wms.5 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 06:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=m7hoWDDSfuWsGe8yJ5FO/sku5tFdc7RAFDmJhLbXOlM=; b=Hp1Tkob+YKI4NNwXEaZNl13HHqz53E/7ZwdKlRN1zgcwaF20m19YyDdYxBO64x+4kP OjKI/DO/Uz9XDLSxopS3FS/eitnxLyR1VOZQrw5xKQOFg70QxvO+v5Jjx9/ACB3J8xQP KqHfEPUWAQCe8+svTpCDefAJQ7I5PrSt/1Pkil/kGlSA1gaBuhreaxvr2BbQWnU3ICh8 2wxGejcysG294zh9Q3sep1fwAURjlzFchhS1dcSNFkbmQtLF98JVesVZZZ7k7/G0DlDK 1cC9L6bJFs6ODPq+RGQeY1tN7iFVs0jz1igtQlFXDtWEkAoZ+1oUl2bGu5sIfDoLIor6 nkIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=m7hoWDDSfuWsGe8yJ5FO/sku5tFdc7RAFDmJhLbXOlM=; b=nbd7Swj7XNWhcaF5g91rkDXaa6uz2oz9DcNl7vBrYBIbzLI+ITWxi7vG7Ef9RUIWfU ayFqO8zaVfmdfRHKQhXeuw9ao2j3SvBOJnOrdypFa/CN6LRjtGH2FpNTm/5VgVL1xtjT IMPMBilQccRUNhP9+S3Qn+dVlHfH04ogKM9sC5u37bDIrLI89YRwocwZ3VOpXeUL6BkS BoefREONwned9LHM42ivrktV6Zwbq7UnozkmgEEuWRhDzqae/G8nlKcUpfOtkpJriFrc sniaWP2VnMmrwMhC1XGtpmF8H8mrTyGHVn6vj8hB7Dtmpjd+vP4HFscuyYw7abNITauj 5+Iw== X-Gm-Message-State: AOAM533XkVi/UDTZqMYDQahYWXGANJAiKNIbU+dk9fTpJ3892Uwb/SEf oNlVB/DeOktz44ZYx95dt9oeg9j56Ww= X-Google-Smtp-Source: ABdhPJzbHWc4Mw6KIA2KZYi5xOomqrONpUoM554POYxI0oDs6iH+Y1CqtFYJ+qNDAKjFu5bMNkmwNA== X-Received: by 2002:a05:600c:2215:: with SMTP id z21mr39710287wml.64.1625061508377; Wed, 30 Jun 2021 06:58:28 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id b9sm25893455wrh.81.2021.06.30.06.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 06:58:27 -0700 (PDT) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxim Cournoyer Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. In-Reply-To: <87bl7npvbg.fsf@gnu.org> References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> Date: Wed, 30 Jun 2021 15:49:03 +0200 Message-ID: <86tulf799s.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hi, I am a bit late to the party. Thanks for this good idea of pack. Neat! On Wed, 30 Jun 2021 at 11:15, Ludovic Court=C3=A8s wrote: > Also, what happens if you do: > > sudo apt install guix > guix install stuff =E2=80=A6 > sudo apt install ./guix-pack-generated.deb > > ? > > Will that overwrite things in /gnu/store? > > Admittedly it makes little sense to do something like this, but that=E2= =80=99s > something one could do. The simple scenario: scp \ $(guix pack -f deb hello -C xz -S /usr/bin/hello=3Dbin/hello) \ remote:/tmp/ ssh remote sudo apt install /tmp/=E2=80=A6-hello-deb-pack.deb realpath $(which hello) /gnu/store/=E2=80=A6-hello-2.10/bin/hello works fine. Then, I am probably doing wrong: sudo apt remove hello hello -bash: hello: command not found guix help bash: /home/simon/.config/guix/current/bin/guix: /gnu/store/=E2=80=A6-gu= ile-wrapper/bin/guile: bad interpreter: No such file or directory I have not investigated. Just a quick test for this nice new feature. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 11:11:52 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 15:11:52 +0000 Received: from localhost ([127.0.0.1]:58478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lybsV-000546-Sf for submit@debbugs.gnu.org; Wed, 30 Jun 2021 11:11:52 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:34530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lybsT-00053t-Rk for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 11:11:50 -0400 Received: by mail-wm1-f46.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso3445227wmc.1 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 08:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=pU7lSOZBhH8OhTod4jFqAeXphFsq73sDcRBj2bVv3KM=; b=sIoPlLrhtVx03x8TehRY0EwIVNuaeXydyipoaLCg2QJg4eoPhEc4gvQyVQ0Th86rgg iA+K0oJo4UJXBYxAaFllj90LPpaF1ohLep452Qz3YIuk9iZtO3sokk3rLJEVzagRRItz 5xgYB/QM8T2b+FAcNPWtycFwfOsAtgoEhpBK8g5YLwISDplaTCOjQE9zj1lGuM6I7cGs oTJxnZT1Z4rWIqH6Hjq4k9Gi6AMmyrFk2Sdm5G2XJJLTLvX3ClZbSLny98ot5LhXXv8V t8Wkx0rWDiRe38c0g1KV6SUHIWZMHabePz4aYvw4y1SkNywgIMVG0iDL0EuOKBiOVt04 E8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=pU7lSOZBhH8OhTod4jFqAeXphFsq73sDcRBj2bVv3KM=; b=guHiyGeyiwlJoGGVZS1auFbgLMiVTHz0tlilyX5/7QuX3ZZbQQwwDSrM36mOem6oRE 0ADajPuWAjIGP4a9KDVkccgNUQ3cATim/fKqZzTX/O7JyBb02Y7S7PD2w6fk5CBlhi/m D3aLVU9d+S+Qr6c3wWDZoASmWEknRHWHztsj59Uk3wdKbIfPyzxEppA3Hu0CJZ/6Slob OMxw3EcEpOyNl7sfEq6jUr7quM0rsQM/GhD2S9aU029ALXEAyScn6TfHZFTcE1LPyXPg fh1+WA/dNBvP5XtmBHrgKYZeTDGWDYFR9be7Y7ftqBz88VypkOFKH/k8VRi+9mltHL9/ hY0Q== X-Gm-Message-State: AOAM5329dt6kzLLIMi3aqZfGehALxjjIjNi9CfqkO9bhMGTb55ukjlia uezWCr8IxYSGpWyb+VnGkxH28zjUk4Y= X-Google-Smtp-Source: ABdhPJwRFSPVWqt8nGYiWcVFt/jlJf2JEAFO+SjnNWX4ul97uR2qXrh/bJ3ot0YpMFFqhHu2xTpw7w== X-Received: by 2002:a7b:c157:: with SMTP id z23mr4041234wmi.148.1625065904001; Wed, 30 Jun 2021 08:11:44 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id f62sm10309693wmf.22.2021.06.30.08.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 08:11:43 -0700 (PDT) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxim Cournoyer Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. In-Reply-To: <86tulf799s.fsf@gmail.com> References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> Date: Wed, 30 Jun 2021 17:06:59 +0200 Message-ID: <86lf6r75nw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hi, Using Guix ebf07a0. I do not know if the issue is about multi-debs or if I am doing something wrong but IIUC =E2=80=99apt=E2=80=99 remove all the files under d= ata/. $ /gnu/store/3v93dzrmh978mljw65zvvydm2w8lqaam-guile-wrapper/bin/guile --ver= sion guile (GNU Guile) 3.0.7 Copyright (C) 2021 Free Software Foundation, Inc. License LGPLv3+: GNU LGPL 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $ guix gc --references /gnu/store/3v93dzrmh978mljw65zvvydm2w8lqaam-guile-wr= apper /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib /gnu/store/226ljnvrhnrb3ngjn0m6i5ih2301bbj0-guile-launcher.c /gnu/store/6l9rix46ydxyldf74dvpgr60rf5ily0c-guile-3.0.7 /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 /gnu/store/xa45bzcbib4zqa7gk70nb35dzzwyr376-gcc-toolchain-7.5.0 $ sudo apt install y74azsczq1dws1slmagc1jq6ysidllpb-hello-deb-pack.deb $ guix gc --references $(realpath $(which hello)) /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10 /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 $ sudo apt remove hello $ ls /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib ls: cannot access '/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-li= b': No such file or directory $ ls -l /gnu/store/3v93dzrmh978mljw65zvvydm2w8lqaam-guile-wrapper/bin/guile -r-xr-xr-x 2 root root 17472 Jan 1 1970 /gnu/store/3v93dzrmh978mljw65zvvy= dm2w8lqaam-guile-wrapper/bin/guile $ /gnu/store/3v93dzrmh978mljw65zvvydm2w8lqaam-guile-wrapper/bin/guile --ver= sion bash: /gnu/store/3v93dzrmh978mljw65zvvydm2w8lqaam-guile-wrapper/bin/guile: = No such file or directory $ ar -xv y74azsczq1dws1slmagc1jq6ysidllpb-hello-deb-pack.deb=20 x - debian-binary x - control.tar.xz x - data.tar.xz $ tar Jtf data.tar.xz | grep glibc | head ./gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-u= nknown-linux-gnu/7.5.0/plugin/include/config/glibc-stdint.h ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/ ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/ ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/catchsegv ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/gencat ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/getconf ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/getent ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/iconv ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/ldd ./gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/locale Therefore, installing and then removing =E2=80=99hello=E2=80=99 breaks any = other pack using, for instance, 01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib or fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31. Do I miss something? Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 12:42:41 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 16:42:41 +0000 Received: from localhost ([127.0.0.1]:58605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydIO-0007Ml-Ip for submit@debbugs.gnu.org; Wed, 30 Jun 2021 12:42:40 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:45054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydIN-0007MX-Bd for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 12:42:39 -0400 Received: by mail-qk1-f180.google.com with SMTP id bj15so3053460qkb.11 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 09:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=flWeIxG99NP++P0uOKEZdSH95CJgkK+ulEgO0iaJmzw=; b=YDmtEtFMR92AvRiWBafWVOCz5QhEe9c7pf34CbVyrPRX426EOg7CzKn5W8Pog/OQgC zNibiy5fjD0c80Y5YnHLZXNfIS7FktVagNPv6WIARnt39buKmd102XGFLF1d+IYEb2m9 NoRzu+vaNADxRNA3Ckzs87cC6lL1vABLpWZDT+jEzjpCycgq0KNKVAac2fXlGnCulDaZ oNVrzqe6xIKPAIzUI+k61cdCGQ3laX0S5a15wo8VJo2d4vBE7XYRWtVvfvQRRdh0E0CO 8nZTTPZBWbNh6/3eF0k7/u569x8W1ZjeuTRmWweivKr9faUePgWEOrZKk2s0mErM3nFn EmOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=flWeIxG99NP++P0uOKEZdSH95CJgkK+ulEgO0iaJmzw=; b=mRBO7s61F563dzuiPKjlb44NofT7IKFfcKzXylqFuXqUzcmV8SJWQ+pWSCSBJAaYS3 r+WaR28d5t/0EC8GYvkZtNvfD2NoQOZgIs9LSKPEvaPhhqffvxl8WjAr6VWuFcUjm5Zx 01SHkEvd3leONWrCLMMWCqrjDRzROO7FB+CAQR2+3nVcpC45HV/KjzBoR+8pnV3qqbQA TIGF3uJRlMtWkJLm1w4sHySgG4FoD7GMUiupyPznlBsr7oCSe7u7oOcXNtNlQmWhkanC MdaneyDig2haY4da2HWcyCPh39jJfTgEUl86+O0SoTt28CX2CXybiFxOUdyBRgzBOeHR lBMg== X-Gm-Message-State: AOAM533L+MIvhUmRGf9u/6vYTy/usoDRDDv3w1PXrV3hMZIKJuT0h0+y iVOlAaf8UC2zKcPu/wH2U3WfLnqFGUbfbg== X-Google-Smtp-Source: ABdhPJw1iNo6c7onI0bqu+tWnJCPvNLVD+xQM+ufuAzl8N8Dkcy9fNvugJh2weO4lm+MU7pwgNi0Cw== X-Received: by 2002:a37:8581:: with SMTP id h123mr37583496qkd.316.1625071353621; Wed, 30 Jun 2021 09:42:33 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id w185sm13953676qkd.30.2021.06.30.09.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 09:42:33 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> Date: Wed, 30 Jun 2021 12:42:32 -0400 In-Reply-To: <87bl7npvbg.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 30 Jun 2021 11:15:31 +0200") Message-ID: <87wnqb483r.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hello! Ludovic Court=C3=A8s writes: > Howdy! > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> Apparently, dpkg will happily overwrite them when you install (and >>> that=E2=80=99s fine, if they have the same name, they=E2=80=99re identi= cal), but what >>> happens when you remove one of them? Does it, for instance, remove >>> /gnu/store/=E2=80=A6-glibc just because it =E2=80=9Cbelongs=E2=80=9D to= that package, without >>> noticing that it also belongs to other installed packages? >> >> Actually, dpkg will error with a conflict message if two distinct >> packages try to install the same file. Only a package with the same >> name can overwrite itself. > > Ah OK. > > Also, what happens if you do: > > sudo apt install guix > guix install stuff =E2=80=A6 > sudo apt install ./guix-pack-generated.deb > > ? > > Will that overwrite things in /gnu/store? > > Admittedly it makes little sense to do something like this, but that=E2= =80=99s > something one could do. It probably would conflict with what is already in the store (installed by guix) and abort installation, guarding against this. >>> If dpkg cannot deal with that, it=E2=80=99s equivalent to a tarball pac= k for all >>> practical purposes, except you=E2=80=99d run =E2=80=9Csudo apt=E2=80=9D= instead of =E2=80=9Csudo tar=E2=80=9D. >> >> Given you can't install two conflicting packages, the issue of removing >> the files of another package cannot arise. In practice that means that >> the current implementation of 'guix pack -f deb' would only allow >> installing *one* such .deb package on a system at a time (most >> applications will carry the glibc and thus conflict for example). > > I see. So the main value over =E2=80=9Csudo tar xf=E2=80=9D is that dpkg= knows which > files were installed, right? That's one good advantage (the ease of cleanly uninstalling the .deb), but for me the main one is the ability to plug it in already established distribution channels (such as a 3rd party apt repository) and have it available (and updatable) easily for their users. A real world use case I've been playing with is to have the jami-qt package that is painstakingly built for each flavor of the leading Deb-based distributions and available for example in various repositories [0] built once via 'guix pack -f deb' and made available in the same way. That'd remove the need to wrestle with OS-specifics, and make the build (and hopefully the bugs) reproducible while preserving the established and reliable distribution channel. I hope this is way of doing things is obsoleted one day when Guix can be hooked in the GNOME software "store" the same as snaps or flatpaks can, so that users don't need to know how the command line to benefit from the advantages provided by Guix. [0] https://dl.jami.net/nightly/debian_10/pool/main/j/jami/ >> For a multi deb-pack scenario, we could have each .deb install their own >> files under for example /opt/guix/deb-packs/$name/gnu/store... via the >> relocatable option. > > Hmm yeah, though it doesn=E2=80=99t sound pretty. In general, I find that 'guix pack's take a step away from elegance in exchange for convenience, so that doesn't sound too terrible in that context (it'd actually be easier to manage than a multi-tarball guix packs deployment, for example, especially when comes the time to reclaim some disk space). My 2 cents :-). Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 12:54:18 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 16:54:18 +0000 Received: from localhost ([127.0.0.1]:58629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydTe-0007em-2d for submit@debbugs.gnu.org; Wed, 30 Jun 2021 12:54:18 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:42854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydTb-0007eV-UO for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 12:54:16 -0400 Received: by mail-qk1-f179.google.com with SMTP id v139so3112868qkb.9 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 09:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=AwjM61sjTzr/PYNPRVmOAkMsus5BbsppyHuJ278qXaU=; b=E8hwyYX/rOKjIfe/txSSoXGAlV2Tz76BflxPkah26Wok/WWQKUOzXDAmP3YiuxCY5x /4UsOcHxWx3NGGEi36ZLLbCtpqBcxgSv43ugb9QaBqKYY2mKuab1naj5oQyrKiUwRkgp o8G9AJAsIEttzd1oBj9SSmZ1yvffvMf0tFEJJCd4w4dZCbwbscCW5NrnoiOxBgCwvR3x wFZswR7n9OODgOB3eKadWZerJH4fSTov4GdabXlE+a2iHfkE2/yWGI/L3n3Q7Sov6X0o R1XelI1d9SzkoaTIE4BKeCbj7al+zCDRlWxE2ATCqldUL2ar22aHbM8xQxUeU8wd8/eS iecg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=AwjM61sjTzr/PYNPRVmOAkMsus5BbsppyHuJ278qXaU=; b=lsQcnx2QA0p9hv/YmDFsRcRV/0k/ovp2nvl2S+G91hUwYwG3VPJ4a8mpLBu5g+anrb P4ycJjzhQVYdSh2kySM8TixHOKzjCOalr7bPBThyBKsUs04z68AG8lyt2TnE7AFBl27P cd0q0Hx26jWCk7aD6hFoNNmR5rbWQgTEgqa4aCKNYz6Be7n+i5TEx+kgTRq2GZ6+Bpih n4i0/vB0z6PnmaCDqLmkkAr5TqJ2Qmss5o8XM0V37LwKMrKCfui2WNP7rxWKc/l3KqSb fwueBOmuKVxVqOeNSk4Td+q4BixiApniA3+2qz0NLQbXW/jnxe/IsLYgH6ZGE3EwYGat V+4Q== X-Gm-Message-State: AOAM533LU60aSwSwu9PkWX0FEMvVaKlRnY3Ixm8MrCtv2IrIBDAOAxwV ZwARY1yfQY/aMhOurKXh8+jeqwj+IMbTeA== X-Google-Smtp-Source: ABdhPJwd97UR/7FirPuZoKUYMNRTlwvVBQ/2xcbrkRZjtizkZODki/yS8JVeBYD/IecDdWRmOd433Q== X-Received: by 2002:a37:7b02:: with SMTP id w2mr22929526qkc.52.1625072050308; Wed, 30 Jun 2021 09:54:10 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id h19sm3593545qto.4.2021.06.30.09.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 09:54:09 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> Date: Wed, 30 Jun 2021 12:54:09 -0400 In-Reply-To: <86tulf799s.fsf@gmail.com> (zimoun's message of "Wed, 30 Jun 2021 15:49:03 +0200") Message-ID: <87sg0z47ke.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi Zimoun, zimoun writes: > Hi, > > I am a bit late to the party. > > Thanks for this good idea of pack. Neat! > > > On Wed, 30 Jun 2021 at 11:15, Ludovic Court=C3=A8s wrote: > >> Also, what happens if you do: >> >> sudo apt install guix >> guix install stuff =E2=80=A6 >> sudo apt install ./guix-pack-generated.deb >> >> ? >> >> Will that overwrite things in /gnu/store? After thinking it out some more, yes! This is because the files are not part of another deb, so dpkg will just claim ownership of the files. >> Admittedly it makes little sense to do something like this, but that=E2= =80=99s >> something one could do. Indeed. I'll a disclaimer in the manual. > The simple scenario: > > scp \ > $(guix pack -f deb hello -C xz -S /usr/bin/hello=3Dbin/hello) \ > remote:/tmp/ > ssh remote > sudo apt install /tmp/=E2=80=A6-hello-deb-pack.deb > realpath $(which hello) > /gnu/store/=E2=80=A6-hello-2.10/bin/hello > > works fine. Then, I am probably doing wrong: > > sudo apt remove hello > hello > -bash: hello: command not found > > guix help > bash: /home/simon/.config/guix/current/bin/guix: /gnu/store/=E2=80=A6-= guile-wrapper/bin/guile: bad interpreter: No such file or directory So uninstalling the hello deb caused all the files "owned" by that debian package to be removed, breaking the guix installed on that same system. It's becoming obvious that the deb-packs are not to be used on systems where Guix is already installed nor mixed with other non-deb packs. That's unfortunate, but there doesn't seem to be much we can do other than document these shortcomings. > I have not investigated. Just a quick test for this nice new feature. Thanks for the feedback! Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 12:56:07 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 16:56:08 +0000 Received: from localhost ([127.0.0.1]:58636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydVP-0007hn-Ng for submit@debbugs.gnu.org; Wed, 30 Jun 2021 12:56:07 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:40905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lydVM-0007h6-BJ for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 12:56:04 -0400 Received: by mail-qt1-f176.google.com with SMTP id n9so1942708qtk.7 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 09:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=8XuP9Lx0XCNorJRtyK5unaaaKoPf9U+Cgz9eTbKsg+8=; b=F9AMqooQZ4ePYgbLqd6kwvnIyxwHGeC2ubok1UHb9pBkVxV4WcFMceIpRjOgZW9DSZ pKgHDE7Inxx/5g/zjvIqT22EWCjeA1Qlh1zD5GA2lu1r4YzPApIoia2/6B0aHlwn9ix+ iCBpic/nOWQQQSCZuAZajydCcjFj3RVsQONMjuUHVKD3MwQ7Ce2uYwUgn1uKEBaUxhQq iYY2/5oZOUgw6TxTkx5RT4PkZxkrPhtUSs9Z10qA9U/f7qjMIV/SgovyJooO/Z/NUv8J 0iipJg/apKp63K63Fhyf9o/iv6tyXrH/lV7YpM+bg0QeFhSqgwyqEJ6opczOT3orypx6 9f8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=8XuP9Lx0XCNorJRtyK5unaaaKoPf9U+Cgz9eTbKsg+8=; b=G+JMiXKJJ77f0kxifT8iUdJtsQXnRkQgA6TBSLKFSllhhfY0DkX5Abzo9xJQfbaV9y R9J4kuvl6wPpN8S7ypASwc+HNGWJd2W5YncU2tWWbjf+sRTfwNRYsa3e307Zak5NwgoL YujZ4CgdeUa+x4wlndNl+UO3qx/jUdREQ58jgDG6bdltv6+sqd3Bf0VkjRa+lG/XG5FB wYKwpcdpVOaSn4KgH9YSRR0qrG/AIkGxIVNSshxyiwASYe8pJyL5heLRBwRY0ahy7O6p J8c1kF5jJxKmTyj03HZCE0+Mwp75gI3AsmBj1RFtyirOZbka6k4ySkfjmdsoSZDBEtjY K0Bw== X-Gm-Message-State: AOAM530cBj7EOu1cSFPn6l/D5vCVHRceltjf7tP3289r/Gw7keWgnWbk TSsuo1ObeoKCMDZt/PA7B/jap6P7KV/iPw== X-Google-Smtp-Source: ABdhPJyDU6m2pXHqawE7B20hOQUjxp3k1oKgvrnjHw7GUFKDBn/nP6JUzYMpJwOVW+QulbRR083xvA== X-Received: by 2002:ac8:5813:: with SMTP id g19mr32986006qtg.383.1625072158733; Wed, 30 Jun 2021 09:55:58 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id i69sm13976702qke.47.2021.06.30.09.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 09:55:58 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> <86lf6r75nw.fsf@gmail.com> Date: Wed, 30 Jun 2021 12:55:57 -0400 In-Reply-To: <86lf6r75nw.fsf@gmail.com> (zimoun's message of "Wed, 30 Jun 2021 17:06:59 +0200") Message-ID: <87o8bn47he.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi Simon, [...] > Therefore, installing and then removing =E2=80=99hello=E2=80=99 breaks an= y other pack > using, for instance, 01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib or > fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31. Do I miss something? No, your analysis is correct. I'm currently writing adding a disclaimer in the manual, will post it here. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 13:28:14 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 17:28:14 +0000 Received: from localhost ([127.0.0.1]:58666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lye0U-0008TB-D8 for submit@debbugs.gnu.org; Wed, 30 Jun 2021 13:28:14 -0400 Received: from mail-qt1-f170.google.com ([209.85.160.170]:36641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lye0S-0008Sz-9e for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 13:28:12 -0400 Received: by mail-qt1-f170.google.com with SMTP id r20so2037822qtp.3 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 10:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=02VvJQDp8ro9uADY8LlBmxIwNtp0ziFoHbYSLWwC5eM=; b=tPdfuMFIbSBo9RypciTA8RrYQ3+ZcLZX2IKvTvjcdpmWEyie2bnK1JhWHzntem08NI dnsAsRIUESm3TFXUGGd32tjMQVEFXX8arswmlNQ7ho+uwUURXcNbSaXE8WoAuuqjWpMn BkKIXndvbPqMDGvp1XV4Xm5NmCuJD5nvWWFtsMd1g9Ter8aHL2FrC5SND3afkewoljqM TWw9CLp953woQbeJ/Zph7FRWHeYavOza8J9ra0BO5jUFqIaKwiVbarwt1kVoqrOh7kxJ 270m5XXeSjw2R0lPNi1wIGz36YzIKmvLVL/lX8H4uWc6Ki9umZu5XIYrkugg8Sf40M54 z18w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=02VvJQDp8ro9uADY8LlBmxIwNtp0ziFoHbYSLWwC5eM=; b=AnqHjd0sjpCRfyCSJaB6eAmb0DARrtQMkrN/+lihzKqV/TJ6JRce1kjWGCOZs8f+Vk zz72im8i/J7wnX4gDnuJl6HcZUhTrHZGEaUcAx7Ux/4XYwlNNfsVZm6Ob1+AaHgfNyGW B7RTiGQm+GL4xXkTPUocht773gbUWxXxNqoKUs7cQ8P54B8cT8S1S5srlNUBGCFW8ZcC 19YBW4sYa3z5rHihQiPNGCXcabePJX17nllDYTCZbD4f27o21QpwPHY1DnCv9JL/NJFS 9+1BjPaUV4VBqC6nFs5jkUrlpvm6wRgu2RNvfJ8gZmV4wblYU1fLzVR1Ys7puidMdgYo lXmQ== X-Gm-Message-State: AOAM53365ODs4TgGQeLafdhChKiGivFK/OYi5KuWE4EBKiewOqbP1wRu p9Jd3nVYCio52ys225RSVPMbd5d19mxUaw== X-Google-Smtp-Source: ABdhPJzu4C9DExa8NWEUlCiMdTn8PechayTytci1q1K6x9g/ueDavzzX8MhcWIWTKW+Wxg+z495yjQ== X-Received: by 2002:a05:622a:34c:: with SMTP id r12mr8453898qtw.196.1625074086670; Wed, 30 Jun 2021 10:28:06 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id e12sm2745964qtx.73.2021.06.30.10.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 10:28:06 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> Date: Wed, 30 Jun 2021 13:28:05 -0400 In-Reply-To: <86tulf799s.fsf@gmail.com> (zimoun's message of "Wed, 30 Jun 2021 15:49:03 +0200") Message-ID: <87k0mb45zu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi again, How about adding these notes/disclaimers to prevent users breaking their Guix or existing packs on foreign distributions? --8<---------------cut here---------------start------------->8--- doc: Add a note and warning regarding the usage of deb packs. * doc/guix.texi (Invoking guix pack): Move to the end of the table, and add a note and warning regarding the usage of deb packs. 1 file changed, 21 insertions(+), 5 deletions(-) doc/guix.texi | 26 +++++++++++++++++++++----- modified doc/guix.texi @@ -6028,11 +6028,6 @@ This produces a SquashFS image containing all the specified binaries and symlinks, as well as empty mount points for virtual file systems like procfs. -@item deb -This produces a Debian archive (a package with the @samp{.deb} file -extension) containing all the specified binaries and symbolic links, -that can be installed on top of any dpkg-based GNU/Linux distribution. - @quotation Note Singularity @emph{requires} you to provide @file{/bin/sh} in the image. For that reason, @command{guix pack -f squashfs} always implies @code{-S @@ -6047,6 +6042,27 @@ If you forget the @code{bash} (or similar) package, @command{singularity run} and @command{singularity exec} will fail with an unhelpful ``no such file or directory'' message. @end quotation + +@item deb +This produces a Debian archive (a package with the @samp{.deb} file +extension) containing all the specified binaries and symbolic links, +that can be installed on top of any dpkg-based GNU/Linux distribution. + +@quotation Note +Because archives produced with @command{guix pack} contain a collection +of store items and because each @command{dpkg} package must not have +conflicting files, in practice that means you likely won't be able to +install more one such archive on the same system. +@end quotation + +@quotation Warning +@command{dpkg} will assume ownership of any files contained in the pack +that it does @emph{not} know about. It is unwise to install +Guix-produced @samp{.deb} files on a system where @file{/gnu/store} is +shared by other software, such as a Guix installation or other, non-deb +packs. +@end quotation + @end table @cindex relocatable binaries --8<---------------cut here---------------end--------------->8--- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 13:36:27 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 17:36:27 +0000 Received: from localhost ([127.0.0.1]:58675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lye8R-0000FA-Ma for submit@debbugs.gnu.org; Wed, 30 Jun 2021 13:36:27 -0400 Received: from mail-qv1-f42.google.com ([209.85.219.42]:46954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lye8Q-0000Er-7j for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 13:36:26 -0400 Received: by mail-qv1-f42.google.com with SMTP id u2so1495369qvp.13 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 10:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AV4izv6Qe0nzWhfOtCSq9kFJ6Jh87go/t/tm8/snB10=; b=RpQWXGNs5aOlJG1hmet3jTXWxjpX/07BBrQwy1v9esv6GV1oGZpY5P33L6ygJEqPbb afebKpcPs9id7caQtliD0xlWtpCDqcA3smNakNZo7LhF3aNakwi826C7zDa/fv1Bv6co 7yAdqlQSZWSIzbZm/roRc2NbWmPiphYktU06EXRNd+QNyU/j+SrLgyTBcvzSs9rXcCQK 9f3qfPZQCbw5n6TRtpHt1EuEv1a0ymBksAeQ0dQp7IlhNQGl39WLIgep62zQwo9fOewd 7Zom7AtMKlydhK/+cg4xJtuQvquUszgHaRSudbJE7OOwWcpFKJ5EU1BpWfDxoeM5qXtP Kymw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AV4izv6Qe0nzWhfOtCSq9kFJ6Jh87go/t/tm8/snB10=; b=drpC16zGVB9lchVCYLTOXN////n8AGtPkLTGK59FpJzLjZy+pfssx5X8CmxqvBl1Vs 0bhYkWw663WpOPI3MwxfDoFDqrXiBIznzg+e9wQYhhMotfQI5ezEsYaLmE4AuOeSizxo xuHd99WYNpclS3C5UmL4PCOfsaeNVjyGHiFv37UBGlRqhHWxOn7PH9bx7q+br1NVYrKT FxB3qQVcHqHv3GHlBBBTNLuk71J2K9UgAScJmQikIsSa2ggVC1K2b0mPCC7L0ObJiCTJ Fl71Oe6B0STtOjEQRFlMx5TqwvaaWa/ytxYAxAf3+syUQ1hugM9XGuIdQ3i/AjPeW3CC lWyw== X-Gm-Message-State: AOAM530i+r8fDfeva/Y5V2EK1kzMjlEIs3RKOa++4+/MiiZAVJDXYxGs mSTQkRkx7Tx2yHHWtnGkCORnpNJ3EQl+EQ== X-Google-Smtp-Source: ABdhPJwiKsKWUr+Q/z5IQINhljC1TAfdo4IwuQlt38WxTexSyL99w7in/2/r2MDNrvxfg/wrQNrfhw== X-Received: by 2002:a0c:f850:: with SMTP id g16mr1425850qvo.5.1625074580645; Wed, 30 Jun 2021 10:36:20 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id 145sm5516883qkg.59.2021.06.30.10.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 10:36:20 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> <87k0mb45zu.fsf@gmail.com> Date: Wed, 30 Jun 2021 13:36:19 -0400 In-Reply-To: <87k0mb45zu.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 30 Jun 2021 13:28:05 -0400") Message-ID: <87bl7n45m4.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi again, Maxim Cournoyer writes: [...] > +@quotation Note > +Because archives produced with @command{guix pack} contain a collection > +of store items and because each @command{dpkg} package must not have > +conflicting files, in practice that means you likely won't be able to > +install more one such archive on the same system. > +@end quotation With typo fixed: -install more one such archive on the same system. +install more than one such archive on a given system. Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 13:49:35 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 17:49:35 +0000 Received: from localhost ([127.0.0.1]:58703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyeL9-0000Yc-I8 for submit@debbugs.gnu.org; Wed, 30 Jun 2021 13:49:35 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:40674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyeL7-0000YO-EP for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 13:49:33 -0400 Received: by mail-wr1-f46.google.com with SMTP id g7so4674040wri.7 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 10:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=YPmISXJvzV2JYTi5XatIHARHLBizQ1Y0eKbMf2UzggQ=; b=JxQz0TAyC7rFvCMEPsnXI73qkSs/IuteZv8Leby5oNe4cydo3Z0lDcL/mLrARobWuH noMiL9uMeEpFUGIpULfrNv+6USYLmrjHQ1pu5ioekOyesUjxhK4rB6KK51vb9nrQ1NJG zxxmJyagE14hMqRL6WcT443PyXckKbaZUrrQdpCYzBeFur1HzFXS0ZidbrbXFWwzd3KM nC231DYsz8gW5A0fzxCQwXaunTO4VlcWLdBD2+uZAqRqoxFTyqXg75oVfe8WiMf55a82 AnTF9suv9/uzpZamsvhuD6Z6wTKeBUXBGdu5KRddsok1CoXwnXg7QkjMVqk9uAu85dJH 7a9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=YPmISXJvzV2JYTi5XatIHARHLBizQ1Y0eKbMf2UzggQ=; b=YamPrfBm8aBQbSnXkcabCwuwQVugcE8lui7XVF4jyVblDHwx4+skXvLFQbx+yue+N9 eG4GnQjsJOtd9AVWmtzrPu0yWpFShSjjeXHeAolcKb0GE6IApJfu9j6Qm8Qvj37aX0OF qEF5oPea8uWrKsAw+Js4+NNeuWPvOLXT1qE2+l0B4QSnW9aWcAv/pKX3Z7sLnhGdOpEI 8zA026SvU65LqNYZ7Bt/ZxQET/ySHjuJgPzyTZrZzm3p7VhIPxXeXC+ZtrQfj1SqmuXe mRqKnK8LtXFna2QLjtGRVeqT+RlKUziNSzPzMXSwT4luXRJWvn0oczya3XtMbSSU5qwY jeUA== X-Gm-Message-State: AOAM5339cZ1BXrQQIet8wqLQ0GC9xQq6qGOCiFIL7TmXZidfmW8zYSNP 3sNRKidp1JoJulZNODQ1tPVMoKcmm0w= X-Google-Smtp-Source: ABdhPJwOwjq2hofGLVuiPgV1s9K/IzY9y2dHpxjljlpwCOSM3qtlNhXcrfzb6Jw724jWPQGp0NTRMw== X-Received: by 2002:adf:e2cf:: with SMTP id d15mr40267372wrj.48.1625075367304; Wed, 30 Jun 2021 10:49:27 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u18sm20165542wmj.15.2021.06.30.10.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 10:49:26 -0700 (PDT) From: zimoun To: Maxim Cournoyer Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. In-Reply-To: <87k0mb45zu.fsf@gmail.com> References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> <87k0mb45zu.fsf@gmail.com> Date: Wed, 30 Jun 2021 19:47:58 +0200 Message-ID: <86czs36y7l.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi Maxim, On Wed, 30 Jun 2021 at 13:28, Maxim Cournoyer wrote: > --8<---------------cut here---------------start------------->8--- > doc: Add a note and warning regarding the usage of deb packs. [...] > +@item deb > +This produces a Debian archive (a package with the @samp{.deb} file > +extension) containing all the specified binaries and symbolic links, > +that can be installed on top of any dpkg-based GNU/Linux distribution. > + > +@quotation Note > +Because archives produced with @command{guix pack} contain a collection > +of store items and because each @command{dpkg} package must not have > +conflicting files, in practice that means you likely won't be able to > +install more one such archive on the same system. > +@end quotation > + > +@quotation Warning > +@command{dpkg} will assume ownership of any files contained in the pack > +that it does @emph{not} know about. It is unwise to install > +Guix-produced @samp{.deb} files on a system where @file{/gnu/store} is > +shared by other software, such as a Guix installation or other, non-deb > +packs. > +@end quotation > + > @end table > > @cindex relocatable binaries > --8<---------------cut here---------------end--------------->8--- The pack does not fully respect the FHS from the Debian Policy, right? Hum, the disclaim LGTM. Although, it appears to me a severe limitation to be able to install only one Guix-generated .deb pack on a Debian-like system, IIUC. :-) Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 14:16:51 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 18:16:51 +0000 Received: from localhost ([127.0.0.1]:58715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyelX-0001DM-8f for submit@debbugs.gnu.org; Wed, 30 Jun 2021 14:16:51 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:43820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyelV-0001DA-Ep for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 14:16:49 -0400 Received: by mail-qt1-f181.google.com with SMTP id f20so2141162qtk.10 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 11:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=AkzQx2EsKzBGQtGe9/GJTe0BHXnoBZVH01jxRtRKMCA=; b=cjkLkQTBMA5la/GGcbXm4fS225z8WjnPY+30tz9vq47pxYBwAJwTQei5MbkKQMLGw6 fMw6c34UHv90MagLy5R79vSZa53M2owfu8FK02jj2DZqjRWoe12InZSxkDSKf1jXTtAq YvkXOEopxSEIK+nt7PuwvAoZ7dGCrLRIRcRelhQ0xx5Ul1LDntTCGoy8PjG5oFlidbwH MhGPDlVG8guXV3f4Wsbej1cS7ehimOcylHSt2cWUesE71ukinaf4LAp2ReLgstuTE35h 2b8unOxkQ2X9guVK61iaaEMT386tukAjAY9b4BCtJklJxVvlOyDABC8p8F2r5Hl2EEHq UPug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=AkzQx2EsKzBGQtGe9/GJTe0BHXnoBZVH01jxRtRKMCA=; b=GneAKEtxXU34fX/1kLWA8wcdm5fbFd9OKU0zMAIw9myWCbC81P/O5m5IOuMKn+UUhO eaB+MN+omUEY5V1YRG2gE4LfeUwk5NHmWIZ9nIqT2UFwjFZnISEkwK3+woPlG/gEhiPB Fgx0vAQkKlrIpx+SI1rWlKweHwZ8ViR1eTH+yCrFH79IHjoV2w+cDmP1nQm6X8SWN+kH bgMTdV3wmCdUdeZ9w4UdvOct1eds8dfU2zMoqXKW2nmq3i7u5ZdDY7zZTFOr/zn2arIF LcHfiZfjq17KRMnSdaQTLDfUz/oa8gSN7YNO9bZr0gxt6yG4wXnWTMARE/kOe+7ka+fA Rx1A== X-Gm-Message-State: AOAM532/C76Ni2xiY1scK5hre4XUdkiL5XnKZSNyrO9+6MHq/vZaB3tt gSeYJZ48iuB2vCYbpBpA6/ItqAdJJhmEyw== X-Google-Smtp-Source: ABdhPJzFY883Db5ajjBYX8SOaZesw5X/0NYzFUADfDJPhMelMDuAarFMbo9kXzIKar3fiZUt0vcByg== X-Received: by 2002:ac8:4a18:: with SMTP id x24mr32179230qtq.239.1625077003850; Wed, 30 Jun 2021 11:16:43 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id o126sm13963499qka.74.2021.06.30.11.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 11:16:43 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-6-maxim.cournoyer@gmail.com> <87wnqboedx.fsf_-_@gnu.org> Date: Wed, 30 Jun 2021 14:16:42 -0400 In-Reply-To: <87wnqboedx.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Wed, 30 Jun 2021 12:06:34 +0200") Message-ID: <877dib43qt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hey, Ludovic Court=C3=A8s writes: [...] >> (define (file-prefix? file1 file2) >> - "Return #t if FILE1 denotes the name of a file that is a parent of FI= LE2, >> -where both FILE1 and FILE2 are absolute file name. For example: >> + "Return #t if FILE1 denotes the name of a file that is a parent of FI= LE2. >> +For example: >>=20=20 >> (file-prefix? \"/gnu\" \"/gnu/store\") >> =3D> #t >> @@ -240,19 +241,41 @@ where both FILE1 and FILE2 are absolute file name.= For example: >> (file-prefix? \"/gn\" \"/gnu/store\") >> =3D> #f >> " >> - (and (string-prefix? "/" file1) >> - (string-prefix? "/" file2) > > Doesn=E2=80=99t it have the effect that now: > > (file-prefix? "gnu" "/gnu/store") =3D> #t > > ? Good catch. That seems sub-optimal. How about: --8<---------------cut here---------------start------------->8--- modified gnu/system/file-systems.scm @@ -233,6 +233,8 @@ =20 (define (file-prefix? file1 file2) "Return #t if FILE1 denotes the name of a file that is a parent of FILE2. +FILE1 and FILE2 must both be either absolute or relative, else #f is retur= ned. + For example: =20 (file-prefix? \"/gnu\" \"/gnu/store\") @@ -241,17 +243,24 @@ For example: (file-prefix? \"/gn\" \"/gnu/store\") =3D> #f " - (let loop ((file1 (string-tokenize file1 %not-slash)) - (file2 (string-tokenize file2 %not-slash))) - (match file1 - (() - #t) - ((head1 tail1 ...) - (match file2 - ((head2 tail2 ...) - (and (string=3D? head1 head2) (loop tail1 tail2))) - (() - #f)))))) + (define (absolute? file) + (string-prefix? "/" file)) + + (if (or (every absolute? (list file1 file2)) + (every (negate absolute?) (list file1 file2))) + (let loop ((file1 (string-tokenize file1 %not-slash)) + (file2 (string-tokenize file2 %not-slash))) + (match file1 + (() + #t) + ((head1 tail1 ...) + (match file2 + ((head2 tail2 ...) + (and (string=3D? head1 head2) (loop tail1 tail2))) + (() + #f))))) + ;; FILE1 and FILE2 are a mix of absolute and relative paths. + #f)) --8<---------------cut here---------------end--------------->8--- =20 (define (file-name-depth file-name) (length (string-tokenize file-name %not-slash))) > I=E2=80=99d rather insist on absolute file names and preserve the initial > semantics, to avoid bad surprises. I agree that not changing the original semantics would be safest; nevertheless, we're talking about an internal helper that isn't widely use; its couple usages are easy to review (and deals with mount points which seems safe to assume are exclusively using absolute paths). Especially after the above fix :-). >> +(define (reduce-directories file-names) >> + "Eliminate entries in FILE-NAMES that are children of other entries in >> +FILE-NAMES. This is for example useful when passing a list of files to= GNU >> +tar, which would otherwise descend into each directory passed and archi= ve the >> +duplicate files as hard links, which can be undesirable." >> + (let* ((file-names/sorted >> + ;; Ascending sort by file hierarchy depth, then by file name = length. >> + (stable-sort (delete-duplicates file-names) >> + (lambda (f1 f2) >> + (let ((depth1 (file-name-depth f1)) >> + (depth2 (file-name-depth f2))) >> + (if (=3D depth1 depth2) >> + (string< f1 f2) >> + (< depth1 depth2))))))) >> + (reverse (fold (lambda (file-name results) >> + (if (find (cut file-prefix? <> file-name) results) >> + results ;parent found -- skipping >> + (cons file-name results))) >> + '() >> + file-names/sorted)))) > > Likewise, I suspect it doesn=E2=80=99t work as intended if there are rela= tive > file names in the list, no? You can see it at work in the tests/file-systems test module; it reduces (reduce-directories '("./opt/gnu/etc" "./opt/gnu/" "./opt/gnu/bin" "./opt/gnu/lib/debug" "./opt/gnuism" "a/b/c" "a/b/c")) into '("./opt/gnu/" "./opt/gnuism" "a/b/c"), none of which are absolute file names. > Perhaps we could add an example to the docstring. Also, the word > =E2=80=9Creduce=E2=80=9D doesn=E2=80=99t appear in the docstring, which t= o me suggests > suboptimal naming. ;-) That the word 'reduce' doesn't appear in the docstring was a conscious effort of mine to not bore the reader with repeating the same terms, ah! But naming is hard; I'm open to suggestions. Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 14:36:55 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 18:36:55 +0000 Received: from localhost ([127.0.0.1]:58725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyf4x-0001hk-DT for submit@debbugs.gnu.org; Wed, 30 Jun 2021 14:36:55 -0400 Received: from mail-qv1-f54.google.com ([209.85.219.54]:40861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyf4w-0001hZ-J9 for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 14:36:55 -0400 Received: by mail-qv1-f54.google.com with SMTP id g14so1617688qvo.7 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 11:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=/uvDiTnLvvFob3mYPVOYpntkJhAmL6JvIYlVdVztJnU=; b=RrMrOKzW4LKwbBx46iEijZYoNzvQi8oW1hWqU4+mU8pzvPEyqxT+HCfzoNKOe+06Cy 2/19pX9lnXrO2uH1MzBCt/ucJ/xtk3iyRrcSXf4HcDX+4VJ8hhYgjamlhj/jmGmoadtz my2mdCavBKVoQ09W3QhXQfyFii2ypFh7b4KcS95yQ1r6gEYX9clyOD2+29wplmJLEHvF 7EFv38uu0qQxY3bkLm/xyRTNsRw/i4rvgiG6nsjb/2756VHZSTy3jiXqtCxzNQcvtE6g GEjvlXQh2mY5QaWF9I9CN2WY2GTnHJmfHbpNXZHG8oL6LNywCDVkzC5zjO6uMOCf5hWa ycQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=/uvDiTnLvvFob3mYPVOYpntkJhAmL6JvIYlVdVztJnU=; b=Wcueq98Q7zB9Je+fK8yihIy7ibKoaeeAti1F+pbYZfE5TjybyBGznxz/iQqMY2cUkk QD7X8wcMo5jVbya2/HJTt3HGH29fUkgHD/Tl3hsOY0kiEPymFaL/LiQ20mTmavE9U54x XtVR2gqoQ1trdgtuikNYFeqOD/OMQgyAb2uTYJysqGhuGOQMPT2vyehCeapxq77WtQdB VtEIVTLFVW+u9j13UqgRC02q4+sq03P7WKIB4YzVazy4gKhWuqGVf+X/MNQh0hfjT0hC mZDcdPQbBHxwHlUa89BOk6BihaCXo1at/hxcb8DzJgCNeDG9CfeDoX40ydVjhsjGIvaP gTUw== X-Gm-Message-State: AOAM533IaqYQBjiggfyF2LSjPEqfO+eKhB5LP+JxIOILbKjvCuIieZ5C PUBEDWcZlOqv64Ni8zrAxUFikyHEgyM8Tw== X-Google-Smtp-Source: ABdhPJyre5KmtDmVXNaLZ7Vo17Z2Uk4eV6gp41QgaKZvWrQli8EJvacXfWWyqZHvQb1enXLy6XxhJw== X-Received: by 2002:a0c:ef8b:: with SMTP id w11mr38396448qvr.37.1625078208980; Wed, 30 Jun 2021 11:36:48 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id l14sm415793qtp.5.2021.06.30.11.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 11:36:48 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> <87lf6roe32.fsf_-_@gnu.org> Date: Wed, 30 Jun 2021 14:36:47 -0400 In-Reply-To: <87lf6roe32.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Wed, 30 Jun 2021 12:13:05 +0200") Message-ID: <8735sz42tc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) Hello, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Instead of just naming them by their pack type, add information from the >> package(s) they contain to make it easier to differentiate them. >> >> * guix/scripts/pack.scm (define-with-source): New macro. >> (manifest->friendly-name): Extract procedure from ... >> (docker-image): ... here, now defined via the above macro. Adjust REPOS= ITORY >> argument value accordingly. >> (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. > > [...] > >> - (define tag >> - ;; Compute a meaningful "repository" name, which will sho= w up in >> - ;; the output of "docker images". >> - (let ((manifest (profile-manifest #$profile))) >> - (let loop ((names (map manifest-entry-name >> - (manifest-entries manifest)))) >> - (define str (string-join names "-")) >> - (if (< (string-length str) 40) >> - str >> - (match names >> - ((_) str) >> - ((names ... _) (loop names))))))) ;drop one ent= ry > > I think this should not be factorized because the requirements are very > Docker-dependent. Once factorized, it becomes easy to overlook this. Hmm, I'm not a docker format expert, but my quick reading about it turned no restrictions about what a docker image label should look like? So perhaps it is not specially Docker-dependent. If there's something truly Docker-dependent about it I'd suggest adding a #:docker-compatible? boolean option to the procedure. Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 30 15:20:09 2021 Received: (at 49149) by debbugs.gnu.org; 30 Jun 2021 19:20:09 +0000 Received: from localhost ([127.0.0.1]:58745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyfkm-0002ic-TK for submit@debbugs.gnu.org; Wed, 30 Jun 2021 15:20:09 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:43735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyfkl-0002iL-SH for 49149@debbugs.gnu.org; Wed, 30 Jun 2021 15:20:08 -0400 Received: by mail-qk1-f176.google.com with SMTP id q16so3593562qke.10 for <49149@debbugs.gnu.org>; Wed, 30 Jun 2021 12:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=RUwT5HpickvBqFLjXD7LhQ17u3TQqyUyP4v9I7L7018=; b=Jju9nR2PmfxiZ4KzUZ0pgkshzvjN090ObhDMv4zS9M1c2j5FM1W0Pxoigi1gnaRU8e f0mQ1t0hL2AQjOW4ohAZdveXBQKJCgdq+hCOvPb2Em2XnJboA8eW4ZIUKBa69smHRPrq ymiZPgw5cDZpbuf6L6dheJNjQh8ggR8QbwH0G71sxqHQtJu/qXY7ezyHsmGRSwY8v+HK YVJTL6JqsVrsKqDqZ+MoXQSOxPWYoPMg0n+4zW6A7gBvb6hOtRELlzu1xWL40Uevp0KH A2DmvNasvYsVtX2xXqhaOEixrbWXBg5COcWomg5Z0tvHvCJTgT1EfRsJJWJHl/JU7MnR rPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=RUwT5HpickvBqFLjXD7LhQ17u3TQqyUyP4v9I7L7018=; b=Yquyv+gNHragjdWsBnaTAGofTZEzi7Ke2zpdsFdYeVY+XIDAtSOslhiTEQFEysyUyh mn5drYbTVLdZdBtv0Naz37a1NsZSM+WWBCBEos7E7BubXKNeXa1AWKkndSZB+9NCiqGf DPKAH4wxigLEqqo9dlDzakMfEPCRd0n8jOaa/4G8Xg4GIB16I2sfPbDjoKXt1OaGWITc UPrubsS3Y5iaauprJkLKyi30xXpaWMjJgVdHJlrSqDGEovXgU98wlnWi+Ws6AXz98oK5 r93w5RmcNZbONHMQBfHkPZqhQZAXKIpYkLm7/BujuogFwrEbNYKTELKrIBPSIwCc2aVp 9G3w== X-Gm-Message-State: AOAM533NYs6vjg2k1TaZY9Gn1ODxgjCKNF/fPGEYAhDT4ohnf1PbYaGH SR2/wC281Y3bf27jK0teaDbm5Kizjmbulw== X-Google-Smtp-Source: ABdhPJzIed3uhuC1gxb/lxjtvTk4Io+JCZujbjhW7iHTVR5d2YAKA7iRrj20nCz2LNz0vHbCQnvALg== X-Received: by 2002:ae9:ef88:: with SMTP id d130mr33659458qkg.166.1625080802300; Wed, 30 Jun 2021 12:20:02 -0700 (PDT) Received: from hurd (dsl-150-149.b2b2c.ca. [66.158.150.149]) by smtp.gmail.com with ESMTPSA id j13sm14727398qko.9.2021.06.30.12.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 12:20:01 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> <87k0mb45zu.fsf@gmail.com> <86czs36y7l.fsf@gmail.com> Date: Wed, 30 Jun 2021 15:20:00 -0400 In-Reply-To: <86czs36y7l.fsf@gmail.com> (zimoun's message of "Wed, 30 Jun 2021 19:47:58 +0200") Message-ID: <87y2ar2m8v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 49149@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: -1.0 (-) Hi Simon, zimoun writes: > Hi Maxim, > > On Wed, 30 Jun 2021 at 13:28, Maxim Cournoyer wrote: >> --8<---------------cut here---------------start------------->8--- >> doc: Add a note and warning regarding the usage of deb packs. > > [...] > >> +@item deb >> +This produces a Debian archive (a package with the @samp{.deb} file >> +extension) containing all the specified binaries and symbolic links, >> +that can be installed on top of any dpkg-based GNU/Linux distribution. >> + >> +@quotation Note >> +Because archives produced with @command{guix pack} contain a collection >> +of store items and because each @command{dpkg} package must not have >> +conflicting files, in practice that means you likely won't be able to >> +install more one such archive on the same system. >> +@end quotation >> + >> +@quotation Warning >> +@command{dpkg} will assume ownership of any files contained in the pack >> +that it does @emph{not} know about. It is unwise to install >> +Guix-produced @samp{.deb} files on a system where @file{/gnu/store} is >> +shared by other software, such as a Guix installation or other, non-deb >> +packs. >> +@end quotation >> + >> @end table >> >> @cindex relocatable binaries >> --8<---------------cut here---------------end--------------->8--- > > The pack does not fully respect the FHS from the Debian Policy, right? > > Hum, the disclaim LGTM. Although, it appears to me a severe limitation > to be able to install only one Guix-generated .deb pack on a Debian-like > system, IIUC. :-) Thanks! It is! One thing that would be possible is react to a user passing the -R(R) (relocatable) option and keep the deb pack contents under a named prefix, such as /opt/deb-packs/name/gnu/store/[...] to keep them from conflicting. I won't be pursuing it myself but it shouldn't be too difficult to do! Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 09:09:15 2021 Received: (at 49149) by debbugs.gnu.org; 1 Jul 2021 13:09:15 +0000 Received: from localhost ([127.0.0.1]:59916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywRO-0007Dc-Qe for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:09:15 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:44763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywRJ-0007DK-QK for 49149@debbugs.gnu.org; Thu, 01 Jul 2021 09:09:14 -0400 Received: by mail-qt1-f182.google.com with SMTP id g3so4012109qth.11 for <49149@debbugs.gnu.org>; Thu, 01 Jul 2021 06:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=020Et6YZODcBdXJeKULjE0FtGP5YKIGicdc7yXs2L/0=; b=ETRdsaNmcgmvMDjqHwsEfeafwtD8+fMC9ToaCMpofmXJUncFbb7ktww+dZGzuMvcl1 6wL8zlwUCFh1rHih/aysOTpRW9aoQy2UAFLr9qUNMHpiDReRLsz3RV8qCkIs0OILRZ7a ntCsWKxnjREI4jx62Hl48MVimviq7uPYdu8uhpEEC/lXgs901cCBPXaIBCgIRc84eijM HzZhZdb0EmBz19H3wC2Mx/W9MSmps/FPfO++TWuCnI6hyw+g4BC2AKJrR4+o7n7Ny6sH aJddbfP4IXAiaK2uNK3UmsbKjqXYtZwO8tc0OWOyWvK7/rwaN0XczGvVOmoiIAVtjEso nOhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=020Et6YZODcBdXJeKULjE0FtGP5YKIGicdc7yXs2L/0=; b=fcP2/LVSSgnM1MmjdoJnOI1pDQQ+HMNVXBafPR515WySxSemKO/4dtxL1qEDGqk/rB T7DAf7yc3eqyqLjy0dpLlVoCyZIlKkMG6wPBA/vXoG+sdt44uihEeCUqsT0TEVWsR94v xKo4oIfR7UL9AgkpN7Zeh0kiqjIDJ+6ogHp3KIGziOiNd6YeifOMZgs1IngHuovV4tTb O34roglUO4S+YDMWNw/Xaqjlg7w4UllZTquoF6yhrAfNm3dtHeQB0aA7z6dUqMJWlB8y k92L+iufL7owpiRUzPrNmYAf7cTyhjynRH1q9UY4QVhv8Pof0oQbXYBw+LQ8ThT0saav UxiQ== X-Gm-Message-State: AOAM5321L03XcB7WmUsJ5usDb/f1pXnbQItJDsGa150UDD0KKhlE89Bw GcVJMZx4XgMZJyRTFFh+oFTGIdBTsiw4eVfOs/I= X-Google-Smtp-Source: ABdhPJwXRrXavpXDtXM49iFJKC7eey+46K3WridmE2tOdrXqr31v273G+k7DcYJ7LgJ9GZFj8dHNVumJzYmZvecoh2s= X-Received: by 2002:a05:622a:11c3:: with SMTP id n3mr36689763qtk.211.1625144943237; Thu, 01 Jul 2021 06:09:03 -0700 (PDT) MIME-Version: 1.0 References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <86tulf799s.fsf@gmail.com> <87k0mb45zu.fsf@gmail.com> <86czs36y7l.fsf@gmail.com> <87y2ar2m8v.fsf@gmail.com> In-Reply-To: <87y2ar2m8v.fsf@gmail.com> From: zimoun Date: Thu, 1 Jul 2021 15:08:52 +0200 Message-ID: Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. To: Maxim Cournoyer Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 49149@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: -1.0 (-) Hi Maxim, On Wed, 30 Jun 2021 at 21:20, Maxim Cournoyer wrote: > > Hum, the disclaim LGTM. Although, it appears to me a severe limitation > > to be able to install only one Guix-generated .deb pack on a Debian-like > > system, IIUC. :-) > > Thanks! It is! One thing that would be possible is react to a user > passing the -R(R) (relocatable) option and keep the deb pack contents > under a named prefix, such as /opt/deb-packs/name/gnu/store/[...] to > keep them from conflicting. I won't be pursuing it myself but it > shouldn't be too difficult to do! I understand. I keep this idea / feature under the elbow (well, have this in reserve :-)). Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 09:20:55 2021 Received: (at 49149) by debbugs.gnu.org; 1 Jul 2021 13:20:55 +0000 Received: from localhost ([127.0.0.1]:59940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywcg-0001F6-S4 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:20:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywcf-0001Eu-Ph for 49149@debbugs.gnu.org; Thu, 01 Jul 2021 09:20:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50628) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lywca-0001i0-An; Thu, 01 Jul 2021 09:20:48 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36604 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lywca-0003Yv-0i; Thu, 01 Jul 2021 09:20:48 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <87wnqb483r.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 01 Jul 2021 15:20:46 +0200 In-Reply-To: <87wnqb483r.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 30 Jun 2021 12:42:32 -0400") Message-ID: <87pmw2kw5t.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hello, Maxim Cournoyer skribis: >> Will that overwrite things in /gnu/store? >> >> Admittedly it makes little sense to do something like this, but that=E2= =80=99s >> something one could do. > > It probably would conflict with what is already in the store (installed > by guix) and abort installation, guarding against this. OK. >>> Given you can't install two conflicting packages, the issue of removing >>> the files of another package cannot arise. In practice that means that >>> the current implementation of 'guix pack -f deb' would only allow >>> installing *one* such .deb package on a system at a time (most >>> applications will carry the glibc and thus conflict for example). >> >> I see. So the main value over =E2=80=9Csudo tar xf=E2=80=9D is that dpk= g knows which >> files were installed, right? > > That's one good advantage (the ease of cleanly uninstalling the .deb), > but for me the main one is the ability to plug it in already established > distribution channels (such as a 3rd party apt repository) and have it > available (and updatable) easily for their users. Right. Though setting up an apt repo is quite a lot of work. Also, would upgrading the Guix-generated package work? I suppose apt would wipe /gnu/store of the former package and then unpack the new package, right? > A real world use case I've been playing with is to have the jami-qt > package that is painstakingly built for each flavor of the leading > Deb-based distributions and available for example in various > repositories [0] built once via 'guix pack -f deb' and made available in > the same way. That'd remove the need to wrestle with OS-specifics, and > make the build (and hopefully the bugs) reproducible while preserving > the established and reliable distribution channel. Nice! That=E2=80=99s an interesting use case. > I hope this is way of doing things is obsoleted one day when Guix can be > hooked in the GNOME software "store" the same as snaps or flatpaks can, > so that users don't need to know how the command line to benefit from > the advantages provided by Guix. True, having Guix as one of the app bundle options for GNOME Software would be nice. >>> For a multi deb-pack scenario, we could have each .deb install their own >>> files under for example /opt/guix/deb-packs/$name/gnu/store... via the >>> relocatable option. >> >> Hmm yeah, though it doesn=E2=80=99t sound pretty. > > In general, I find that 'guix pack's take a step away from elegance in > exchange for convenience, so that doesn't sound too terrible in that > context (it'd actually be easier to manage than a multi-tarball guix > packs deployment, for example, especially when comes the time to reclaim > some disk space). Yes, I agree that we need to be pragmatic here. :-) Work on layered Docker images, notably by Chris Baines=C2=B9, could perhaps be handy here. Or, actually, one option would be for =E2=80=98guix pack -f deb=E2=80=99 to= generate one .deb file per store item. Does that sound reasonable?=E2=80=A6 Thanks, Ludo=E2=80=99. =C2=B9 https://lists.gnu.org/archive/html/guix-devel/2020-03/msg00299.html From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 09:24:47 2021 Received: (at 49149) by debbugs.gnu.org; 1 Jul 2021 13:24:47 +0000 Received: from localhost ([127.0.0.1]:59948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywgQ-0001LE-Ns for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:24:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywgO-0001L2-Vx for 49149@debbugs.gnu.org; Thu, 01 Jul 2021 09:24:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50786) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lywgJ-0004Rj-Pl; Thu, 01 Jul 2021 09:24:39 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36606 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lywgJ-0003zj-Hd; Thu, 01 Jul 2021 09:24:39 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210621061205.31878-1-maxim.cournoyer@gmail.com> <20210621061205.31878-6-maxim.cournoyer@gmail.com> <87wnqboedx.fsf_-_@gnu.org> <877dib43qt.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 01 Jul 2021 15:24:38 +0200 In-Reply-To: <877dib43qt.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 30 Jun 2021 14:16:42 -0400") Message-ID: <87im1ukvzd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hi! Maxim Cournoyer skribis: [...] >>> (define (file-prefix? file1 file2) >>> - "Return #t if FILE1 denotes the name of a file that is a parent of F= ILE2, >>> -where both FILE1 and FILE2 are absolute file name. For example: >>> + "Return #t if FILE1 denotes the name of a file that is a parent of F= ILE2. >>> +For example: >>>=20=20 >>> (file-prefix? \"/gnu\" \"/gnu/store\") >>> =3D> #t >>> @@ -240,19 +241,41 @@ where both FILE1 and FILE2 are absolute file name= . For example: >>> (file-prefix? \"/gn\" \"/gnu/store\") >>> =3D> #f >>> " >>> - (and (string-prefix? "/" file1) >>> - (string-prefix? "/" file2) >> >> Doesn=E2=80=99t it have the effect that now: >> >> (file-prefix? "gnu" "/gnu/store") =3D> #t >> >> ? > > Good catch. That seems sub-optimal. How about: [...] > + (define (absolute? file) > + (string-prefix? "/" file)) > + > + (if (or (every absolute? (list file1 file2)) > + (every (negate absolute?) (list file1 file2))) Yes, that could work. >> I=E2=80=99d rather insist on absolute file names and preserve the initial >> semantics, to avoid bad surprises. > > I agree that not changing the original semantics would be safest; > nevertheless, we're talking about an internal helper that isn't widely > use; its couple usages are easy to review (and deals with mount points > which seems safe to assume are exclusively using absolute paths). > Especially after the above fix :-). Sure, but it=E2=80=99s always easier to reason about code that is stricter. >>> +(define (reduce-directories file-names) >>> + "Eliminate entries in FILE-NAMES that are children of other entries = in >>> +FILE-NAMES. This is for example useful when passing a list of files t= o GNU >>> +tar, which would otherwise descend into each directory passed and arch= ive the >>> +duplicate files as hard links, which can be undesirable." >>> + (let* ((file-names/sorted >>> + ;; Ascending sort by file hierarchy depth, then by file name= length. >>> + (stable-sort (delete-duplicates file-names) >>> + (lambda (f1 f2) >>> + (let ((depth1 (file-name-depth f1)) >>> + (depth2 (file-name-depth f2))) >>> + (if (=3D depth1 depth2) >>> + (string< f1 f2) >>> + (< depth1 depth2))))))) >>> + (reverse (fold (lambda (file-name results) >>> + (if (find (cut file-prefix? <> file-name) results) >>> + results ;parent found -- skipping >>> + (cons file-name results))) >>> + '() >>> + file-names/sorted)))) >> >> Likewise, I suspect it doesn=E2=80=99t work as intended if there are rel= ative >> file names in the list, no? > > You can see it at work in the tests/file-systems test module; it reduces > > (reduce-directories '("./opt/gnu/etc" "./opt/gnu/" "./opt/gnu/bin" > "./opt/gnu/lib/debug" "./opt/gnuism" "a/b/c" > "a/b/c")) > > into '("./opt/gnu/" "./opt/gnuism" "a/b/c"), none of which are absolute > file names. Oh right! >> Perhaps we could add an example to the docstring. Also, the word >> =E2=80=9Creduce=E2=80=9D doesn=E2=80=99t appear in the docstring, which = to me suggests >> suboptimal naming. ;-) > > That the word 'reduce' doesn't appear in the docstring was a conscious > effort of mine to not bore the reader with repeating the same terms, ah! > But naming is hard; I'm open to suggestions. Actually I don=E2=80=99t have a good suggestion. :-) =E2=80=98strip-child-directories=E2=80=99 maybe? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 09:26:54 2021 Received: (at 49149) by debbugs.gnu.org; 1 Jul 2021 13:26:54 +0000 Received: from localhost ([127.0.0.1]:59962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywiU-0001Ob-Hl for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:26:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywiS-0001OH-UK for 49149@debbugs.gnu.org; Thu, 01 Jul 2021 09:26:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50958) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lywiN-0006GA-LG; Thu, 01 Jul 2021 09:26:47 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36608 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lywiN-0005Gy-DV; Thu, 01 Jul 2021 09:26:47 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> <87lf6roe32.fsf_-_@gnu.org> <8735sz42tc.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 01 Jul 2021 15:26:45 +0200 In-Reply-To: <8735sz42tc.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 30 Jun 2021 14:36:47 -0400") Message-ID: <87bl7mkvvu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Maxim Cournoyer skribis: >> >>> Instead of just naming them by their pack type, add information from the >>> package(s) they contain to make it easier to differentiate them. >>> >>> * guix/scripts/pack.scm (define-with-source): New macro. >>> (manifest->friendly-name): Extract procedure from ... >>> (docker-image): ... here, now defined via the above macro. Adjust REPO= SITORY >>> argument value accordingly. >>> (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. >> >> [...] >> >>> - (define tag >>> - ;; Compute a meaningful "repository" name, which will sh= ow up in >>> - ;; the output of "docker images". >>> - (let ((manifest (profile-manifest #$profile))) >>> - (let loop ((names (map manifest-entry-name >>> - (manifest-entries manifest)))) >>> - (define str (string-join names "-")) >>> - (if (< (string-length str) 40) >>> - str >>> - (match names >>> - ((_) str) >>> - ((names ... _) (loop names))))))) ;drop one en= try >> >> I think this should not be factorized because the requirements are very >> Docker-dependent. Once factorized, it becomes easy to overlook this. > > Hmm, I'm not a docker format expert, but my quick reading about it > turned no restrictions about what a docker image label should look like? > So perhaps it is not specially Docker-dependent. It=E2=80=99s a hack specifically written with Docker repository names in mi= nd, and the 40-or-so character limit, for instance. > If there's something truly Docker-dependent about it I'd suggest adding > a #:docker-compatible? boolean option to the procedure. To me it=E2=80=99s a case where factorization isn=E2=80=99t beneficial. Ev= en if there=E2=80=99s a similar procedure used in a different context, it=E2=80=99s still a diffe= rent context with different constraints. My 2=C2=A2! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 09:52:26 2021 Received: (at 49149) by debbugs.gnu.org; 1 Jul 2021 13:52:26 +0000 Received: from localhost ([127.0.0.1]:60010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyx7C-00021h-68 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:52:26 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:46888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyx7A-00021U-7R for 49149@debbugs.gnu.org; Thu, 01 Jul 2021 09:52:24 -0400 Received: by mail-qk1-f179.google.com with SMTP id 19so5997314qky.13 for <49149@debbugs.gnu.org>; Thu, 01 Jul 2021 06:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=aeVube6/1UD3m8BdqLw4CB/+0z3AURvITzeECkrmKhs=; b=hbAqxaKstPPLqKLrqor4XmG4KFtLJypvplU+vyOmsB8URmoXsRtFk+GEtBvH1O1Bna UK3+lrGYyv1SzmBHR5c749NAhAkI+sXQqTZnHwiQG/e2jHqiKs8cTMfBN0KCDqcb/pCi bEfM25uHocKybYJSOtylLyaJuUfcG2lXcwWduhGTv1F6rbHXJh+to7sO/SOSNP2+NSPh 9t8DeXsYI4Wscx92ZVDW4MPPrzaUilaDexAI7hX131iYMQv5OnkWXqMQfZg6R070yUoH ZcsxOwRwufq0UAuxG+cYAm+wzR+2g46iaKzzHJopBhb2NtAJvJyLak46u7onpG1y0Wx3 cEgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=aeVube6/1UD3m8BdqLw4CB/+0z3AURvITzeECkrmKhs=; b=LSKxp/HxGrplshHvHPGNI1VPn9eOYJPjlF9vXRLThYZBcuaAe6FEGywAWzRYzlqQ3t Dnc4KUmcgsSYlkiE6z9IjlEmK1CMlPVwzDS3EBn70e2MdJzy7zGZB2cmFqrBsfZ8oYk0 o06CnSQ06IJHhySD1XkSW31rjQ19Cfhgfsbe85smAoDLjMCbw8BGyJMyKZn7yAwb/UjO wphQfmtV4pxGfHHr+hdkmNOEnxol5ELw/YV0i12CtcgTeKY1bcqCrVZ3M/xMZcp0VSbb G51Nl+6Vyg5G0uTyFCEfhcCWuJ5Z3b7Zh/fMmkm2kbkkcrsXlEAHQx5Iq71gsdpYR3Jo m1vQ== X-Gm-Message-State: AOAM530Xr4DiLcyOU7HsycBxUGtnEv13R+HyfGcphHhcmIddUU6Y97MH gTc71bEd+8Dm6bVUW9DvLTHRBPHDJtePl3xLoEY= X-Google-Smtp-Source: ABdhPJw3ui2uAtHmnwikIAnYW7h9xs/fEBB16KfGbP8BJnB5hncT58MxEpSQSzcdCxNPmNjssO+U9tMLl8qqDSARjTk= X-Received: by 2002:a37:ef0d:: with SMTP id j13mr136649qkk.126.1625147538646; Thu, 01 Jul 2021 06:52:18 -0700 (PDT) MIME-Version: 1.0 References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <87wnqb483r.fsf@gmail.com> <87pmw2kw5t.fsf@gnu.org> In-Reply-To: <87pmw2kw5t.fsf@gnu.org> From: zimoun Date: Thu, 1 Jul 2021 15:52:07 +0200 Message-ID: Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@debbugs.gnu.org, Maxim Cournoyer 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: -1.0 (-) Hi, On Thu, 1 Jul 2021 at 15:21, Ludovic Court=C3=A8s wrote: > Work on layered Docker images, notably by Chris Baines=C2=B9, could perha= ps > be handy here. Do you mean something =C3=A0 la Nixery [1]? 1: > =C2=B9 https://lists.gnu.org/archive/html/guix-devel/2020-03/msg00299.htm= l Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 23:21:33 2021 Received: (at 49149) by debbugs.gnu.org; 4 Jul 2021 03:21:33 +0000 Received: from localhost ([127.0.0.1]:40271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzshI-00015c-Na for submit@debbugs.gnu.org; Sat, 03 Jul 2021 23:21:33 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:42710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzshG-00015O-V0 for 49149@debbugs.gnu.org; Sat, 03 Jul 2021 23:21:31 -0400 Received: by mail-qt1-f180.google.com with SMTP id y9so9805779qtx.9 for <49149@debbugs.gnu.org>; Sat, 03 Jul 2021 20:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3LW5qOIQzLoOmwa5CsdRAvMhJB46amBkS8GFCcCKk+U=; b=fa5exlurQP6ecQ3PtMBh1EM4vo2OfVO+F9qIb2v/a0aR6umEuo0FOw9lF4+sLVncps VBbSWWYs5pr/dLmLsqqbA/wZj9lBXhg6jsvBCwW2kPx37hhNXGY1vnU7C71kgN6yQ6R+ 0FbSuniUVRJhLtljB9Hi4gKQbbU5HVdOOeg/RTzwlTmtcJ+n9xzWlz5djJG0ULKAmWz5 AnDSpaikQMSetDswbYJQuVDFmhnyVw5hepzXaFbJama79WuUwO2CdQmuJ86uTiir4yBI uDJxTCGqToUFka/rxJIQ3sUwzOJw5JaaamLsBnvW0frFaNUe4XehuDsbbtJxfqIQgaVJ nxuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3LW5qOIQzLoOmwa5CsdRAvMhJB46amBkS8GFCcCKk+U=; b=sCZpxz9UiEXknAS5bBxykRCuPJJpjLeMJI0snUirTef1NoNVR5sGGVpNbw7Abnl+fQ sv3ScymDRXYNkNgjHqwKgyxs5vO/VyUwQ3C6JX8zvMA7NBvC+N9LXalU9PC5D3AWpMRt M5KwpyqaxKywFu+WCXFEUdxPRwwWWfJyhpXBuWNHUreCB5+uc6Jdh/6PTFkcyCEuowIU iSQdyVrj75uz38RHTNsC6rRtECfqNyZjey4I7M01Ji6Jg//dzW3m6vaOC5dbpcx/CBjI 9IdbNy6IXhSsbpKNxzeuZDzEZaE6UiQNr994SlXByuZ/zEETgiVuBj8ftNkf4aife/cb knbw== X-Gm-Message-State: AOAM5338HGwcsVsDXUCHhADNpHoUEWZTYesfVJXaheqsrjyvYLW5nFY1 I9ZVwriA9fJnsSUfbW96vQpTw9UDxbEOHg== X-Google-Smtp-Source: ABdhPJysELW56Bz5X1ys3vdMShYTtR82qu9hRT8Prl7ua85Z+4SC8DUmMvDbO1QRoDPXUOZycNI9+A== X-Received: by 2002:ac8:5813:: with SMTP id g19mr6922879qtg.383.1625368884111; Sat, 03 Jul 2021 20:21:24 -0700 (PDT) Received: from hurd (dsl-10-132-56.b2b2c.ca. [72.10.132.56]) by smtp.gmail.com with ESMTPSA id e1sm3117211qti.27.2021.07.03.20.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 20:21:23 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> <87lf6roe32.fsf_-_@gnu.org> <8735sz42tc.fsf@gmail.com> <87bl7mkvvu.fsf@gnu.org> Date: Sat, 03 Jul 2021 23:21:05 -0400 In-Reply-To: <87bl7mkvvu.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 01 Jul 2021 15:26:45 +0200") Message-ID: <87zgv2228u.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149 Cc: 49149@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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: >> >>> Maxim Cournoyer skribis: >>> >>>> Instead of just naming them by their pack type, add information from t= he >>>> package(s) they contain to make it easier to differentiate them. >>>> >>>> * guix/scripts/pack.scm (define-with-source): New macro. >>>> (manifest->friendly-name): Extract procedure from ... >>>> (docker-image): ... here, now defined via the above macro. Adjust REP= OSITORY >>>> argument value accordingly. >>>> (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. >>> >>> [...] >>> >>>> - (define tag >>>> - ;; Compute a meaningful "repository" name, which will s= how up in >>>> - ;; the output of "docker images". >>>> - (let ((manifest (profile-manifest #$profile))) >>>> - (let loop ((names (map manifest-entry-name >>>> - (manifest-entries manifest)))) >>>> - (define str (string-join names "-")) >>>> - (if (< (string-length str) 40) >>>> - str >>>> - (match names >>>> - ((_) str) >>>> - ((names ... _) (loop names))))))) ;drop one e= ntry >>> >>> I think this should not be factorized because the requirements are very >>> Docker-dependent. Once factorized, it becomes easy to overlook this. >> >> Hmm, I'm not a docker format expert, but my quick reading about it >> turned no restrictions about what a docker image label should look like? >> So perhaps it is not specially Docker-dependent. > > It=E2=80=99s a hack specifically written with Docker repository names in = mind, > and the 40-or-so character limit, for instance. The actual name length requirement for a Docker repository name seems to be that it must be between 2 and 255 characters [0]; the attached patch ensure that this is respected. > To me it=E2=80=99s a case where factorization isn=E2=80=99t beneficial. = Even if there=E2=80=99s > a similar procedure used in a different context, it=E2=80=99s still a dif= ferent > context with different constraints. My 2=C2=A2! It seems to me that with the attached patch we get to share what used to be a Docker-specific abstraction without any added risk (have our cake and it eat to!). What do you think? Thanks, Maxim --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-guix-docker-Ensure-repository-name-length-limits-are.patch Content-Transfer-Encoding: quoted-printable >From f3dc90213423bf0a087245bd4bfc8c4a828d4df1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 3 Jul 2021 23:08:15 -0400 Subject: [PATCH] guix: docker: Ensure repository name length limits are met. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * guix/docker.scm (canonicalize-repository-name): Fix typo in doc. Capture repository name length limits and ensure they are met, by either truncating= or padding the normalized name. Reported-by: Ludovic Court=C3=A8s --- guix/docker.scm | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/guix/docker.scm b/guix/docker.scm index bd952e45ec..4239ccdf9c 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2017 Ricardo Wurmus ;;; Copyright =C2=A9 2017, 2018, 2019, 2021 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Chris Marusich +;;; Copyright =C2=A9 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,8 +60,13 @@ (container_config . #nil))) =20 (define (canonicalize-repository-name name) - "\"Repository\" names are restricted to roughtl [a-z0-9_.-]. + "\"Repository\" names are restricted to roughly [a-z0-9_.-]. Return a version of TAG that follows these rules." + ;; Refer to https://docs.docker.com/docker-hub/repos/. + (define min-length 2) + (define padding-character #\a) + (define max-length 255) + (define ascii-letters (string->char-set "abcdefghijklmnopqrstuvwxyz")) =20 @@ -70,11 +76,21 @@ Return a version of TAG that follows these rules." (define repo-char-set (char-set-union char-set:digit ascii-letters separators)) =20 - (string-map (lambda (chr) - (if (char-set-contains? repo-char-set chr) - chr - #\.)) - (string-trim (string-downcase name) separators))) + (define normalized-name + (string-map (lambda (chr) + (if (char-set-contains? repo-char-set chr) + chr + #\.)) + (string-trim (string-downcase name) separators))) + + (let ((l (string-length normalized-name))) + (match l + ((? (cut > <> max-length)) + (string-take normalized-name max-length)) + ((? (cut < <> min-length )) + (string-append normalized-name + (make-string (- min-length l) padding-character))) + (_ normalized-name)))) =20 (define* (manifest path id #:optional (tag "guix")) "Generate a simple image manifest." --=20 2.32.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 12:15:07 2021 Received: (at 49149) by debbugs.gnu.org; 5 Jul 2021 16:15:07 +0000 Received: from localhost ([127.0.0.1]:46561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RFT-0007kX-Cs for submit@debbugs.gnu.org; Mon, 05 Jul 2021 12:15:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RFR-0007jf-Ia for 49149@debbugs.gnu.org; Mon, 05 Jul 2021 12:15:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43226) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0RFM-0003Ub-Ch; Mon, 05 Jul 2021 12:15:00 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42742 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0RFM-0001zp-1x; Mon, 05 Jul 2021 12:15:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> <87lf6roe32.fsf_-_@gnu.org> <8735sz42tc.fsf@gmail.com> <87bl7mkvvu.fsf@gnu.org> <87zgv2228u.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 05 Jul 2021 18:14:58 +0200 In-Reply-To: <87zgv2228u.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 03 Jul 2021 23:21:05 -0400") Message-ID: <87tul8spod.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@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 (---) Hello, Maxim Cournoyer skribis: [...] >> It=E2=80=99s a hack specifically written with Docker repository names in= mind, >> and the 40-or-so character limit, for instance. > > The actual name length requirement for a Docker repository name seems to > be that it must be between 2 and 255 characters [0]; the attached patch > ensure that this is respected. > >> To me it=E2=80=99s a case where factorization isn=E2=80=99t beneficial. = Even if there=E2=80=99s >> a similar procedure used in a different context, it=E2=80=99s still a di= fferent >> context with different constraints. My 2=C2=A2! > > It seems to me that with the attached patch we get to share what used to > be a Docker-specific abstraction without any added risk (have our cake > and it eat to!). [...] > From f3dc90213423bf0a087245bd4bfc8c4a828d4df1 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Sat, 3 Jul 2021 23:08:15 -0400 > Subject: [PATCH] guix: docker: Ensure repository name length limits are m= et. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > * guix/docker.scm (canonicalize-repository-name): Fix typo in doc. Captu= re > repository name length limits and ensure they are met, by either truncati= ng or > padding the normalized name. > > Reported-by: Ludovic Court=C3=A8s LGTM, thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 12:17:32 2021 Received: (at 49149) by debbugs.gnu.org; 5 Jul 2021 16:17:32 +0000 Received: from localhost ([127.0.0.1]:46565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RHn-0007p3-R9 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 12:17:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RHm-0007oo-DJ for 49149@debbugs.gnu.org; Mon, 05 Jul 2021 12:17:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43264) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0RHf-00054o-Dj; Mon, 05 Jul 2021 12:17:24 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42744 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0RHf-0002E6-6P; Mon, 05 Jul 2021 12:17:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: [bug#49149] [PATCH 0/7] Add deb format for guix pack. References: <20210621061039.31557-1-maxim.cournoyer@gmail.com> <87eecsuv85.fsf@gnu.org> <87k0mcv9wh.fsf_-_@gmail.com> <87bl7npvbg.fsf@gnu.org> <87wnqb483r.fsf@gmail.com> <87pmw2kw5t.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 05 Jul 2021 18:17:21 +0200 In-Reply-To: (zimoun's message of "Thu, 1 Jul 2021 15:52:07 +0200") Message-ID: <87pmvwspke.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (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: 49149 Cc: 49149@debbugs.gnu.org, Maxim Cournoyer 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 (---) zimoun skribis: > On Thu, 1 Jul 2021 at 15:21, Ludovic Court=C3=A8s wrote: > >> Work on layered Docker images, notably by Chris Baines=C2=B9, could perh= aps >> be handy here. > > Do you mean something =C3=A0 la Nixery [1]? > > 1: Yes. Ludo'. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 16:42:20 2021 Received: (at 49149-done) by debbugs.gnu.org; 5 Jul 2021 20:42:20 +0000 Received: from localhost ([127.0.0.1]:46749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0VQ4-00087W-K4 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 16:42:20 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:38404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0VQ3-00087K-FG for 49149-done@debbugs.gnu.org; Mon, 05 Jul 2021 16:42:19 -0400 Received: by mail-qk1-f176.google.com with SMTP id b18so6571290qkc.5 for <49149-done@debbugs.gnu.org>; Mon, 05 Jul 2021 13:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Ygg7wdz9eoDE+XyZdOvSSHKK8X6w2FLjpIIGji0T9Ow=; b=QaFASPmykaeJgWBa3y+x6oZhZZ2p6DV3DeRE9dtnLU6zcsBtWmZ+rRsG0H9W81GWx3 F85q2+gmT/E3uQaXEzpXhZdWXNJmehMYo/psArrKjSAZzPvzhA2GaPnlwmIYaSQUNL96 HD0IbvQJPejPNayjIdLRd9enPB2Ssu4Uuhkz552LdavnGXg3haLGd/rgN3yTdJgz8tb2 jlUW0AzV/0eQxLepECQp7IhrIwOKU+7jeunuupc0Visrqim5FP4E3vaCHQeIfDz8y9sF G1CvxcLy9oPGr99EXo9BtEbRcMBsoYfE1Kytw2sHU4CLuiUR5vVAe0EM6UxtPmZ1wNNE KkMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Ygg7wdz9eoDE+XyZdOvSSHKK8X6w2FLjpIIGji0T9Ow=; b=KpIUREwNrtN47FGqFeYip70O7ZVt0TRNi1cFjap0N2tFPH/jkrxCIgEFbiMzS9QCET hK/HnAvYGzagzBnbGUb0PRNbaDI+QL7oxNKWWq6JBCyJeOlvyfl9NPVn5iQs5kugs+wF JXYZZLylQKXJea1Ene32vpg2/HHorqiT7otxE+/drkbrv1Wn2Olwec2SwMXuYVaaXtrB ZctJ+3u0x2riLf4l0lAqJBiCsvUjU+ARODGI5z0FEJTjDSNhLp2BdkUgocEkrVdUJds0 VLa+ZkGUdGs5EOEJ2wZNl6uylilEg/lXZgkyUi3+PWUqxiG1VE6H4y4x7RCGLBBPgLHB +m5Q== X-Gm-Message-State: AOAM532swaNblDRO9fzElGRQYYHIkP9qMsp8NZpaXHCdx8ESywEmat+h 7EF2MaqGk6ScoAZpq4+Yfe3GinPG9vhcGQ== X-Google-Smtp-Source: ABdhPJwfs8D07HoWPNNEV6IDpMIM+Wfts7+Msf/cbTuvxs0hdVUXm5sumWdKtzOKhNMa0YGSm/QGXw== X-Received: by 2002:a05:620a:8d7:: with SMTP id z23mr12700647qkz.347.1625517733719; Mon, 05 Jul 2021 13:42:13 -0700 (PDT) Received: from hurd (dsl-205-233-125-221.b2b2c.ca. [205.233.125.221]) by smtp.gmail.com with ESMTPSA id d12sm4790279qto.39.2021.07.05.13.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 13:42:13 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49149: [PATCH 0/7] Add deb format for guix pack. References: <20210624044049.17906-1-maxim.cournoyer@gmail.com> <20210624044049.17906-4-maxim.cournoyer@gmail.com> <87lf6roe32.fsf_-_@gnu.org> <8735sz42tc.fsf@gmail.com> <87bl7mkvvu.fsf@gnu.org> <87zgv2228u.fsf@gmail.com> <87tul8spod.fsf@gnu.org> Date: Mon, 05 Jul 2021 16:42:12 -0400 In-Reply-To: <87tul8spod.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 05 Jul 2021 18:14:58 +0200") Message-ID: <87v95o1oij.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49149-done Cc: 49149-done@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: -1.0 (-) Hello, Ludovic Court=C3=A8s writes: [...] >> From f3dc90213423bf0a087245bd4bfc8c4a828d4df1 Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Sat, 3 Jul 2021 23:08:15 -0400 >> Subject: [PATCH] guix: docker: Ensure repository name length limits are = met. >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> * guix/docker.scm (canonicalize-repository-name): Fix typo in doc. Capt= ure >> repository name length limits and ensure they are met, by either truncat= ing or >> padding the normalized name. >> >> Reported-by: Ludovic Court=C3=A8s > > LGTM, thank you! > > Ludo=E2=80=99. Pushed as 38bcef1c3b. Thanks! Maxim From unknown Sat Sep 13 08:10:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 03 Aug 2021 11:24:07 +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