From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CAu0H3N51WNu2QAAbAwnHQ (envelope-from ) for ; Sat, 28 Jan 2023 20:37:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6Am8H3N51WPc1AAA9RJhRA (envelope-from ) for ; Sat, 28 Jan 2023 20:37:23 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5A87665E1 for ; Sat, 28 Jan 2023 20:37:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLr0c-0004tD-Ue; Sat, 28 Jan 2023 14:37:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLr0a-0004sy-S8 for bug-guix@gnu.org; Sat, 28 Jan 2023 14:37:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLr0Y-0003Nw-US for bug-guix@gnu.org; Sat, 28 Jan 2023 14:37:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLr0Y-0005KZ-HA for bug-guix@gnu.org; Sat, 28 Jan 2023 14:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#61033: opam importer can't handle list field Resent-From: Csepp Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 28 Jan 2023 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61033 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Julien Lepiller Cc: 61033@debbugs.gnu.org, Csepp Received: via spool by 61033-submit@debbugs.gnu.org id=B61033.167493457820433 (code B ref 61033); Sat, 28 Jan 2023 19:37:02 +0000 Received: (at 61033) by debbugs.gnu.org; 28 Jan 2023 19:36:18 +0000 Received: from localhost ([127.0.0.1]:41611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLqzp-0005JV-OA for submit@debbugs.gnu.org; Sat, 28 Jan 2023 14:36:18 -0500 Received: from mx1.riseup.net ([198.252.153.129]:42030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLqzo-0005JG-3S for 61033@debbugs.gnu.org; Sat, 28 Jan 2023 14:36:17 -0500 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4P44SB35SbzDqqn; Sat, 28 Jan 2023 19:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1674934570; bh=x3Lq99qr6fb+X99G4TdWgMkzTHRXIqo3+10PyofIPQM=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=ewxvtB8yucE6G13VC/fOugcfyUrl0LwwH5LDqlL5e30y5PpFCfJndGNPT6mcBmQn0 FvshVZ4ipbQ+eUDSVwIu+NUX2lBOooVan5Ogpn8uMzoKrYSbq/Swt4uL2NGJAEYR9b wNqctihPeAmiumFChweBZv2vd5AZzFos5AN4QXPY= X-Riseup-User-ID: 5B8AE6011F9B7AECDE65AE23813ECC957374253D474A84E73EE0F6EC7A893B96 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4P44S955rQz1y9N; Sat, 28 Jan 2023 19:36:09 +0000 (UTC) References: <86h6wg652t.fsf@riseup.net> <20230128131811.23b5806c@sybil.lepiller.eu> From: Csepp Date: Sat, 28 Jan 2023 20:30:06 +0100 In-reply-to: <20230128131811.23b5806c@sybil.lepiller.eu> Message-ID: <871qnebgex.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674934643; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=LW4pcTzpdYqP5vu6L69LvRvOtbUVZa3nAInHD+iPZzg=; b=O8N4TXAFNx0OLWTEulx1OhDWKHJLbKgy6hQkCROh7rRoQl57S/3h4cH1zbRjzTcGZ0i7vS echeK81ouOgqY8T2Lp+M5VFOdk1NdIUuwkg9S+YnLHVGjrXg+Wp1CukhrcTRmM3PyNSliW 8439xPfWhi2IDFyCe/104ZQgWl8i66aI1pw9CVVu5wOdq6/MANeoDfjkL3OY2ZXOvcrjX/ 0yGgg41GnlQlvn+i/m7bHBHG5YUeCcLmky1haXGI8qUV6d3NvrvPa8esRHk/EtUvDt39Ou 7IithNZJZWHI4tlkAI2EPYNxFlx/m1J8C/IjMrk/PDZre2b5rnoSYUJqMjXkZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=ewxvtB8y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674934643; a=rsa-sha256; cv=none; b=YJla2RB81q8o/g+BdGxfDCXMNQgrbWdweRuIqZjP+HBHkus6h9ScKhtwl8iMq2VsgJoYo1 xOa67iM1d6Jv0WBh/axe7Etg0aaLasS4sVWjTdqsKpjgMqG0M534NyqwqvTMN7TrXKykiB O8qPNXtNAiu7sCkQnRUGHMIbFIpeWk1KfJN/fsckzHgoJJB3H4O21IYmxwSsmgYpmxInWM 892FOVvEuCVGizW2IcNbo5HmOWlAsv8Ni9QLa0w24XHC6NLACRiKcpkjGVx0XCcPTEH6dS VzBOOamms/oEYWYMqs9mgn+wY+HNKwK+Vm2eAe7y8aB44ko7qdVdoV7TAggMCQ== X-Spam-Score: 7.33 X-Migadu-Spam-Score: 7.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=ewxvtB8y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5A87665E1 X-Migadu-Scanner: scn1.migadu.com X-TUID: c2LPYFCcZUP7 Julien Lepiller writes: > Le Tue, 24 Jan 2023 03:23:44 +0100, > Csepp a =C3=A9crit : > >> Truncated stack trace: >>=20 >> ``` >> ... >> In guix/import/opam.scm: >> 287:2 3 (opam->guix-package "mirage-crypto-pk" #:repo _ # _) >> In unknown file: >> 2 (filter # >> =E2=80=A6) In guix/import/opam.scm: >> 290:13 1 (_ ("mirage-no-solo5" "mirage-no-xen")) >> In unknown file: >> 0 (string-prefix? "conf-" ("mirage-no-solo5" "mirage-n=E2=80= =A6") >> =E2=80=A6) >>=20 >> ERROR: In procedure string-prefix?: >> In procedure string-prefix?: Wrong type argument in position 2 >> (expecting string): ("mirage-no-solo5" "mirage-no-xen") ``` >>=20 >>=20 >>=20 > > The issue is related to lines like this in the list of dependencies: > > (("mirage-no-solo5" & "mirage-no-xen") | "zarith-freestanding" | > "mirage-runtime" {>=3D "4.0"}) > > This reads as a choice between three dependencies: > - mirage-no-solo5 with mirage-no-xen > - zarith-freestanding > - mirage-runtime > > The importer infrastructure is not intelligent enough to really be able > to solve constraints in imported packages, so I don't see an easy > solution. It could silently use the first option, or put a comment > instead. > > Ideas? I think in unhandled cases it should emit something usable instead of erroring, like how it can already emit missing-source or whatever symbol it uses. If Guile had good error types like, like Result in OCaml or Rust, it could signal this with the Error variant and then the sexp it failed on as a parameter. Alternatively we could do what Nix does and have importers implemented externally, so we could just hook into OPAM and let it run its solver and then emit Guix package definitions. It already has a distro integration system anyways. So far these errors have been rare enough that handling them on a case by case basis is acceptable, however I also ran into issues where the wrong version of a package was imported and I spent hours trying to debug the build until I realized I imported a version that's too new. Having an opam2guix tool would solve that.