GNU bug report logs - #49827
Error message for missing synopsis in opam importer

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Alice BRENON <alice.brenon@HIDDEN>; dated Mon, 2 Aug 2021 15:45:03 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 49827 <at> debbugs.gnu.org:


Received: (at 49827) by debbugs.gnu.org; 19 Aug 2021 14:58:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 19 10:58:14 2021
Received: from localhost ([127.0.0.1]:60618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mGjUk-0002w8-Ex
	for submit <at> debbugs.gnu.org; Thu, 19 Aug 2021 10:58:14 -0400
Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:55664)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alice.brenon@HIDDEN>) id 1mGjUi-0002vz-U7
 for 49827 <at> debbugs.gnu.org; Thu, 19 Aug 2021 10:58:13 -0400
Received: from localhost (localhost [127.0.0.1])
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id 8E2D2E310D;
 Thu, 19 Aug 2021 16:58:11 +0200 (CEST)
X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr
Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1])
 by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id kLjaOhmIf7x8; Thu, 19 Aug 2021 16:58:11 +0200 (CEST)
Received: from localhost (unknown [78.194.167.103])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (Client did not present a certificate)
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 4E2DCE3095;
 Thu, 19 Aug 2021 16:58:11 +0200 (CEST)
Date: Thu, 19 Aug 2021 16:58:10 +0200
From: Alice BRENON <alice.brenon@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: bug#49827: Error message for missing synopsis in opam importer
Message-ID: <20210819165810.67094d1b@HIDDEN>
In-Reply-To: <868s10pldd.fsf@HIDDEN>
References: <20210802170115.696ac103@HIDDEN> <86r1fb4pez.fsf@HIDDEN>
 <20210811151520.61c85eaa@HIDDEN> <868s10pldd.fsf@HIDDEN>
Organization: ENS de Lyon
X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.24; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49827
Cc: Sarah Morgensen <iskarian@HIDDEN>, 49827 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

Thanks for your answer !

Le Tue, 17 Aug 2021 09:43:10 +0200,
zimoun <zimon.toutoune@HIDDEN> a =C3=A9crit :

> Hi,
>=20
> I am back from holidays. :-)
>=20
> =E2=80=A6  =20
>=20
> From my understanding, there is 2 issues: =20
>=20
>  - gentle handler for error
>  - warn for incomplete metadata
>=20

Yes, absolutely, because currently understanding the cause of the error
requires to delve into the source to understand what is going on. The
warning part is more optional, but if this pattern matching is modified
to handle that special case of a missing metadata instead of entirely
crashing, I thought it could be useful not to be too permissive either,
and to at least mention that a missing metadata was caught and should
be filled by hand.

This could take the form of a message above the output of the actual
scheme code for the package declaration while the importer is running,
or of an invalid value for that missing field in the generated scheme
output, something like "<FILL-ME>" or such that would be invalid in
scheme and would make guix build fail when trying to use the output
directly without manually editing it to fill the missing metadata.

> With J=C3=A9r=C3=A9my (jeko), we have started to work time to time using
> experimental pair-programming to fix the former.  Currently, each
> importer uses its own error mechanism and obviously incoherence
> between them happens; especially when =E2=80=99--recursive=E2=80=99.  We =
are trying
> to unify that.
>=20
> Thanks for the report of this use case. :-)

Glad to learn my report could help : )

>=20
>=20
> Cheers,
> simon





Information forwarded to bug-guix@HIDDEN:
bug#49827; Package guix. Full text available.

Message received at 49827 <at> debbugs.gnu.org:


Received: (at 49827) by debbugs.gnu.org; 17 Aug 2021 07:46:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 17 03:46:48 2021
Received: from localhost ([127.0.0.1]:51586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mFto4-0006Hi-2B
	for submit <at> debbugs.gnu.org; Tue, 17 Aug 2021 03:46:48 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:45984)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mFtny-0006HR-EZ
 for 49827 <at> debbugs.gnu.org; Tue, 17 Aug 2021 03:46:42 -0400
