From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qFuTO0HjXGCQdQAAgWs5BA (envelope-from ) for ; Thu, 25 Mar 2021 20:23:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KI4wN0HjXGCHJQAAbx9fmQ (envelope-from ) for ; Thu, 25 Mar 2021 19:23:45 +0000 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 58F7716871 for ; Thu, 25 Mar 2021 20:23:45 +0100 (CET) Received: from localhost ([::1]:48852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPVa4-0001Dp-Gk for larch@yhetil.org; Thu, 25 Mar 2021 15:23:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPVZn-0001De-Ka for guix-devel@gnu.org; Thu, 25 Mar 2021 15:23:27 -0400 Received: from mx1.riseup.net ([198.252.153.129]:60834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPVZk-0006Nb-4K for guix-devel@gnu.org; Thu, 25 Mar 2021 15:23:27 -0400 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4F5w4T1C3gzDq9x; Thu, 25 Mar 2021 12:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1616700201; bh=SyhQh60jY3Hgx6hNg50114OnOVpX9XBMknOG96G7hZ4=; h=From:To:Subject:References:Date:In-Reply-To:From; b=ktQczqsd/mPglNSRkun/OD4dPBRADKziOKHdlbZMI3i2iyDEy7ZJgR2dpXtgU/cly EvYa1JRM39Hv1evqDLaA4MVOvCXi9KlBSwx+w+UJbMOu/0URozajNv4ucL3c56XolB ScHcOon51ju+s4OPE+UfEt8SB/UFL2jc5ZK4Pe+M= X-Riseup-User-ID: CC57E256E670DD68DEB262E90185AD6A56F1D5105A5336672740046241AB3774 Received: from hyperion (unknown [181.46.252.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by fews1.riseup.net (Postfix) with ESMTPSA id 4F5w4S20lKz5wGG; Thu, 25 Mar 2021 12:23:20 -0700 (PDT) From: c4t0 To: Guix Devel , zimoun Subject: Re: guix import hackage fails with errors, and failed tests References: <87mtut7a6a.fsf@riseup.net> <874kh07317.fsf@riseup.net> <86o8f8b6ih.fsf@gmail.com> Date: Thu, 25 Mar 2021 16:23:16 -0300 In-Reply-To: <86o8f8b6ih.fsf@gmail.com> (zimoun's message of "Wed, 24 Mar 2021 22:12:38 +0100") Message-ID: <87wntv597f.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=198.252.153.129; envelope-from=c4t0@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list 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+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616700225; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=79SSvLdmH2x0WVQNKqLphvhg70NfIne4OBKE6TvhmO4=; b=U6lgSNZFQEEIlDSMZby4WNHb67gw+NXRYPfzgCL1fPVoOhlD5GB8OqxQ87GyuCJ7edXN82 2VswZQho6xjRE494HHVal7EQy8kbAJXDxOIzuIyIylb5wm7442Txlp644YrE+L+V6xRsxH MRPfLrfmXMr+uiXpJExwW4lXS/CHTVmYxU2mA86k5E8MQiaPDaqdDAfglCoJN9m6phyQwa l6hn0wZ2qZY8q7zoPsqnajCJTHbCNqsvnUPYHjf6jQWq56uPiu0/GKLsck7ECcbPf/LF51 O/NohtiOOfhNHaGAgJXRqi3mPdlA32MtDwSCZ2akxEOZefqPT1rVlgCcFsBAiQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616700225; a=rsa-sha256; cv=none; b=CYIYFfV6SeQGuuPK+AVk+0xRjsni9MHRGW4wtlfNN/1U4ztlUTGocNW63rHZfu1Jfil/6w 5Kk3O/JECwY3s36pYMItuAMLgcaxWMA9/+Xn35s4ekoheR8L1RuAdyw8w8u+9i2zhwmxzB RyYPQTZ5373TgnqJilACPKaERLoCXI91WdhL5+bS79JjiKl0WNISj05O5YyeTbogG1m4wq Iltd5KrhnGQrkRk1E+cdZFHv40A3gsTXUzCWZ5HW7sCAQ72aN+etB1rA8qiWQlCctS34Lh 5Z67ZEgIEZ+dyquo7dC3ro65SQaC67EK+wOZJruiEBtE6N+rxs17vSofUSotvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=ktQczqsd; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=ktQczqsd; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 58F7716871 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: zTX5e2oG+UCL zimoun writes: > Hi, > > On Wed, 24 Mar 2021 at 16:41, c4t0 wrote: >> zimoun writes: > >> yes! I don't know if is really related with >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35743 and is a layout >> problem or it doesn't know how to parse 'common'. > > I have not read carefully the bug report you mention, neither the > parser. I guess the parser does not know how to parse =E2=80=99common=E2= =80=99. > the bug report is a problem with layout (indentation). Yes you are right, in this case is a problem with the keyword 'common'. > >> running >> $cabal format package.cabal > > You can do that that locally. Well, currently all the importers via > =E2=80=9Cguix import=E2=80=9D should be considered as helpers to =E2=80= =99import=E2=80=99, not as > bullet-proof =E2=80=99converters=E2=80=99. > > >> I think it might be a good idea to run 'cabal format package.cabal' some >> how, before parsing. That will give us a consistent format that might >> address the #35743 bug also, and remove formatting variance that a >> package mantainer may introduce to make things more legible to him. > > The =C2=ABsomehow=C2=BB cannot be using Guix. Otherwise, it means that G= uix would > depend partly on Haskell ecosystem. That=E2=80=99s why there is a Cabal = parser > written with Guile. Somehow. :-) > Oh well, I've made a patch that does something like: (system* "cabal" "format" cabal-filame) and it works. It solves the layout and the 'common' keyword problem. but yes, you'll need to add cabal-install to the environment when running tests. it bothers me that I've used 'system*' and not a foreign function, but it was the easiest to do to see if it works. it annoys me too that we have to re do work done somewhere else, it's a similar problem with editor parsers and language servers. > >> Also is easiest than propagate a set of default options to other >> targets, but I think the best argument is the former. >> >> maybe modify cabal.scm::read-cabal to make a temporary file with the >> input port, run 'cabal format tmp-file' and then change the port to use >> that temp file? > > The issue with this is that Guix would somehow depend on Haskell. And > it would not happen: GHC is not bootstrappable, is huge, etc. > I get the point of bootstrappable guix, and yes GHC is really huge, but if you're importing a haskell package, doesn't make sense to require the haskell ecosystem? you'll be having it installed anyways... I don't see a problem from the user pov, but I agree with you that is bad to require a haskell package at testing time. so... maybe a package that leverages the import system *and* the haskell ecosystem to aid the haskell package mantainers? what would be a good idea to leverage the other packaging system tools to import packages to guix with out making guix humongous? can we have a module with importers that augment the guix 'native' ones with foreign tools? in this case would be ideal to have cabal do all the parsing and make guix talk with, asking the info that it needs to generate the package def. > >> If it's ok, I'll give it a try, for now touching the parser it's a >> little out of my reach. > > Well, if your aim is to produce the Guix definition of ghc-dec, you can > try to run your trick locally. As said, =E2=80=9Cguix import=E2=80=9D ar= e importers and > not converters, which means it helps to produce a Guix package > definition from a package definition i.e., it is not a > bullet-proof converting all the cases; cases probably without a clean > grammar. > ok, I did that. > In other words, to resolve the issue you are pointing, the fix is to > improve the Guix parser of cabal, IMHO. I'll give it a try in the near future, for now I'll do more damage than good. Maybe for the time being, reporting a bug for the 'common' keyword pushing a new test in hackage.scm with a (test-expect-fail 1) and a comment to the bug report? > I hope that this does not > prevent you to contribute by adding ghc-events. :-) > it won't XD I manage to make a ghc-events.scm package with the hacky patch and installs just fine in my profile. I just have to check in runtime with a program that uses it and learn the ropes a little more to push it. I guess that I'll have to put all the libraries in haskell-xyz.scm and threadscope (the culprit of this little adventure) in haskell-apps.scm, right? > > Cheers, > simon Chau! COD.