From patchwork Fri Feb 8 10:35:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 997 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9384916BCF; Fri, 8 Feb 2019 10:36:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4A15A16BC7 for ; Fri, 8 Feb 2019 10:36:11 +0000 (GMT) Received: from localhost ([127.0.0.1]:54351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3Vy-0004lQ-TC for patchwork@mira.cbaines.net; Fri, 08 Feb 2019 05:36:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3Vr-0004g9-51 for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs3Vq-000887-CG for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gs3Vq-000881-4a for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gs3Vq-0007ii-1h for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34385] [PATCH 1/2] gnu: ruby-build-system: Change extract-gemspec to always return #t. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Feb 2019 10:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34385 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34385@debbugs.gnu.org Received: via spool by 34385-submit@debbugs.gnu.org id=B34385.154962215629656 (code B ref 34385); Fri, 08 Feb 2019 10:36:01 +0000 Received: (at 34385) by debbugs.gnu.org; 8 Feb 2019 10:35:56 +0000 Received: from localhost ([127.0.0.1]:38941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs3Vj-0007iB-RA for submit@debbugs.gnu.org; Fri, 08 Feb 2019 05:35:56 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:38794 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs3Vi-0007hu-44 for 34385@debbugs.gnu.org; Fri, 08 Feb 2019 05:35:54 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id E4D0616BC7 for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 10:35:52 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 81a0211a for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 10:35:52 +0000 (UTC) From: Christopher Baines Date: Fri, 8 Feb 2019 10:35:51 +0000 Message-Id: <20190208103552.5992-1-mail@cbaines.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <875ztur313.fsf@cbaines.net> References: <875ztur313.fsf@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/build/ruby-build-system.scm (extract-gemspec): Return #t right at the end, rather than returning # when not handling a gem archive. --- guix/build/ruby-build-system.scm | 45 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index 3a658e2557..cdabd829e2 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -86,28 +86,29 @@ operation is not deterministic, we replace it with `find`." "Remove the original gemspec, if present, and replace it with a new one. This avoids issues with upstream gemspecs requiring tools such as git to generate the files list." - (when (gem-archive? source) - (let ((gemspec (or (false-if-exception (first-gemspec)) - ;; Make new gemspec if one wasn't shipped. - ".gemspec"))) - - (when (file-exists? gemspec) (delete-file gemspec)) - - ;; Extract gemspec from source gem. - (let ((pipe (open-pipe* OPEN_READ "gem" "spec" "--ruby" source))) - (dynamic-wind - (const #t) - (lambda () - (call-with-output-file gemspec - (lambda (out) - ;; 'gem spec' writes to stdout, but 'gem build' only reads - ;; gemspecs from a file, so we redirect the output to a file. - (while (not (eof-object? (peek-char pipe))) - (write-char (read-char pipe) out)))) - #t) - (lambda () - (close-pipe pipe))))) - #t)) + (if (gem-archive? source) + (let ((gemspec (or (false-if-exception (first-gemspec)) + ;; Make new gemspec if one wasn't shipped. + ".gemspec"))) + + (when (file-exists? gemspec) (delete-file gemspec)) + + ;; Extract gemspec from source gem. + (let ((pipe (open-pipe* OPEN_READ "gem" "spec" "--ruby" source))) + (dynamic-wind + (const #t) + (lambda () + (call-with-output-file gemspec + (lambda (out) + ;; 'gem spec' writes to stdout, but 'gem build' only reads + ;; gemspecs from a file, so we redirect the output to a file. + (while (not (eof-object? (peek-char pipe))) + (write-char (read-char pipe) out)))) + #t) + (lambda () + (close-pipe pipe))))) + (display "extract-gemspec: skipping as source is not a gem archive\n")) + #t) (define* (build #:key source #:allow-other-keys) "Build a new gem using the gemspec from the SOURCE gem." From patchwork Fri Feb 8 10:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 996 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B14F316BCF; Fri, 8 Feb 2019 10:36:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5DD7116BC7 for ; Fri, 8 Feb 2019 10:36:07 +0000 (GMT) Received: from localhost ([127.0.0.1]:54347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3Vs-0004gW-Gu for patchwork@mira.cbaines.net; Fri, 08 Feb 2019 05:36:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3Vq-0004fi-H4 for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs3Vp-00087v-Sj for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39660) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gs3Vp-00087m-PX for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gs3Vp-0007ia-Hh for guix-patches@gnu.org; Fri, 08 Feb 2019 05:36:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34385] [PATCH 2/2] guix: ruby-build-system: Do gem install --verbose. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Feb 2019 10:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34385 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34385@debbugs.gnu.org Received: via spool by 34385-submit@debbugs.gnu.org id=B34385.154962215529650 (code B ref 34385); Fri, 08 Feb 2019 10:36:01 +0000 Received: (at 34385) by debbugs.gnu.org; 8 Feb 2019 10:35:55 +0000 Received: from localhost ([127.0.0.1]:38939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs3Vj-0007i9-JX for submit@debbugs.gnu.org; Fri, 08 Feb 2019 05:35:55 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:38796 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs3Vi-0007hv-1Y for 34385@debbugs.gnu.org; Fri, 08 Feb 2019 05:35:54 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 07B0D16BCD for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 10:35:53 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id eb59bf7a for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 10:35:52 +0000 (UTC) From: Christopher Baines Date: Fri, 8 Feb 2019 10:35:52 +0000 Message-Id: <20190208103552.5992-2-mail@cbaines.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208103552.5992-1-mail@cbaines.net> References: <875ztur313.fsf@cbaines.net> <20190208103552.5992-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This is helpful as it displays more information about what gem install is doing, especially for packages with native extensions. * guix/build/ruby-build-system.scm (install): Add --verbose to gem install command. --- guix/build/ruby-build-system.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index cdabd829e2..64b4400f1a 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -144,6 +144,7 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." (or (zero? (apply system* "gem" "install" gem-file + "--verbose" "--local" "--ignore-dependencies" "--vendor" ;; Executables should go into /bin, not ;; /lib/ruby/gems. From patchwork Fri Feb 8 19:56:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 999 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 953A416BDA; Fri, 8 Feb 2019 20:19:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5009716BD7 for ; Fri, 8 Feb 2019 20:19:29 +0000 (GMT) Received: from localhost ([127.0.0.1]:33516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsCcS-0003JL-QV for patchwork@mira.cbaines.net; Fri, 08 Feb 2019 15:19:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsCbt-0002oh-DM for guix-patches@gnu.org; Fri, 08 Feb 2019 15:18:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsCbk-0001P3-4I for guix-patches@gnu.org; Fri, 08 Feb 2019 15:18:50 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gsCbd-00018q-CF for guix-patches@gnu.org; Fri, 08 Feb 2019 15:18:39 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gsCGj-00075D-IR for guix-patches@gnu.org; Fri, 08 Feb 2019 14:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34385] [PATCH v2 3/3] guix: ruby-build-system: Fix removal of extension related files. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Feb 2019 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34385 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34385@debbugs.gnu.org Received: via spool by 34385-submit@debbugs.gnu.org id=B34385.154965580727190 (code B ref 34385); Fri, 08 Feb 2019 19:57:01 +0000 Received: (at 34385) by debbugs.gnu.org; 8 Feb 2019 19:56:47 +0000 Received: from localhost ([127.0.0.1]:40153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsCGU-00074R-L1 for submit@debbugs.gnu.org; Fri, 08 Feb 2019 14:56:46 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:39138 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsCGS-000748-Et for 34385@debbugs.gnu.org; Fri, 08 Feb 2019 14:56:45 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 0B6BC16BDA for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 19:56:43 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id ebd3eb07 for <34385@debbugs.gnu.org>; Fri, 8 Feb 2019 19:56:42 +0000 (UTC) From: Christopher Baines Date: Fri, 8 Feb 2019 19:56:42 +0000 Message-Id: <20190208195642.4057-3-mail@cbaines.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208195642.4057-1-mail@cbaines.net> References: <875ztur313.fsf@cbaines.net> <20190208195642.4057-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This functionality was broken, possibly to do with the vendor related changes in the ruby build system. These changes restore the file removal functionality at the end of the install phase. * guix/build/ruby-build-system.scm (install): Fix removal of files related to native extensions. --- guix/build/ruby-build-system.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index 64b4400f1a..ba0de1259e 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -139,7 +139,8 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." (gem-file-basename (basename gem-file)) (gem-name (substring gem-file-basename 0 - (- (string-length gem-file-basename) 4)))) + (- (string-length gem-file-basename) 4))) + (gem-dir (string-append vendor-dir "/gems/" gem-name))) (setenv "GEM_VENDOR" vendor-dir) (or (zero? @@ -165,7 +166,7 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." ;; For gems with native extensions, several Makefile-related files ;; are created that contain timestamps or other elements making ;; them not reproducible. They are unnecessary so we remove them. - (when (file-exists? (string-append vendor-dir "/ext")) + (when (file-exists? (string-append gem-dir "/ext")) (for-each (lambda (file) (log-file-deletion file) (delete-file file)) @@ -174,7 +175,7 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." "page-Makefile.ri") (find-files (string-append vendor-dir "/extensions") "gem_make.out") - (find-files (string-append vendor-dir "/ext") + (find-files (string-append gem-dir "/ext") "Makefile")))) #t))