From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feThu-0002F9-4m for guix-patches@gnu.org; Sat, 14 Jul 2018 19:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feThq-0005Fl-UU for guix-patches@gnu.org; Sat, 14 Jul 2018 19:12:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52441) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1feThq-0005FX-LK for guix-patches@gnu.org; Sat, 14 Jul 2018 19:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1feThq-0001ia-Gd for guix-patches@gnu.org; Sat, 14 Jul 2018 19:12:02 -0400 Subject: [bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all phases. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20180714111022.12609-1-mail@cbaines.net> References: <87wotydqm0.fsf@cbaines.net> <20180714111022.12609-1-mail@cbaines.net> 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" 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: Christopher Baines , 32153@debbugs.gnu.org --=-=-= 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----- --=-=-=--