From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id bu/8LaAJLF9nIAAA0tVLHw (envelope-from ) for ; Thu, 06 Aug 2020 13:46:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GL+fKaAJLF9VYAAA1q6Kng (envelope-from ) for ; Thu, 06 Aug 2020 13:46:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E0274940365 for ; Thu, 6 Aug 2020 13:46:07 +0000 (UTC) Received: from localhost ([::1]:47930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3gDe-0002xh-T0 for larch@yhetil.org; Thu, 06 Aug 2020 09:46:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3gDa-0002w6-Qk for guix-patches@gnu.org; Thu, 06 Aug 2020 09:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3gDa-0003uJ-Gz for guix-patches@gnu.org; Thu, 06 Aug 2020 09:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k3gDa-0007Cl-FK for guix-patches@gnu.org; Thu, 06 Aug 2020 09:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42123] [PATCH] linux-libre: Enable module compression. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Aug 2020 13:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42123 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 42123@debbugs.gnu.org Received: via spool by 42123-submit@debbugs.gnu.org id=B42123.159672150427613 (code B ref 42123); Thu, 06 Aug 2020 13:46:02 +0000 Received: (at 42123) by debbugs.gnu.org; 6 Aug 2020 13:45:04 +0000 Received: from localhost ([127.0.0.1]:53465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3gCe-0007BI-Ah for submit@debbugs.gnu.org; Thu, 06 Aug 2020 09:45:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3gCZ-0007AS-Im for 42123@debbugs.gnu.org; Thu, 06 Aug 2020 09:45:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51090) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3gCT-0003ax-FC; Thu, 06 Aug 2020 09:44:53 -0400 Received: from lfbn-ann-1-356-169.w86-200.abo.wanadoo.fr ([86.200.73.169]:51036 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k3gCS-0005rA-24; Thu, 06 Aug 2020 09:44:52 -0400 From: Mathieu Othacehe References: <20200629142434.21308-1-othacehe@gnu.org> <87366atdve.fsf@gnu.org> <87lfjx6nb9.fsf@gnu.org> <873664ltqt.fsf@gnu.org> <878sfw7mec.fsf@gnu.org> <871rloiept.fsf@gnu.org> <874kqjn5k4.fsf@gnu.org> <874kqhcea1.fsf@gnu.org> <87v9i9exjq.fsf@gnu.org> <87tuxrqo9k.fsf@gnu.org> Date: Thu, 06 Aug 2020 15:44:48 +0200 In-Reply-To: <87tuxrqo9k.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 29 Jul 2020 00:16:07 +0200") Message-ID: <871rkjvqgf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: L8yw1N7IAt4O --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey Ludo! > This can be decomposed in several steps: > > 1. We can start using =E2=80=98guile-zlib=E2=80=99 as extensions for ge= xps: in (guix > scripts pack), (guix download), etc. Easy, no risk. There's an attached patch that should cover this first step. An issue here is that (guix build download-nar) is built in both "make" and "guix pull" commands, so I cannot use a bare: --8<---------------cut here---------------start------------->8--- #:use-module (zlib) --8<---------------cut here---------------end--------------->8--- so, I used: --8<---------------cut here---------------start------------->8--- #:autoload (zlib) (call-with-gzip-input-port) --8<---------------cut here---------------end--------------->8--- that seems to work but produces a lot of warnings when running "make". Would it be acceptable as a first step? > > 2. Use guile-zlib & co. in Guix itself: (guix scripts substitute), > (guix scripts publish), etc. Keep (guix zlib) and (guix lzlib) in > parallel. I'm not sure how it can work without step 4. For me, including (zlib) in Guix itself requires that build machinery and (guix self) are updated, but maybe I'm missing something. > > 3. Update =E2=80=98guix=E2=80=99 package with these two new dependencie= s. Seems fair! > The rest LGTM. Thanks a lot for all the work! Thanks for having a look :) Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Use-guile-zlib-extension-in-build-side-code.patch >From 680e19137d22204f34b00336a3cb98a02397b0f9 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 6 Aug 2020 15:00:01 +0200 Subject: [PATCH] Use guile-zlib extension in build-side code. * Makefile.am (MODULES): Move guix/build/download-nar.scm to ... (MODULES_NOT_COMPILED): ... here. * guix/build/download-nar.scm: Use (zlib) instead of (guix zlib). * guix/cvs-download.scm (cvs-fetch): Do not stub (guix config) in imported modules list, instead add "guile-zlib" to the extension list. * guix/git-download.scm (git-fetch): Ditto. * guix/hg-download.scm (hg-fetch): Do not stub (guix config) in imported modules list, instead add "guile-zlib" to the extension list. --- guix/build/download-nar.scm | 2 +- guix/cvs-download.scm | 39 ++++++++++++++----------------------- guix/git-download.scm | 29 ++++++++++----------------- guix/hg-download.scm | 37 +++++++++++++---------------------- 4 files changed, 40 insertions(+), 67 deletions(-) diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm index 377e428341..867f3c10bb 100644 --- a/guix/build/download-nar.scm +++ b/guix/build/download-nar.scm @@ -20,7 +20,7 @@ #:use-module (guix build download) #:use-module (guix build utils) #:use-module ((guix serialization) #:hide (dump-port*)) - #:use-module (guix zlib) + #:autoload (zlib) (call-with-gzip-input-port) #:use-module (guix progress) #:use-module (web uri) #:use-module (srfi srfi-11) diff --git a/guix/cvs-download.scm b/guix/cvs-download.scm index cb42103aae..76b3eac739 100644 --- a/guix/cvs-download.scm +++ b/guix/cvs-download.scm @@ -60,35 +60,26 @@ "Return a fixed-output derivation that fetches REF, a object. The output is expected to have recursive hash HASH of type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." - (define zlib - (module-ref (resolve-interface '(gnu packages compression)) 'zlib)) - - (define config.scm - (scheme-file "config.scm" - #~(begin - (define-module (guix config) - #:export (%libz)) - - (define %libz - #+(file-append zlib "/lib/libz"))))) + (define guile-zlib + (module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib)) (define modules - (cons `((guix config) => ,config.scm) - (delete '(guix config) - (source-module-closure '((guix build cvs) - (guix build download-nar)))))) + (delete '(guix config) + (source-module-closure '((guix build cvs) + (guix build download-nar))))) (define build (with-imported-modules modules - #~(begin - (use-modules (guix build cvs) - (guix build download-nar)) + (with-extensions (list guile-zlib) + #~(begin + (use-modules (guix build cvs) + (guix build download-nar)) - (or (cvs-fetch '#$(cvs-reference-root-directory ref) - '#$(cvs-reference-module ref) - '#$(cvs-reference-revision ref) - #$output - #:cvs-command (string-append #+cvs "/bin/cvs")) - (download-nar #$output))))) + (or (cvs-fetch '#$(cvs-reference-root-directory ref) + '#$(cvs-reference-module ref) + '#$(cvs-reference-revision ref) + #$output + #:cvs-command (string-append #+cvs "/bin/cvs")) + (download-nar #$output)))))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "cvs-checkout") build diff --git a/guix/git-download.scm b/guix/git-download.scm index 71ea1031c5..90634a8c4c 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -84,35 +84,26 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." ("tar" ,(module-ref (resolve-interface '(gnu packages base)) 'tar))))) - (define zlib - (module-ref (resolve-interface '(gnu packages compression)) 'zlib)) - (define guile-json (module-ref (resolve-interface '(gnu packages guile)) 'guile-json-3)) + (define guile-zlib + (module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib)) + (define gnutls (module-ref (resolve-interface '(gnu packages tls)) 'gnutls)) - (define config.scm - (scheme-file "config.scm" - #~(begin - (define-module (guix config) - #:export (%libz)) - - (define %libz - #+(file-append zlib "/lib/libz"))))) - (define modules - (cons `((guix config) => ,config.scm) - (delete '(guix config) - (source-module-closure '((guix build git) - (guix build utils) - (guix build download-nar) - (guix swh)))))) + (delete '(guix config) + (source-module-closure '((guix build git) + (guix build utils) + (guix build download-nar) + (guix swh))))) (define build (with-imported-modules modules - (with-extensions (list guile-json gnutls) ;for (guix swh) + (with-extensions (list guile-json gnutls ;for (guix swh) + guile-zlib) #~(begin (use-modules (guix build git) (guix build utils) diff --git a/guix/hg-download.scm b/guix/hg-download.scm index 4cdc1a780a..694105ceba 100644 --- a/guix/hg-download.scm +++ b/guix/hg-download.scm @@ -60,35 +60,26 @@ "Return a fixed-output derivation that fetches REF, a object. The output is expected to have recursive hash HASH of type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." - (define zlib - (module-ref (resolve-interface '(gnu packages compression)) 'zlib)) - - (define config.scm - (scheme-file "config.scm" - #~(begin - (define-module (guix config) - #:export (%libz)) - - (define %libz - #+(file-append zlib "/lib/libz"))))) + (define guile-zlib + (module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib)) (define modules - (cons `((guix config) => ,config.scm) - (delete '(guix config) - (source-module-closure '((guix build hg) - (guix build download-nar)))))) + (delete '(guix config) + (source-module-closure '((guix build hg) + (guix build download-nar))))) (define build (with-imported-modules modules - #~(begin - (use-modules (guix build hg) - (guix build download-nar)) + (with-extensions (list guile-zlib) + #~(begin + (use-modules (guix build hg) + (guix build download-nar)) - (or (hg-fetch '#$(hg-reference-url ref) - '#$(hg-reference-changeset ref) - #$output - #:hg-command (string-append #+hg "/bin/hg")) - (download-nar #$output))))) + (or (hg-fetch '#$(hg-reference-url ref) + '#$(hg-reference-changeset ref) + #$output + #:hg-command (string-append #+hg "/bin/hg")) + (download-nar #$output)))))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "hg-checkout") build -- 2.26.2 --=-=-=--