Received: by mail-wr1-f43.google.com with SMTP id v4so20050045wro.12
 for <49827 <at> debbugs.gnu.org>; Tue, 17 Aug 2021 00:46:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=6xT043pVTdJQunNKnLXoW+Gs/YGKATvQd2dIe2aYbFo=;
 b=MedEW2As2wajRXDJMmaBfLOcv7F+phuHlzZd7VhsA5t3d98g4RFay+s7MShe2mCth3
 ns6CQYRi/UDnoolQ537rX8Z4dOoKNnfyYXwv4tJ968qWEWmTev6zXlrNTMTB2/PX33Uw
 5NNbLXjqVKvfCcYQLnesRbFfYPsLN6WG1hBjhc8gHZtD6PYZS7VBQ09UsRlsuXMa/Yid
 ncY5lTwmAaSMgqx0oApEmdclGILri9xQZfyCKwFQKS/WUfGYy81Zo4aibHGNYPMDXT9k
 LzCf3MEDCiRNrQZjQKi8v5gfsDkZxduDcXu9kgOLd2kxTfp5AIpA0PUm14xzTSmmYGrb
 tKoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=6xT043pVTdJQunNKnLXoW+Gs/YGKATvQd2dIe2aYbFo=;
 b=pDAVhIKayxGkamcvSGIusxSPa/PVtLeTgmcHd7Lhx887PAOkD8JwaJsA7yYqLSZ+jB
 yirJli2Vn5xVd5aHLk2h3mrNsaZI8IBLqr8/y0kjE/agJAI6Ru/BZzn28zSdXYVtd5vV
 ohofp2RmMjBWu0bO4YXdRz3CxH2YpCAKu5J03RVrxGgvZKfp45U5a7AuPtBZ3m/d6wxN
 3Lis10W9qXafQt+xSmQLEFg6qF0rRd5z+RUl0XCG9HG2/N2UT0KEmBw9BtjIpaPLHyzo
 ltgxznV/Y9b7L4vTFx1NBs8xjwkMvUnpcsoupTg6L1JOQw9uz1Gr+uJZAFBgiDLcZyyy
 J7Sw==
X-Gm-Message-State: AOAM531ve/w+yii/wnz96KnMluxZYUU5cQt/zYj6zJoIxyY2kJKMTetp
 hGhvsjNlVzPTRCzaEPCZIZyD98NpsA/nnw==
X-Google-Smtp-Source: ABdhPJzLX9FrcVbd4BeSh1m3ASD+9OJ80R/zP7nNr9usf09oVQ7YZpzdfJN4gZmHaxbTKCidiEY/yQ==
X-Received: by 2002:a5d:4b49:: with SMTP id w9mr2370871wrs.242.1629186392460; 
 Tue, 17 Aug 2021 00:46:32 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id p3sm1456792wrr.21.2021.08.17.00.46.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 17 Aug 2021 00:46:32 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Alice BRENON <alice.brenon@HIDDEN>, Sarah Morgensen
 <iskarian@HIDDEN>
Subject: Re: bug#49827: Error message for missing synopsis in opam importer
In-Reply-To: <20210811151520.61c85eaa@HIDDEN>
References: <20210802170115.696ac103@HIDDEN> <86r1fb4pez.fsf@HIDDEN>
 <20210811151520.61c85eaa@HIDDEN>
Date: Tue, 17 Aug 2021 09:43:10 +0200
Message-ID: <868s10pldd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49827
Cc: 49827 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

I am back from holidays. :-)

On Wed, 11 Aug 2021 at 15:15, Alice BRENON <alice.brenon@HIDDEN> wrote:

