From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Making substitute* throw an error if substition failed? Date: Sat, 15 Oct 2016 20:07:54 +0300 Message-ID: <871szhwnf9.fsf@gmail.com> References: <87twceh9h7.fsf@elephly.net> 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]:47748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvSRG-00017F-TA for guix-devel@gnu.org; Sat, 15 Oct 2016 13:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvSRA-0003ZJ-QD for guix-devel@gnu.org; Sat, 15 Oct 2016 13:08:01 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:33882) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvSRA-0003Yb-Fu for guix-devel@gnu.org; Sat, 15 Oct 2016 13:07:56 -0400 Received: by mail-lf0-x22a.google.com with SMTP id b81so216529825lfe.1 for ; Sat, 15 Oct 2016 10:07:56 -0700 (PDT) In-Reply-To: <87twceh9h7.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 15 Oct 2016 00:05:56 +0200") 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: Ricardo Wurmus Cc: guix-devel Ricardo Wurmus (2016-10-15 00:05 +0200) wrote: > Hi Guix, > > it happened a couple of times already that a =E2=80=9Csubstitute*=E2=80= =9D expression > silently failed and I only found out about it when investigating the > remains of a failing build (=E2=80=9Cguix build -K=E2=80=9D). This can e= asily happen > when a package is updated and substitutions =E2=80=9Canchors=E2=80=9D no = longer exist in > the updated source code. > > Would it be desirable to change =E2=80=9Csubstitute*=E2=80=9D (or replace= it) such that > it throws an error or returns a value if substitution failed? This > might be helpful for the more complex packages with many substitutions. > If we make it return a value (#f for error) it would also make our build > phases a little prettier, I think. (Now we forcefully return #t in any > case and that seems wrong.) This was also discussed a bit around here: . As I mentioned in that message, I'm for returning #t/#f for succeeded/failed substitution. --=20 Alex