From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Regarding "Use Invoke" or "Return a boolean from phase" commits Date: Mon, 04 Jun 2018 13:29:24 +0200 Message-ID: <87k1ressbv.fsf@gnu.org> References: <87bmcvfy92.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]:38776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPng1-0006SR-P3 for guix-devel@gnu.org; Mon, 04 Jun 2018 07:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPnfy-0004qi-Mc for guix-devel@gnu.org; Mon, 04 Jun 2018 07:29:29 -0400 In-Reply-To: <87bmcvfy92.fsf@netris.org> (Mark H. Weaver's message of "Thu, 31 May 2018 14:58:33 -0400") 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 Hello Mark, Mark H Weaver skribis: > Furthermore, it will be important for a static code analyzer to be able > to infer that phases and snippets always return #t, so let's try not to > be too clever about it. We'll need a static analyzer to gain confidence > that we can start ignoring the return values without losing failure > reports. > > Quite a while ago, I hacked up a preliminary static analyzer to do this. > Obviously it would be good to integrate something like this into our > linter, but I haven't gotten around to it yet. In the meantime, I've > attached my preliminary code below. Here's how it's used: Nice! It=E2=80=99ll greatly help gain confidence that the code is correct = when we decide to switch. IIUC it only works for =E2=80=98gnu-build-system=E2= =80=99, right? If the analyzer doesn=E2=80=99t cover 100% of the packages, we=E2=80=99ll r= ely on manual testing as we rebuild everything anyway=E2=80=94pretty much like when we do= a regular =E2=80=98core-updates=E2=80=99 cycle. It=E2=80=99s possible but unlikely that packages that include a phase retur= ning #false would succeed if we ignore that return value, so hopefully we=E2=80= =99ll catch residual issues when we build things. Thoughts? Ludo=E2=80=99.