From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Subject: bug#32661: modify-phases: detect invalid phase addition Date: Mon, 10 Sep 2018 10:38:39 +0200 Message-ID: References: <877ejxm0z9.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006022340575804928" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzHq4-00016x-SL for bug-guix@gnu.org; Mon, 10 Sep 2018 04:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzHip-0006lI-5W for bug-guix@gnu.org; Mon, 10 Sep 2018 04:39:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzHio-0006kk-CA for bug-guix@gnu.org; Mon, 10 Sep 2018 04:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzHio-0006BG-3W for bug-guix@gnu.org; Mon, 10 Sep 2018 04:39:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877ejxm0z9.fsf@elephly.net> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ricardo Wurmus Cc: 32661@debbugs.gnu.org --0000000000006022340575804928 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ricardo Wurmus ezt =C3=ADrta (id=C5=91pont: 2018. szep= t. 7., P 23:51): > It is possible to add a build phase to a non-existing phase without an > error. The new build phase will simply not be executed. > > This is problematic when an inherited package augments the original > package=E2=80=99s phases and the original package is changed. Imagine th= at the > parent package=E2=80=99s =E2=80=9Cpre-configure=E2=80=9D phase is removed= : > > ((#:phases original-phases) > `(modify-phases ,original-phases > (add-after 'pre-configure 'patch-this > (lambda _ =E2=80=A6)))) > > This would cause the =E2=80=9Cpatch-this=E2=80=9D phase in the child pack= age to be > skipped without warning. > > This kind of thing can be especially confusing in the bootstrap, which > makes heavy use of inheritance. > It would be nice to fix this. Also I have noticed that it is easier to make mistakes when inheritance is involved, but these tend to only break derived packages. I am not aware of a facility to make it easier to build all derived packages. Am I missing something? I guess this would be a useful tool, but not sure about implementation. > > -- > Ricardo > > > > > --0000000000006022340575804928 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


= Ricardo Wurmus <rekado@elephly.net= > ezt =C3=ADrta (id=C5=91pont: 2018. szept. 7., P 23:51):
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">It is possible to add a build phase to a non-= existing phase without an
error.=C2=A0 The new build phase will simply not be executed.

This is problematic when an inherited package augments the original
package=E2=80=99s phases and the original package is changed.=C2=A0 Imagine= that the
parent package=E2=80=99s =E2=80=9Cpre-configure=E2=80=9D phase is removed:<= br>
((#:phases original-phases)
`(modify-phases ,original-phases
=C2=A0 (add-after 'pre-configure 'patch-this
=C2=A0 =C2=A0 (lambda _ =E2=80=A6))))

This would cause the =E2=80=9Cpatch-this=E2=80=9D phase in the child packag= e to be
skipped without warning.

This kind of thing can be especially confusing in the bootstrap, which
makes heavy use of inheritance.
It would be nice to fix this. Also I have noticed that it is easier to m= ake mistakes when inheritance is involved, but these tend to only break der= ived packages. I am not aware of a facility to make it easier to build all = derived packages. Am I missing something? I guess this would be a useful to= ol, but not sure about implementation.

--
Ricardo




--0000000000006022340575804928--