> Thanks for your answer Sarah. Simon, I don't know if you have been able
> to make any progress but I wanted to make sure you had seen the patch
> proposal I sent to let the opam importer work from more repositories
> than the few initially defined (opam's official and three for coq):
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D49958

I have seen but not read in details.  I will do.

>> > The package iter is missing a "synopsis" field as can be seen on
>> > https://opam.ocaml.org/packages/iter/ , which when I tried
>> >
>> > guix import opam iter
>> >
>> > yielded the following backtrace:
>> >
>> > Backtrace:
>> >            8 (primitive-load
>> > "/home/alice/.config/guix/current/bin/g=E2=80=A6") In guix/ui.scm:
>> >    2185:7  7 (run-guix . _)
>> >   2148:10  6 (run-guix-command _ . _)
>> > In guix/scripts/import.scm:
>> >    120:11  5 (guix-import . _)
>> > In guix/scripts/import/opam.scm:
>> >    104:23  4 (guix-import-opam . _)
>> > In guix/utils.scm:
>> >     752:8  3 (call-with-temporary-output-file _)
>> > In guix/import/opam.scm:
>> >    337:34  2 (_ _ _)
>> > In srfi/srfi-1.scm:
>> >    460:18  1 (fold #<procedure 7f3baca56fe0 at
>> > guix/import/opam.scm=E2=80=A6> =E2=80=A6) In guix/import/opam.scm:
>> >    193:15  0 (_ _ _)
>> >
>> > guix/import/opam.scm:193:15: Throw to key `match-error' with args
>> > `("match" "no matching pattern" string-pat)'.
>> >
>> >
>> > the final error is raised l.193 of guix/import/opam.scm because
>> > metadata-ref supports various types for a metadata field, but not
>> > the lack of it. As discussed with Maxime Devos on the IRC channel,
>> > it would be helpful to either allow the import of a package with a
>> > missing field (possibly filling it in the output scheme code for
>> > the imported package with some bad value requiring the user to fill
>> > it and causing any build to crash until replaced properly) or at
>> > least to handle that missing field with a more explicit error
>> > message than the above backtrace (something like "Can't import that
>> > package because it's missing such or such field").=20=20

From my understanding, there is 2 issues:

 - gentle handler for error
 - warn for incomplete metadata

With J=C3=A9r=C3=A9my (jeko), we have started to work time to time using
experimental pair-programming to fix the former.  Currently, each
importer uses its own error mechanism and obviously incoherence between
them happens; especially when =E2=80=99--recursive=E2=80=99.  We are trying=
 to unify
that.

Thanks for the report of this use case. :-)


Cheers,
simon




Information forwarded to bug-guix@HIDDEN:
bug#49827; Package guix. Full text available.

Message received at 49827 <at> debbugs.gnu.org:


Received: (at 49827) by debbugs.gnu.org; 11 Aug 2021 13:15:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 11 09:15:24 2021
Received: from localhost ([127.0.0.1]:33862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mDo4q-0002Tc-CB
	for submit <at> debbugs.gnu.org; Wed, 11 Aug 2021 09:15:24 -0400
Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:54420)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alice.brenon@HIDDEN>) id 1mDo4o-0002Qg-Kx
 for 49827 <at> debbugs.gnu.org; Wed, 11 Aug 2021 09:15:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id 5A2CFE2B83;
 Wed, 11 Aug 2021 15:15:21 +0200 (CEST)
X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr
Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1])
 by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id b8dgYwK4hntB; Wed, 11 Aug 2021 15:15:21 +0200 (CEST)
Received: from localhost (unknown [78.194.167.103])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (Client did not present a certificate)
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 240BBE08BC;
 Wed, 11 Aug 2021 15:15:21 +0200 (CEST)
Date: Wed, 11 Aug 2021 15:15:20 +0200
From: Alice BRENON <alice.brenon@HIDDEN>
To: Sarah Morgensen <iskarian@HIDDEN>
Subject: Re: bug#49827: Error message for missing synopsis in opam importer
Message-ID: <20210811151520.61c85eaa@HIDDEN>
In-Reply-To: <86r1fb4pez.fsf@HIDDEN>
References: <20210802170115.696ac103@HIDDEN>
	<86r1fb4pez.fsf@HIDDEN>
Organization: ENS de Lyon
X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.24; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49827
Cc: 49827 <at> debbugs.gnu.org, zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

