From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 07:06:01 2018 Received: (at submit) by debbugs.gnu.org; 14 Jul 2018 11:06:02 +0000 Received: from localhost ([127.0.0.1]:59514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feINF-0001UO-Ll for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:06:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feINE-0001UB-0p for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feIN8-0007zX-6t for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:05:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1feIN8-0007zI-38 for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:05:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feIN7-0005EU-1X for guix-patches@gnu.org; Sat, 14 Jul 2018 07:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feIN1-0007mE-Fv for guix-patches@gnu.org; Sat, 14 Jul 2018 07:05:53 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:40256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feIN1-0007lO-8Z for guix-patches@gnu.org; Sat, 14 Jul 2018 07:05:47 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id B0D60165D3; Sat, 14 Jul 2018 12:05:46 +0100 (BST) 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 8AF54165D0 for ; Sat, 14 Jul 2018 12:05:46 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id e17b56c2 for ; Sat, 14 Jul 2018 11:05:46 +0000 (UTC) User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH 0/2]: ruby-build-system: Error or return #t from all phases. Date: Sat, 14 Jul 2018 12:05:43 +0100 Message-ID: <87wotydqm0.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -5.0 (-----) --=-=-= Content-Type: text/plain I'm trying to continue along with the Rails packaging (#30689), but I noticed that currently if the tests fail for packages using the ruby build system, then the package build doesn't fail. These patches should get most of the packages using the ruby build system to raise exceptions when there are errors, and return #t otherwise. I'm hopeful that this can be merged directly in to master, I build 180 packages in not that much time at all to test this change [1]. 1: ./pre-inst-env guix package -s ruby- | recsel -P name | xargs ./pre-inst-env guix build Christopher Baines (2): ruby-build-system: Error or return #t from all phases. gnu: ruby-options: Return #t from set-LIB phase. gnu/packages/ruby.scm | 3 +- guix/build/ruby-build-system.scm | 109 ++++++++++++++++--------------- 2 files changed, 58 insertions(+), 54 deletions(-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAltJ2QdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdjNA//a4kkwywgONlHGfQo/Hf2ThFC+ouZeMFMT83qvuVtnVAaymm/u82g5Zbb F88GVBmzvejNA1j49nSXTrcTB54KIGdGwvwKYy3c9k1mvqQAE2M79Q7A/8Plo+ur gpTg20Qv+0KL7fwYECLGWz7gv2Z0NbSgc0HaYvjtsHMDQrKFHMQHZex1d6qattUw kbnrd0tEjh/VLWJyr+VjnxkvFL1s5XfK9/PRBWa5CFb5alz2mZmdfYtcJXOnCmcT 4eli/oSq6tRcnrmPrzgClRRPRofUkKiJDao6qsOvjBUdegEhA+n/ExPJaP/xb6BR sbWTKANAqwwhD9Att7FNvVe+lRIHw51a73/wx4Wxy4N65qPj8XHcNNFykb7yJvVe 40Bo6hcsZF1fPLEtVkWVVdMjbXbndB/98khnFMQjnth73DnjhwnH+4ttSH3IdX3f ml8FWu3Jp2CXcL1Ufnl2fHhB55Mrd7UsmFJQtMnzrbNZ4LZZzkjRWkUBhtGYfxHt q0e61Cb4YqAQOLk/sRRB3jKfQA0cw4eKiSgPSKbPR+nMtt/iHySDBF/AGP5qV9EE XS8Vhbb+BFRAwHDH/TMjJI62GYcmk5XnJm2PWQtcXTuoP3OHHtmH3CkZIpNyAb1l 9/OKsNN+0GtY2FUFHMFHlvqID+fC4bTJ6qzDlMhio7GaOhlnz90= =Slg7 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 07:10:28 2018 Received: (at 32153) by debbugs.gnu.org; 14 Jul 2018 11:10:28 +0000 Received: from localhost ([127.0.0.1]:59521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feIRW-0001bA-7x for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:10:26 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:52578 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feIRU-0001aw-5J for 32153@debbugs.gnu.org; Sat, 14 Jul 2018 07:10:24 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 4F0C9165D7; Sat, 14 Jul 2018 12:10:23 +0100 (BST) 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 localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 011AE165D4 for <32153@debbugs.gnu.org>; Sat, 14 Jul 2018 12:10:22 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 27539056 for <32153@debbugs.gnu.org>; Sat, 14 Jul 2018 11:10:22 +0000 (UTC) From: Christopher Baines To: 32153@debbugs.gnu.org Subject: [PATCH 1/2] ruby-build-system: Error or return #t from all phases. Date: Sat, 14 Jul 2018 12:10:21 +0100 Message-Id: <20180714111022.12609-1-mail@cbaines.net> X-Mailer: git-send-email 2.17.1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32153 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 (-) Previously, if the tests didn't pass, the check phase would evaluate to #f, but the package would be built sucessfully. This changes all the phases to raise exceptions if errors are encountered, and return #t otherwise. This involves using invoke rather than system*, so that exceptions are raised if the program exits with a status other than 0, and also returning #t at the end of functions. * gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*, and return #t at the end. (build, check): Use invoke rather than system*. (install): Remove the use of "and", and rewrite the error handling to raise an exception. (wrap): Return #t. --- guix/build/ruby-build-system.scm | 109 ++++++++++++++++--------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index abef6937b..0a2b223db 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -52,18 +52,19 @@ directory." (define* (unpack #:key source #:allow-other-keys) "Unpack the gem SOURCE and enter the resulting directory." (if (gem-archive? source) - (and (zero? (system* "gem" "unpack" source)) - ;; The unpacked gem directory is named the same as the archive, - ;; sans the ".gem" extension. It is renamed to simply "gem" in an - ;; effort to keep file names shorter to avoid UNIX-domain socket - ;; file names and shebangs that exceed the system's fixed maximum - ;; length when running test suites. - (let ((dir (match:substring (string-match "^(.*)\\.gem$" - (basename source)) - 1))) - (rename-file dir "gem") - (chdir "gem") - #t)) + (begin + (invoke "gem" "unpack" source) + ;; The unpacked gem directory is named the same as the archive, + ;; sans the ".gem" extension. It is renamed to simply "gem" in an + ;; effort to keep file names shorter to avoid UNIX-domain socket + ;; file names and shebangs that exceed the system's fixed maximum + ;; length when running test suites. + (let ((dir (match:substring (string-match "^(.*)\\.gem$" + (basename source)) + 1))) + (rename-file dir "gem") + (chdir "gem")) + #t) ;; Use GNU unpack strategy for things that aren't gem archives. (gnu:unpack #:source source))) @@ -104,7 +105,8 @@ generate the files list." (write-char (read-char pipe) out)))) #t) (lambda () - (close-pipe pipe))))))) + (close-pipe pipe))))) + #t)) (define* (build #:key source #:allow-other-keys) "Build a new gem using the gemspec from the SOURCE gem." @@ -112,13 +114,13 @@ generate the files list." ;; Build a new gem from the current working directory. This also allows any ;; dynamic patching done in previous phases to be present in the installed ;; gem. - (zero? (system* "gem" "build" (first-gemspec)))) + (invoke "gem" "build" (first-gemspec))) (define* (check #:key tests? test-target #:allow-other-keys) "Run the gem's test suite rake task TEST-TARGET. Skip the tests if TESTS? is #f." (if tests? - (zero? (system* "rake" test-target)) + (invoke "rake" test-target) #t)) (define* (install #:key inputs outputs (gem-flags '()) @@ -137,43 +139,43 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." 0 (- (string-length gem-file-basename) 4)))) (setenv "GEM_VENDOR" vendor-dir) - (and (let ((install-succeeded? - (zero? - (apply system* "gem" "install" gem-file - "--local" "--ignore-dependencies" "--vendor" - ;; Executables should go into /bin, not - ;; /lib/ruby/gems. - "--bindir" (string-append out "/bin") - gem-flags)))) - (or install-succeeded? - (begin - (simple-format #t "installation failed\n") - (let ((failed-output-dir (string-append (getcwd) "/out"))) - (mkdir failed-output-dir) - (copy-recursively out failed-output-dir)) - #f))) - (begin - ;; Remove the cached gem file as this is unnecessary and contains - ;; timestamped files rendering builds not reproducible. - (let ((cached-gem (string-append vendor-dir "/cache/" gem-file))) - (log-file-deletion cached-gem) - (delete-file cached-gem)) - ;; 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. - (if (file-exists? (string-append vendor-dir "/ext")) - (begin - (for-each (lambda (file) - (log-file-deletion file) - (delete-file file)) - (append - (find-files (string-append vendor-dir "/doc") - "page-Makefile.ri") - (find-files (string-append vendor-dir "/extensions") - "gem_make.out") - (find-files (string-append vendor-dir "/ext") - "Makefile"))))) - #t)))) + + (or (zero? + (apply system* "gem" "install" gem-file + "--local" "--ignore-dependencies" "--vendor" + ;; Executables should go into /bin, not + ;; /lib/ruby/gems. + "--bindir" (string-append out "/bin") + gem-flags)) + (begin + (let ((failed-output-dir (string-append (getcwd) "/out"))) + (mkdir failed-output-dir) + (copy-recursively out failed-output-dir)) + (error "installation failed"))) + + ;; Remove the cached gem file as this is unnecessary and contains + ;; timestamped files rendering builds not reproducible. + (let ((cached-gem (string-append vendor-dir "/cache/" gem-file))) + (log-file-deletion cached-gem) + (delete-file cached-gem)) + + ;; 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. + (if (file-exists? (string-append vendor-dir "/ext")) + (begin + (for-each (lambda (file) + (log-file-deletion file) + (delete-file file)) + (append + (find-files (string-append vendor-dir "/doc") + "page-Makefile.ri") + (find-files (string-append vendor-dir "/extensions") + "gem_make.out") + (find-files (string-append vendor-dir "/ext") + "Makefile"))))) + + #t)) (define* (wrap-ruby-program prog #:key (gem-clear-paths #t) #:rest vars) "Make a wrapper for PROG. VARS should look like this: @@ -301,7 +303,8 @@ extended with definitions for VARS." (let ((files (list-of-files dir))) (for-each (cut wrap-ruby-program <> var) files))) - bindirs))) + bindirs)) + #t) (define (log-file-deletion file) (display (string-append "deleting '" file "' for reproducibility\n"))) -- 2.17.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 07:10:28 2018 Received: (at 32153) by debbugs.gnu.org; 14 Jul 2018 11:10:28 +0000 Received: from localhost ([127.0.0.1]:59523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feIRY-0001bE-Dl for submit@debbugs.gnu.org; Sat, 14 Jul 2018 07:10:28 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:52580 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feIRU-0001ax-MT for 32153@debbugs.gnu.org; Sat, 14 Jul 2018 07:10:24 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 598EB165D6; Sat, 14 Jul 2018 12:10:24 +0100 (BST) 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 localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 18722165D5 for <32153@debbugs.gnu.org>; Sat, 14 Jul 2018 12:10:23 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 93d3a3d5 for <32153@debbugs.gnu.org>; Sat, 14 Jul 2018 11:10:22 +0000 (UTC) From: Christopher Baines To: 32153@debbugs.gnu.org Subject: [PATCH 2/2] gnu: ruby-options: Return #t from set-LIB phase. Date: Sat, 14 Jul 2018 12:10:22 +0100 Message-Id: <20180714111022.12609-2-mail@cbaines.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180714111022.12609-1-mail@cbaines.net> References: <20180714111022.12609-1-mail@cbaines.net> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32153 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 (-) * gnu/packages/ruby.scm (ruby-options)[arguments]: Return #t from the set-LIB phase. --- gnu/packages/ruby.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 1602fd5d5..9a74f16c0 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -883,7 +883,8 @@ complexity.") (lambda _ ;; This is used in the Rakefile, and setting it avoids an issue ;; with running the tests. - (setenv "LIB" "options")))))) + (setenv "LIB" "options") + #t))))) (synopsis "Ruby library to parse options from *args cleanly") (description "The @code{options} library helps with parsing keyword options in Ruby -- 2.17.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 19:11:11 2018 Received: (at 32153) by debbugs.gnu.org; 14 Jul 2018 23:11:11 +0000 Received: from localhost ([127.0.0.1]:60336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feTh1-0001hI-1B for submit@debbugs.gnu.org; Sat, 14 Jul 2018 19:11:11 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:48703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feTgz-0001hB-If for 32153@debbugs.gnu.org; Sat, 14 Jul 2018 19:11:10 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 39AAA21B31; Sat, 14 Jul 2018 19:11:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 14 Jul 2018 19:11:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=7v1KN5wh19skx4TWRm9shlxguecMqfC1JKX6n9Be0Hw=; b=Xgdk33Wc 274WI751XQ8VobAdA/YU/RcFiL1mGRU7LNRdjwt44qbEeVqOPdxd+XVhlp84cZDB Nv4YadJi+RtzhSuFWnJTU7rYCbWRBYmDlWjP3Nd0H2ir+i0AHOl/yFcsUSdXOJ06 vARUCNiLggRW1CX3lDPsf6EzgwyKxIN8Qt7X4HCeEXILaByKu/dh0eBIQ1jT/Jma iWiAtinDAxlK5YjUgdQdztpA4thyOM3KpQU+Dz5TXVh/V9xrcbJtmB8bVVs87Yhs k/NmirV7q39cmmkK/ZK/evTmmBulNVIfBpmchyaOBm0MQh0wP/wkpQanoBiZaxlz llo2lbxE0FpebQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=7v1KN5wh19skx4TWRm9shlxguecMq fC1JKX6n9Be0Hw=; b=Az1FDChJEQpv+SDnjP7t+LqbMticjQnV9wxWKeeVVNgY3 az8Kq1J9OUAoDcepsTERJj+/7f75CHoexZUyTuP1aft2XSxGXCVLtZ8ad2NTVl6y TesmlrG9yLq6GWCe/w+3ZAXmeyHSTC2wx+2ueWChuYRcPF9rsh2GJ37aAj3RCy/y udPh0VK8MrX7dfy0HXgHVo1AI9ldphiWyk8TeKaJTbTQzrP7wXlsoOqi4SES2HbW f+zLF5KSwhtdrWdG5FCP8VrF5+BLORn+gXnEjWbOIgBx1+r3vBRxJxA+UzxcZHhS +0vTUYB++p4ORzdmS5GwyzvOlyqU5npxyJ6kestRA== X-ME-Proxy: X-ME-Sender: Received: from localhost (95.92-221-151.customer.lyse.net [92.221.151.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DDD810255; Sat, 14 Jul 2018 19:11:08 -0400 (EDT) From: Marius Bakke To: Christopher Baines , 32153@debbugs.gnu.org Subject: Re: [bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all phases. In-Reply-To: <20180714111022.12609-1-mail@cbaines.net> References: <87wotydqm0.fsf@cbaines.net> <20180714111022.12609-1-mail@cbaines.net> User-Agent: Notmuch/0.27 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Sun, 15 Jul 2018 01:11:06 +0200 Message-ID: <87y3ed5s6t.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32153 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 (-) --=-=-= Content-Type: text/plain Christopher Baines writes: > Previously, if the tests didn't pass, the check phase would evaluate to #f, > but the package would be built sucessfully. This changes all the phases to > raise exceptions if errors are encountered, and return #t otherwise. > > This involves using invoke rather than system*, so that exceptions are raised > if the program exits with a status other than 0, and also returning #t at the > end of functions. > > * gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*, > and return #t at the end. > (build, check): Use invoke rather than system*. > (install): Remove the use of "and", and rewrite the error handling to raise an > exception. > (wrap): Return #t. Thanks! The changes LGTM. I will suggest a micro-improvement not related to this patch since it was there from before: > + ;; 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. > + (if (file-exists? (string-append vendor-dir "/ext")) > + (begin > + (for-each (lambda (file) > + (log-file-deletion file) > + (delete-file file)) > + (append > + (find-files (string-append vendor-dir "/doc") > + "page-Makefile.ri") > + (find-files (string-append vendor-dir "/extensions") > + "gem_make.out") > + (find-files (string-append vendor-dir "/ext") > + "Makefile"))))) > + > + #t)) I was confused whether the #t was the "else" clause for the "if" expression until I realized it didn't have one. Could you turn this into a (when (file-exists? ...) (for-each ...)) while at it? It also makes the (begin ...) redundant. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAltKgwoACgkQoqBt8qM6 VPokiQf/RtAYhOZJ9lOGLVoUzC8d9qh0NcGX440pJ7ao3+u3Dw8Kq06nUu0Q/Vqf 1RUCoFN2kQz8Ckq/v5Yzu2fTYqcEoRsIvHOuty3Iktywtv4cDzpXkn6VvbhVEykl IrB8c9Xdp+jPnTN1diRuERb7aMLTp00KxCM0DKVywCPCnIe0cKorVHe6HTvcU9Ab ALCTsxyuKZOy3RsiMmLucuu/92e3uwi8Gi1CrAsQZkNf5LWFVyfsJw+WImNG+0jZ iCBixs2W8Cq4txug/MfbENE18o8MvTFG/QMzk2fglregncNPyz4Hj6oOr8pTVgCo LXvENdfuWltxwL2GRdWnePKcPm8TEg== =5PzX -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 14 19:18:10 2018 Received: (at 32153) by debbugs.gnu.org; 14 Jul 2018 23:18:10 +0000 Received: from localhost ([127.0.0.1]:60344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feTnl-0001re-Pk for submit@debbugs.gnu.org; Sat, 14 Jul 2018 19:18:09 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feTnk-0001rX-Ki for 32153@debbugs.gnu.org; Sat, 14 Jul 2018 19:18:08 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 660B320F02; Sat, 14 Jul 2018 19:18:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 14 Jul 2018 19:18:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=w9Ul15GjuSAI7pOlUFtZQNUSv2McVso45I+ngutRJtA=; b=QB61T29u YVFVxmzLA6TrEVqvQx6jlUGp7FHGfeEsxsr9Fxqhx0Ij/9gumbOAA+60zqo0Tozq 6hpzzPFCTx2CRNnHOM3ucH6F+9Do9/bKUG83uWVNct4z28m1oFZ/twnr8BsrSgi9 N5v6FD7EpuvhVr1uYQZT7nXAWCbS9zMXN90/wV5CzNV4yy2hTRVoWaI+6OHOhd98 fJKuHAIN+6kWjTw96CULbP/fwAPy441Ali+/wjMYfhJvPuj/G3wFxkrfONSVw3e8 MqbN1glmwwNzELw/5VCUvUwvAo5uz7ygWVDHEeJ2SdAIllZh/A7T+o4u/hS9f9qW /4ODW33sf8nzbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=w9Ul15GjuSAI7pOlUFtZQNUSv2McV so45I+ngutRJtA=; b=sqVwAKYJND7pAEQeReZ/H4/B6d6ar37GK+mm5QUSaL6Za QqNUYGDJBYAiO4oCETSkr2zOEH/rNVV+U94431QabM+jyhnb2zRRlDdDUXAeEEiF QxTA2cau71zoQOs/ieYUpaUwOU3Q5AFQSfcRPcqrWWZORQdgTQzX5MfYq0W8Vbj2 eZ53NIVLiXWWDecOgCh80fSUxAvRMYqN6EgO9UyNHENkxKjkurkatumiZZGH6h0/ My16REeiNU9RtjAuUVRjOP8K8lN63ICVcLtuiTqpY1zSPCvAoef8Z/vm6MiXwsFU VpgBmxstC/ZwzFSkKVfk5kzwY8HXURW9Ep4PwOlpg== X-ME-Proxy: X-ME-Sender: Received: from localhost (95.92-221-151.customer.lyse.net [92.221.151.95]) by mail.messagingengine.com (Postfix) with ESMTPA id D145410266; Sat, 14 Jul 2018 19:18:07 -0400 (EDT) From: Marius Bakke To: Christopher Baines , 32153@debbugs.gnu.org Subject: Re: [bug#32153] [PATCH 0/2]: ruby-build-system: Error or return #t from all phases. In-Reply-To: <87wotydqm0.fsf@cbaines.net> References: <87wotydqm0.fsf@cbaines.net> User-Agent: Notmuch/0.27 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Sun, 15 Jul 2018 01:18:06 +0200 Message-ID: <87va9h5rv5.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32153 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 (-) --=-=-= Content-Type: text/plain Christopher Baines writes: > I'm trying to continue along with the Rails packaging (#30689), but I > noticed that currently if the tests fail for packages using the ruby > build system, then the package build doesn't fail. > > These patches should get most of the packages using the ruby build > system to raise exceptions when there are errors, and return #t > otherwise. > > I'm hopeful that this can be merged directly in to master, I build 180 > packages in not that much time at all to test this change [1]. > > 1: ./pre-inst-env guix package -s ruby- | recsel -P name | xargs ./pre-inst-env guix build Thank you for fixing it! Since this only affects gems, not ruby itself (which has ~900 dependencies), I think it can go on 'master' too[1]. [1] guix refresh -l $(guix package -s ^ruby- | recsel -P name) By the way, Ruby 2.5 is out. Are you willing to try upgrading it for 'staging'? :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAltKhK4ACgkQoqBt8qM6 VPrBXQf+P/N02WeLj4b8liWVvdHYNGOkjiD2rLF/rvbOALUHUM35jowDCkr8AeJs SEupTbM2sYuaoUQ1R7yayyv0EkzMFQ0Tza+qODVzQoiPK8r3haD6fiOHA4vw89eD bdyNle5RV0ZaYlDLB/EyQ1vuQaaTjTMhMtn7GMWn/BSqyPByL4oCe1nNbrXoiLVU 1hpuTMtTABseC6THI9JinNGWcVXkrkujYCvi//fr2TBlmD8kzvrNE66HZ19iTOwd P0CleT4zsJuzXVmrDB8NYQMN0rvvRE+HSnX84Cg7pzHJjpn//q5B1/cqxQq79FKk NpnpcCHXAaOLp1k80mK1PRzQ3UJY8Q== =PQVI -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 15 04:23:37 2018 Received: (at 32153) by debbugs.gnu.org; 15 Jul 2018 08:23:37 +0000 Received: from localhost ([127.0.0.1]:60472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fecJd-00013S-DD for submit@debbugs.gnu.org; Sun, 15 Jul 2018 04:23:37 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:53026 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fecJa-00013H-U0 for 32153@debbugs.gnu.org; Sun, 15 Jul 2018 04:23:35 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 41A16165E1; Sun, 15 Jul 2018 09:23:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 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 C16E9164C7; Sun, 15 Jul 2018 09:23:33 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 843e1732; Sun, 15 Jul 2018 08:23:33 +0000 (UTC) References: <87wotydqm0.fsf@cbaines.net> <87va9h5rv5.fsf@fastmail.com> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: Marius Bakke Subject: Re: [bug#32153] [PATCH 0/2]: ruby-build-system: Error or return #t from all phases. In-reply-to: <87va9h5rv5.fsf@fastmail.com> Date: Sun, 15 Jul 2018 09:23:29 +0100 Message-ID: <87va9gewla.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32153 Cc: 32153@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 Marius Bakke writes: > Christopher Baines writes: > >> I'm trying to continue along with the Rails packaging (#30689), but I >> noticed that currently if the tests fail for packages using the ruby >> build system, then the package build doesn't fail. >> >> These patches should get most of the packages using the ruby build >> system to raise exceptions when there are errors, and return #t >> otherwise. >> >> I'm hopeful that this can be merged directly in to master, I build 180 >> packages in not that much time at all to test this change [1]. >> >> 1: ./pre-inst-env guix package -s ruby- | recsel -P name | xargs ./pre-inst-env guix build > > Thank you for fixing it! Since this only affects gems, not ruby itself > (which has ~900 dependencies), I think it can go on 'master' too[1]. > > [1] guix refresh -l $(guix package -s ^ruby- | recsel -P name) Great :) > By the way, Ruby 2.5 is out. Are you willing to try upgrading it for > 'staging'? :-) Sure :) I'll take a look. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAltLBIFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xdc2RAAs4S14gS9/yb8Uhis1CdFlKDe3dz1i9SY8hTlCpRbm6vTplpPT/Jvrs33 K290UJsjjpolscJOWrw19jGRiqOlr7Zaf8KTyvJNnMbJdBO9ZSjuydP89XtyA/V3 V5ywPp44gdjzMfBgdx3aqBc71asrlfH/qAfAcmhWtK2lbXm3Y3s8lZEnYdtu3Mu1 aroKDXBnOXrUtcb6B4h34g708hjvPnx7AG5KGEInfIOAR/QsWAc0XddA/XOgBSpS f1mrigI76KL0gaOF1epaEtLBzTRsaqmun4AGj4ZuF9wGuoUx7jgaHjUAPijK15m3 Cqgeb+j5IjG4JByLxZScizv2v46X4ivqzPcC3SxY1ffIv7EgR3EkZdzB4OCHDYOO OD2Eyt8ucO09FbyIhEfk5C2ADA4jC2jKvVREySqvDDePjPYFNmM//6vn7bZKSllM 2NQa6H/+Uu64muBbXL6mnQ6NDg1xlOLFBqrNIo+2CYM63nt6G2udtt0IYlurvqyo TidQ4+kG9oNp3JBqOcMsQ3EqjmHZo14+fjp2huqQ3l79kToULX7wrZNCUVJtQaOI 8d8Tzzp8OpOJ7BBiS/nOLMHdBejIcL7kpOJbvTEXv920VLcFItzsKfgP4PC2d87v onXJC/76EhUE0J3ZfFAb14H+17DSNoeR6sT6zO9cG+MrkrAnA1M= =k6mN -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 15 17:27:15 2018 Received: (at 32153-done) by debbugs.gnu.org; 15 Jul 2018 21:27:15 +0000 Received: from localhost ([127.0.0.1]:42092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feoXx-0001rW-Cx for submit@debbugs.gnu.org; Sun, 15 Jul 2018 17:27:13 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:53308 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feoXu-0001rN-Nx for 32153-done@debbugs.gnu.org; Sun, 15 Jul 2018 17:27:11 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 9F3E7165F1; Sun, 15 Jul 2018 22:27:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 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 3992F165EC; Sun, 15 Jul 2018 22:27:09 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id dbe61b27; Sun, 15 Jul 2018 21:27:08 +0000 (UTC) References: <87wotydqm0.fsf@cbaines.net> <20180714111022.12609-1-mail@cbaines.net> <87y3ed5s6t.fsf@fastmail.com> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: Marius Bakke Subject: Re: [bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all phases. In-reply-to: <87y3ed5s6t.fsf@fastmail.com> Date: Sun, 15 Jul 2018 22:27:03 +0100 Message-ID: <87tvp0dwbc.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32153-done Cc: 32153-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 (-) --=-=-= Content-Type: text/plain Marius Bakke writes: > Christopher Baines writes: > >> Previously, if the tests didn't pass, the check phase would evaluate to #f, >> but the package would be built sucessfully. This changes all the phases to >> raise exceptions if errors are encountered, and return #t otherwise. >> >> This involves using invoke rather than system*, so that exceptions are raised >> if the program exits with a status other than 0, and also returning #t at the >> end of functions. >> >> * gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*, >> and return #t at the end. >> (build, check): Use invoke rather than system*. >> (install): Remove the use of "and", and rewrite the error handling to raise an >> exception. >> (wrap): Return #t. > > Thanks! The changes LGTM. I will suggest a micro-improvement not > related to this patch since it was there from before: > >> + ;; 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. >> + (if (file-exists? (string-append vendor-dir "/ext")) >> + (begin >> + (for-each (lambda (file) >> + (log-file-deletion file) >> + (delete-file file)) >> + (append >> + (find-files (string-append vendor-dir "/doc") >> + "page-Makefile.ri") >> + (find-files (string-append vendor-dir "/extensions") >> + "gem_make.out") >> + (find-files (string-append vendor-dir "/ext") >> + "Makefile"))))) >> + >> + #t)) > > I was confused whether the #t was the "else" clause for the "if" > expression until I realized it didn't have one. > > Could you turn this into a (when (file-exists? ...) (for-each ...)) > while at it? It also makes the (begin ...) redundant. I've made this change, and pushed the patches to master, thanks again for taking a look :) Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAltLvCdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfrBw/+PgYrXmDY7eYy0ndfHTqEk1McFX0CbdzH2db/LymQ3sglMcOGHg6seQKE zKs6Cd3ePKPV5pivPMTtiOAHlnBBgspbeC+tJShnKH/Wy8p82KhdO0G+7sx+Z63R /+njiHe6iGd+bB3W9iKSmF82e3yCuZZW7Kmr4Bcb5YtB/TEL0Rkg5NuT0YaAGTnC BIiybF/GovXe2OurGEXWmKEzKVFGhP90UHq+rs/0YgyyBr4g2yb0ObIxQPcUjXe0 7PDSRI0qXS2YBXQxtLkJnYiM3/L0UN4j7FySIiA8375DdLsvRth82lneRSSh5rJj H5JQUuC71+KHs10bfwXhkiVfvqbqcqUATkLGrz38g2DRXpYm302C+blIiXUKHLE4 fNr36nrSH5i2SPKNAlYozPOvl75uGt7EjxK9fdYNsQSyNUf5R7KBAHBm6Wd+CoMD ikUCNwCswAZ7adB720ZdpLgoc7KTvLT6+DjuEaw8ABTggYSn2WK7h4jcK1giSAFw m5YCKuPDv0rlN15GPUyciJcqOQmZa/Dkh9EmnrpQHWDk9W5OcU0S44ECINMso/W7 hZvf2GPLuSkyliP3hdpp+7G4CeEwSg3iPHmqrzir/cStwi9ASsCzlwG1rDKUymoe 3G19VHkkwmovmS7Gfmk9vsbHRfA1lHwyrokvJ4CEyF3aIOkskeQ= =V+Ss -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Jun 14 19:18:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Aug 2018 11:24:05 +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