From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Package input loop detection Date: Wed, 14 Feb 2018 14:03:43 +0100 Message-ID: <87po57u3io.fsf@gnu.org> References: <87eflzfkwh.fsf@cbaines.net> <87fu66kyxn.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]:35906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elwj2-00082N-Pg for guix-devel@gnu.org; Wed, 14 Feb 2018 08:03:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elwix-0003sT-2M for guix-devel@gnu.org; Wed, 14 Feb 2018 08:03:52 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:55350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elwiw-0003sA-Qt for guix-devel@gnu.org; Wed, 14 Feb 2018 08:03:46 -0500 In-Reply-To: <87fu66kyxn.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 12 Feb 2018 16:30:44 +0100") 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@gnu.org Hello! Ricardo Wurmus skribis: >> I've had this issue for a while now, while adding some packages, I'll >> create a loop in the package graph, which causes Guix to just loop >> infinitely when trying to generate derivations. > > this is a great initiative. I=E2=80=99ve been having this issue in the p= ast as > well, and I=E2=80=99d really like Guix to be a little smarter about it. +1 >> I'm not particularly fond of the implementation, because the >> package-derivation function is called from expand-input called from >> bag->derivation, the information about the part of the graph that has >> been traversed is passed through each function. >> >> The seen-package-list argument could be removed, but the ordering >> information is really useful when printing out the error message. I >> think it should be still possible to generate this after finding the >> issue by searching through the graph of packages, which would allow >> removing this one argument. >> >> One other thought I had is that this could be extracted to something in >> guix lint, which would at least allow finding these problems, without >> touching the core derivation related code. > > I=E2=80=99d be in favour of keeping it out of the core and stash it away = in a > separate tool. Not sure if that should be =E2=80=9Cguix lint=E2=80=9D (w= hat about =E2=80=9Cguix > graph=E2=80=9D?), but I would prefer that over having the code run all th= e time. I=E2=80=99d be in favor of keeping it in the core, like Chris did, provided= the code is not too complex and provided there=E2=80=99s no significant perform= ance penalty. That way, problems would always be gracefully handled. I=E2=80=99ll take a look at Chris=E2=80=99 code soonish. Thanks! Ludo=E2=80=99.