Thanks for your answer Sarah. Simon, I don't know if you have been able
to make any progress but I wanted to make sure you had seen the patch
proposal I sent to let the opam importer work from more repositories
than the few initially defined (opam's official and three for coq):

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D49958

Though I had a local "bypass" on the metadata reader to be able to
perform the import I wanted and orginally designed my patch for, I paid
attention not to commit it to keep matters separated. Any insight on the
general form the improved error handling will take ? Please let me
know if I can update my #49958 patch to play along more nicely with
your rework.


Alice

Le Mon, 02 Aug 2021 12:28:20 -0700,
Sarah Morgensen <iskarian@HIDDEN> a =C3=A9crit :

> Hi,
>=20
> Thanks for the report. I'm CC'ing Simon since they have been working
> on improved error handling/reporting for the importers.
>=20
> Alice BRENON <alice.brenon@HIDDEN> writes:
>=20
> > Hello,
> >
> > I triggered a confusing behaviour from the opam importer trying to
> > import package iter 1.2.1 today on a Guix System install.
> >
> > The package iter is missing a "synopsis" field as can be seen on
> > https://opam.ocaml.org/packages/iter/ , which when I tried
> >
> > guix import opam iter
> >
> > yielded the following backtrace:
> >
> > Backtrace:
> >            8 (primitive-load
> > "/home/alice/.config/guix/current/bin/g=E2=80=A6") In guix/ui.scm:
> >    2185:7  7 (run-guix . _)
> >   2148:10  6 (run-guix-command _ . _)
> > In guix/scripts/import.scm:
> >    120:11  5 (guix-import . _)
> > In guix/scripts/import/opam.scm:
> >    104:23  4 (guix-import-opam . _)
> > In guix/utils.scm:
> >     752:8  3 (call-with-temporary-output-file _)
> > In guix/import/opam.scm:
> >    337:34  2 (_ _ _)
> > In srfi/srfi-1.scm:
> >    460:18  1 (fold #<procedure 7f3baca56fe0 at
> > guix/import/opam.scm=E2=80=A6> =E2=80=A6) In guix/import/opam.scm:
> >    193:15  0 (_ _ _)
> >
> > guix/import/opam.scm:193:15: Throw to key `match-error' with args
> > `("match" "no matching pattern" string-pat)'.
> >
> >
> > the final error is raised l.193 of guix/import/opam.scm because
> > metadata-ref supports various types for a metadata field, but not
> > the lack of it. As discussed with Maxime Devos on the IRC channel,
> > it would be helpful to either allow the import of a package with a
> > missing field (possibly filling it in the output scheme code for
> > the imported package with some bad value requiring the user to fill
> > it and causing any build to crash until replaced properly) or at
> > least to handle that missing field with a more explicit error
> > message than the above backtrace (something like "Can't import that
> > package because it's missing such or such field"). =20
>=20
> IMO, a warning should be emitted, but the package should be buildable
> if at all possible; it's the submitter's responsibility to vet
> imported packages.
>=20
> Simon, how's that error handling rework coming? ;)
>=20
> >
> > Thanks,
> >
> > Alice BRENON =20
>=20
> --
> Sarah





Information forwarded to bug-guix@HIDDEN:
bug#49827; Package guix. Full text available.

Message received at 49827 <at> debbugs.gnu.org:


Received: (at 49827) by debbugs.gnu.org; 2 Aug 2021 19:28:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 02 15:28:26 2021
Received: from localhost ([127.0.0.1]:39313 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mAdbu-0001zc-Hw
	for submit <at> debbugs.gnu.org; Mon, 02 Aug 2021 15:28:26 -0400
Received: from out0.migadu.com ([94.23.1.103]:18646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@HIDDEN>) id 1mAdbr-0001zP-Lp
 for 49827 <at> debbugs.gnu.org; Mon, 02 Aug 2021 15:28:24 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1627932502;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=8+0/MSivIf3lq4Cl8VMxxXGvmmWxU+ShfoDPp3xWWGc=;
 b=XjmRwkdMcKeNlgo1UgUCFG2iq/wSjI9XjNTuAuCeAwohHkxHuV6PLGCBbNadF3zTLQjh8f
 sRyPbrKgBxD5Dm33u0yXPZN0ndjOGRr7X4SizZLhDHUokp1Zsi90mdHI7+g8tqI1yrZWSl
 ybWuL7NCrnIxEM+uxZTgq4G5Wx1jHwY=
From: Sarah Morgensen <iskarian@HIDDEN>
To: Alice BRENON <alice.brenon@HIDDEN>
Subject: Re: bug#49827: Error message for missing synopsis in opam importer
References: <20210802170115.696ac103@HIDDEN>
Date: Mon, 02 Aug 2021 12:28:20 -0700
In-Reply-To: <20210802170115.696ac103@HIDDEN> (Alice BRENON's message of
 "Mon, 2 Aug 2021 17:01:15 +0200")
Message-ID: <86r1fb4pez.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49827
Cc: 49827 <at> debbugs.gnu.org, zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

Thanks for the report. I'm CC'ing Simon since they have been working on
improved error handling/reporting for the importers.

Alice BRENON <alice.brenon@HIDDEN> writes:

> Hello,
>
> I triggered a confusing behaviour from the opam importer trying to
> import package iter 1.2.1 today on a Guix System install.
>
> The package iter is missing a "synopsis" field as can be seen on
> https://opam.ocaml.org/packages/iter/ , which when I tried
>
> guix import opam iter
>
> yielded the following backtrace:
>
> Backtrace:
>            8 (primitive-load "/home/alice/.config/guix/current/bin/g=E2=
=80=A6")
> In guix/ui.scm:
>    2185:7  7 (run-guix . _)
>   2148:10  6 (run-guix-command _ . _)
> In guix/scripts/import.scm:
>    120:11  5 (guix-import . _)
> In guix/scripts/import/opam.scm:
>    104:23  4 (guix-import-opam . _)
> In guix/utils.scm:
>     752:8  3 (call-with-temporary-output-file _)
> In guix/import/opam.scm:
>    337:34  2 (_ _ _)
> In srfi/srfi-1.scm:
>    460:18  1 (fold #<procedure 7f3baca56fe0 at guix/import/opam.scm=E2=80=
=A6> =E2=80=A6)
> In guix/import/opam.scm:
>    193:15  0 (_ _ _)
>
> guix/import/opam.scm:193:15: Throw to key `match-error' with args
> `("match" "no matching pattern" string-pat)'.
>
>
> the final error is raised l.193 of guix/import/opam.scm because
> metadata-ref supports various types for a metadata field, but not the
> lack of it. As discussed with Maxime Devos on the IRC channel, it would
> be helpful to either allow the import of a package with a missing field
> (possibly filling it in the output scheme code for the imported package
> with some bad value requiring the user to fill it and causing any build
> to crash until replaced properly) or at least to handle that missing
> field with a more explicit error message than the above backtrace
> (something like "Can't import that package because it's missing such or
> such field").

IMO, a warning should be emitted, but the package should be buildable if
at all possible; it's the submitter's responsibility to vet imported
packages.

Simon, how's that error handling rework coming? ;)

>
> Thanks,
>
> Alice BRENON

--
Sarah




Information forwarded to bug-guix@HIDDEN:
bug#49827; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Aug 2021 15:44:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 02 11:44:52 2021
Received: from localhost ([127.0.0.1]:38994 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mAa7X-0004m8-8U
	for submit <at> debbugs.gnu.org; Mon, 02 Aug 2021 11:44:52 -0400
Received: from lists.gnu.org ([209.51.188.17]:60812)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alice.brenon@HIDDEN>) id 1mAZRU-0003ex-Hy
 for submit <at> debbugs.gnu.org; Mon, 02 Aug 2021 11:01:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58384)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <alice.brenon@HIDDEN>)
 id 1mAZRU-0005KU-9f
 for bug-guix@HIDDEN; Mon, 02 Aug 2021 11:01:24 -0400
Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:51840)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <alice.brenon@HIDDEN>) id 1mAZRR-0002h3-Sq
 for bug-guix@HIDDEN; Mon, 02 Aug 2021 11:01:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id 92AC1E49B0
 for <bug-guix@HIDDEN>; Mon,  2 Aug 2021 17:01:16 +0200 (CEST)
X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr
Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1])
 by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 4bAwGByioGFe for <bug-guix@HIDDEN>;
 Mon,  2 Aug 2021 17:01:16 +0200 (CEST)
