From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id e5jGDTSWW2AEwwAAgWs5BA (envelope-from ) for ; Wed, 24 Mar 2021 20:42:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KEZcCDSWW2AILwAAbx9fmQ (envelope-from ) for ; Wed, 24 Mar 2021 19:42:44 +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 C651911638 for ; Wed, 24 Mar 2021 20:42:43 +0100 (CET) Received: from localhost ([::1]:57910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP9Os-0007BZ-Ly for larch@yhetil.org; Wed, 24 Mar 2021 15:42:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP9Nk-0006AF-1d for guix-devel@gnu.org; Wed, 24 Mar 2021 15:41:32 -0400 Received: from mx1.riseup.net ([198.252.153.129]:47124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP9Nh-0000mU-J0 for guix-devel@gnu.org; Wed, 24 Mar 2021 15:41:31 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (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 4F5JWr13blzDxb9; Wed, 24 Mar 2021 12:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1616614888; bh=L9ECkY1pR7u5zudF1HgxI56j1dm/xDGUylthKuOcp9M=; h=From:To:Subject:References:Date:In-Reply-To:From; b=MDm1thnqFM+2sl65Ae4iMi3hrVHXT9Abe9B5mVYa/PE0LY+UWk3sGt7/J5VQQbhNU Z7tS3pRTApfmSxyxCNUeV8B+mCiZyOsmlfXLqZxKGfiDA0d5IIYnKA6+7yIE1a+NRB mkWxiukONWrNO+HvtSc73YvPUBoCUhByj/WP/qKc= X-Riseup-User-ID: 1FF59C10541AC26839935D7BCFC5EDCD1385E5DB66DE294AC8C05F296A330CF7 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 fews2.riseup.net (Postfix) with ESMTPSA id 4F5JWq1JxZz1yBY; Wed, 24 Mar 2021 12:41:26 -0700 (PDT) From: c4t0 To: Guix Devel , zimoun Subject: Re: guix import hackage fails with errors, and failed tests References: <87mtut7a6a.fsf@riseup.net> Date: Wed, 24 Mar 2021 16:41:24 -0300 In-Reply-To: (zimoun's message of "Wed, 24 Mar 2021 17:58:19 +0100") Message-ID: <874kh07317.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain 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=1616614964; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NsN2TzWoWac65AxMLBzoS/yEoVt13g0Xeg9aPjVHl88=; b=sQ6838TjKkPswX4cIDEnA+UV+pU9AwulXWgKWIOSeoiuU0LdoOwnyYOMbcTjxWcNvMA+aV 846UYBpbbBHX/2Q4TrRhQ7lL2JgUDYFbTelxwh3wRmjClyELG7wkedrro/8SMK/siaXLKV AY1WnSQAWs4GqudcU1fIN29H7DLFrtmpjlGLHwWcnkjqr6GShXvmid0ri8Hi+8vCnatQ2w b5JDWbgH5pF8P9NnJdWvaWIZRupVhpJTMXj52jFCyP/YDamXMIypcHEMkASBUb8alM/OTY OUBPSpcLw8KaH5MrxpbX1xAHWefKCvMNnSPFmBXfs4eBmpIcResG8YcjJEBGqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616614964; a=rsa-sha256; cv=none; b=LGULe13QdN+XCeW2cw6znHqaEAWLsEMHTKtcDYlkLA9zcBayc6aGHmzc6iSPUL+qEk2LKj OgSde4p83H+euQR1PJw3z2xWpVVDzTjxjbrXZtvdi4Y+SKH1CKH1W95tdOmecGKXMP5R27 rRptRfSwsnoT2DEcFaeqCdhlDR40Jju1XkKnIJsnppjZJW4Vu0u/9Cq+ttBBHlI5XUwi9P FdycIcPPjhCSc9+t6aHSdHa3CBvkI7RrTdS6IyeRFMU2k4KQjMJdkGyI2ZRtExrr8R205D RlZUvy+ZLA9PP4yvj3nfzCMn5n6oCM2BvSk31hu4zzn3PHVSIzpt6TtU0Prc2A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=MDm1thnq; 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=MDm1thnq; 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: C651911638 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: w3M5O4etqvBt zimoun writes: > Hi, > > On Wed, 24 Mar 2021 at 04:19, c4t0 wrote: > >> I'm having problems with 'guix import' in my environment: >> $guix import hackage -t ghc-events >> Syntax error: unexpected token : common (at line 44, column 0) >> Syntax error: unexpected end of input >> guix import: error: failed to download cabal file for package 'ghc-events' > > Probably because the cabal file is bad formed. Or better worded, > because the Guix cabal parser fails to parse the line 44 starting by > 'common'. > Well, give a look at (guix import cabal). > yes! I don't know if is really related with https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35743 and is a layout problem or it doesn't know how to parse 'common'. watching https://hackage.haskell.org/package/ghc-events-0.16.0/ghc-events.cabal I'm inclined to the later. looking cabal.scm::make-cabal-parser might help when I get my mind arround it. Fun fact, i'm just begining a course that ends with parsers... There is something else that we could try. running $cabal format package.cabal just removes "common default" and put all that config in the other targets, for instance: common default default-extensions: BangPatterns NamedFieldPuns PatternGuards RecordWildCards default-language: Haskell2010 executable ghc-events import: default main-is: GhcEvents.hs build-depends: ghc-events, base, containers is converted to: executable ghc-events main-is: GhcEvents.hs default-language: Haskell2010 default-extensions: BangPatterns NamedFieldPuns PatternGuards RecordWildCards build-depends: ghc-events -any, base -any, containers -any ammong other things. 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. 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? WDYT? If it's ok, I'll give it a try, for now touching the parser it's a little out of my reach. COD.