From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Why should build phases not return unspecified values? Date: Wed, 20 Dec 2017 10:27:16 +0100 Message-ID: <87609121hn.fsf@gnu.org> References: <8737462yft.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRaep-0006u2-Ip for guix-devel@gnu.org; Wed, 20 Dec 2017 04:27:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRaem-0003te-2y for guix-devel@gnu.org; Wed, 20 Dec 2017 04:27:23 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:55340) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRael-0003sP-RD for guix-devel@gnu.org; Wed, 20 Dec 2017 04:27:19 -0500 In-Reply-To: <8737462yft.fsf@netris.org> (Mark H. Weaver's message of "Tue, 19 Dec 2017 16:35:34 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org, 29745@debbugs.gnu.org Howdy, Mark H Weaver skribis: > I don't think we should rely on every "unspecified value" being treated > as #true in future versions of Guile. That is merely an accident of the > current implementation. > > However, I also agree that the current situation is a mess in need of > cleaning up. > > My preference would be to deprecate the practice of returning explicit > boolean results from phases and snippets, and transition to reporting > errors exclusively using exceptions. Yes, that sounds more in line with what we usually do. > We would create a variant of the 'system*' procedure that raises an > exception in case of a non-zero status code. Indeed. Like Danny wrote, we can already start migrating to =E2=80=98invok= e=E2=80=99, which does exactly that. > Here's a transition plan: We could start by making the new > exception-throwing 'system*' variant, and switching existing packages to > use it, while removing the related error-code plumbing. Once that work > is done, we could change the code that calls snippets or phase > procedures to ignore the result of those calls. Finally, we could > remove the trailing #t's. > > What do you think? That sounds good to me! Concretely, we can: 1. Encourage use of =E2=80=98invoke=E2=80=99 when reviewing or writing ne= w package definitions; 2. Gradually migrate packages (we can do a bit of that in =E2=80=98core-updates=E2=80=99, though we won=E2=80=99t do full rebuil= ds at this stage). How does that sound? Thanks, Ludo=E2=80=99. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRafW-00076R-7a for guix-patches@gnu.org; Wed, 20 Dec 2017 04:28:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRafS-0004Rd-Ps for guix-patches@gnu.org; Wed, 20 Dec 2017 04:28:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:34449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRafS-0004RF-MF for guix-patches@gnu.org; Wed, 20 Dec 2017 04:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eRafS-0005bb-9a for guix-patches@gnu.org; Wed, 20 Dec 2017 04:28:02 -0500 Subject: [bug#29745] Why should build phases not return unspecified values? Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <8737462yft.fsf@netris.org> Date: Wed, 20 Dec 2017 10:27:16 +0100 In-Reply-To: <8737462yft.fsf@netris.org> (Mark H. Weaver's message of "Tue, 19 Dec 2017 16:35:34 -0500") Message-ID: <87609121hn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Mark H Weaver Cc: guix-devel@gnu.org, 29745@debbugs.gnu.org Howdy, Mark H Weaver skribis: > I don't think we should rely on every "unspecified value" being treated > as #true in future versions of Guile. That is merely an accident of the > current implementation. > > However, I also agree that the current situation is a mess in need of > cleaning up. > > My preference would be to deprecate the practice of returning explicit > boolean results from phases and snippets, and transition to reporting > errors exclusively using exceptions. Yes, that sounds more in line with what we usually do. > We would create a variant of the 'system*' procedure that raises an > exception in case of a non-zero status code. Indeed. Like Danny wrote, we can already start migrating to =E2=80=98invok= e=E2=80=99, which does exactly that. > Here's a transition plan: We could start by making the new > exception-throwing 'system*' variant, and switching existing packages to > use it, while removing the related error-code plumbing. Once that work > is done, we could change the code that calls snippets or phase > procedures to ignore the result of those calls. Finally, we could > remove the trailing #t's. > > What do you think? That sounds good to me! Concretely, we can: 1. Encourage use of =E2=80=98invoke=E2=80=99 when reviewing or writing ne= w package definitions; 2. Gradually migrate packages (we can do a bit of that in =E2=80=98core-updates=E2=80=99, though we won=E2=80=99t do full rebuil= ds at this stage). How does that sound? Thanks, Ludo=E2=80=99.