Received: from localhost (unknown [78.194.167.103])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (Client did not present a certificate)
 by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 7FBC0E49AF
 for <bug-guix@HIDDEN>; Mon,  2 Aug 2021 17:01:16 +0200 (CEST)
Date: Mon, 2 Aug 2021 17:01:15 +0200
From: Alice BRENON <alice.brenon@HIDDEN>
To: bug-guix@HIDDEN
Subject: Error message for missing synopsis in opam importer
Message-ID: <20210802170115.696ac103@HIDDEN>
Organization: ENS de Lyon
X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.24; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=140.77.167.81;
 envelope-from=alice.brenon@HIDDEN; helo=lxc-smtp2.ens-lyon.fr
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 02 Aug 2021 11:44:48 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

Hello,

I triggered a confusing behaviour from the opam importer trying to
import package iter 1.2.1 today on a Guix System install.

The package iter is missing a "synopsis" field as can be seen on
https://opam.ocaml.org/packages/iter/ , which when I tried

guix import opam iter

yielded the following backtrace:

Backtrace:
           8 (primitive-load "/home/alice/.config/guix/current/bin/g=E2=80=
=A6")
In guix/ui.scm:
   2185:7  7 (run-guix . _)
  2148:10  6 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  5 (guix-import . _)
In guix/scripts/import/opam.scm:
   104:23  4 (guix-import-opam . _)
In guix/utils.scm:
    752:8  3 (call-with-temporary-output-file _)
In guix/import/opam.scm:
   337:34  2 (_ _ _)
In srfi/srfi-1.scm:
   460:18  1 (fold #<procedure 7f3baca56fe0 at guix/import/opam.scm=E2=80=
=A6> =E2=80=A6)
In guix/import/opam.scm:
   193:15  0 (_ _ _)

guix/import/opam.scm:193:15: Throw to key `match-error' with args
`("match" "no matching pattern" string-pat)'.


the final error is raised l.193 of guix/import/opam.scm because
metadata-ref supports various types for a metadata field, but not the
lack of it. As discussed with Maxime Devos on the IRC channel, it would
be helpful to either allow the import of a package with a missing field
(possibly filling it in the output scheme code for the imported package
with some bad value requiring the user to fill it and causing any build
to crash until replaced properly) or at least to handle that missing
field with a more explicit error message than the above backtrace
(something like "Can't import that package because it's missing such or
such field").

Thanks,

Alice BRENON




Acknowledgement sent to Alice BRENON <alice.brenon@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#49827; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 19 Aug 2021 15:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.