From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4mjZ-00008D-Ty for guix-patches@gnu.org; Mon, 02 Sep 2019 09:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4mjW-00063J-PI for guix-patches@gnu.org; Mon, 02 Sep 2019 09:51:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4mjW-000639-MO for guix-patches@gnu.org; Mon, 02 Sep 2019 09:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4mjW-0003Yw-Jr for guix-patches@gnu.org; Mon, 02 Sep 2019 09:51:02 -0400 Subject: [bug#37269] [PATCH] build-system/asdf: Add option to compress programs. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:54424) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4mix-00088q-2E for guix-patches@gnu.org; Mon, 02 Sep 2019 09:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4miv-00051D-HW for guix-patches@gnu.org; Mon, 02 Sep 2019 09:50:26 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:35173) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4miv-0004vI-4c for guix-patches@gnu.org; Mon, 02 Sep 2019 09:50:25 -0400 Received: from localhost.localdomain (lfbn-1-4117-127.w92-169.abo.wanadoo.fr [92.169.116.127]) (Authenticated sender: mail@ambrevar.xyz) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 4E3CC1C0011 for ; Mon, 2 Sep 2019 13:50:21 +0000 (UTC) From: Pierre Neidhardt Date: Mon, 2 Sep 2019 15:50:20 +0200 Message-Id: <20190902135020.14473-1-mail@ambrevar.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37269@debbugs.gnu.org * guix/build/lisp-utils.scm (build-program): Add `compress?' key argument. (generate-executable-for-system): Same. (generate-executable): Same. --- guix/build/lisp-utils.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 97bc6197a3..c7a589c902 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -220,12 +220,19 @@ Also load TEST-ASD-FILE if necessary." "Return a lisp keyword for the concatenation of STRINGS." (string->symbol (apply string-append ":" strings))) -(define (generate-executable-for-system type system) +(define* (generate-executable-for-system type system #:key compress?) "Use LISP to generate an executable, whose TYPE can be 'asdf:image-op or 'asdf:program-op. The latter will always be standalone. Depends on having created a \"SYSTEM-exec\" system which contains the entry program." (lisp-eval-program `((require :asdf) + ;; Only SBCL supports compression as of 2019-09-02. + ,(if (and compress? (string=? (%lisp-type) "sbcl")) + '(defmethod asdf:perform ((o asdf:image-op) (c asdf:system)) + (uiop:dump-image (asdf:output-file o c) + :executable t + :compression t)) + '()) (asdf:operate ',type ,(string-append system "-exec"))))) (define (generate-executable-wrapper-system system dependencies) @@ -339,6 +346,7 @@ which are not nested." (dependency-prefixes (list (library-output outputs))) (dependencies (list (basename program))) entry-program + compress? #:allow-other-keys) "Generate an executable program containing all DEPENDENCIES, and which will execute ENTRY-PROGRAM. The result is placed in PROGRAM. When executed, it @@ -350,6 +358,7 @@ retained." #:dependencies dependencies #:dependency-prefixes dependency-prefixes #:entry-program entry-program + #:compress? compress? #:type 'asdf:program-op) (let* ((name (basename program)) (bin-directory (dirname program))) @@ -382,6 +391,7 @@ DEPENDENCY-PREFIXES to ensure references to those libraries are retained." dependency-prefixes entry-program type + compress? #:allow-other-keys) "Generate an executable by using asdf operation TYPE, containing whithin the image all DEPENDENCIES, and running ENTRY-PROGRAM in the case of an @@ -405,7 +415,7 @@ references to those libraries are retained." `(((,bin-directory :**/ :*.*.*) (,bin-directory :**/ :*.*.*))))))) - (generate-executable-for-system type name) + (generate-executable-for-system type name #:compress? compress?) (let* ((after-store-prefix-index (string-index out-file #\/ -- 2.23.0