From patchwork Mon Sep 27 09:56:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 33349 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 65C0B27BBE3; Mon, 27 Sep 2021 10:59:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D693C27BBE1 for ; Mon, 27 Sep 2021 10:59:35 +0100 (BST) Received: from localhost ([::1]:38126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUnQ6-0005jb-Ub for patchwork@mira.cbaines.net; Mon, 27 Sep 2021 05:59:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUnNe-0000zO-Rv for guix-patches@gnu.org; Mon, 27 Sep 2021 05:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUnNe-0007dV-Ga for guix-patches@gnu.org; Mon, 27 Sep 2021 05:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUnNe-0000s6-Dl for guix-patches@gnu.org; Mon, 27 Sep 2021 05:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50618] [PATCH v2] import: stackage: =?utf-8?b?RG9u4oCZdA==?= try to update packages not available on Stackage. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Sep 2021 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50618 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lars-Dominik Braun Cc: 50618@debbugs.gnu.org Received: via spool by 50618-submit@debbugs.gnu.org id=B50618.16327365813301 (code B ref 50618); Mon, 27 Sep 2021 09:57:02 +0000 Received: (at 50618) by debbugs.gnu.org; 27 Sep 2021 09:56:21 +0000 Received: from localhost ([127.0.0.1]:39676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUnMw-0000r8-81 for submit@debbugs.gnu.org; Mon, 27 Sep 2021 05:56:21 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:45880 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUnMt-0000qr-Is for 50618@debbugs.gnu.org; Mon, 27 Sep 2021 05:56:16 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632736563; bh=iz8zzMvei+yr4oVmWO6pvM5Ir9PHqGGHOk3tb6aUzIU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=rGDBzqMNC97o2qsO9SFFqvnJ6KZeTsZOujaOVPTQKFIWz/Y+6OVvwtxpLP+WIeT6G bzucWto2TVejW2M3wj4ooElY4msKdCk3aBxSwvzTKAnTZw1OPqReN/RJS7i0l4mYyp ysT80Dd3vuuIhJcM6Fg72GAojBmD1Rupex47PvxY= In-Reply-To: References: <33ce44c6b5dc4f0c2ea2cf7a8402807d91e849a6.1631791821.git.public@yoctocell.xyz> <0aa369b60b785e933cab9de136cf9745dc4ea50a.1632324617.git.public@yoctocell.xyz> Date: Mon, 27 Sep 2021 11:56:02 +0200 Message-ID: <874ka67365.fsf@yoctocell.xyz> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches On Mon, Sep 27 2021, Lars-Dominik Braun wrote: > Hi, > > for some reason I cannot get this patch to apply. `git am` fails and also > `patch -Np1` spits out an error: > > patching file guix/import/stackage.scm > patch: **** malformed patch at line 47: @@ -141,11 +145,23 @@ Hmm, it seems to fail for me as well, but with a different error. I have attached the patch below. > Can you push it somewhere? Sure, but I think its easier for you to just apply the attached patch. From 49f705217487aacfd6ab0b794b07eea9262d7661 Mon Sep 17 00:00:00 2001 Message-Id: <49f705217487aacfd6ab0b794b07eea9262d7661.1632736427.git.public@yoctocell.xyz> From: Xinglu Chen Date: Thu, 16 Sep 2021 13:29:42 +0200 Subject: [PATCH] =?UTF-8?q?import:=20stackage:=20Don=E2=80=99t=20try=20to?= =?UTF-8?q?=20update=20packages=20not=20available=20on=20Stackage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the ‘hackage-package?’ predicate was used which meant that the updater would try to update non-Stackage packages, and lead to messages like these: $ guix refresh -t stackage warning: failed to parse https://hackage.haskell.org/package/hurl/hurl.cabal warning: failed to parse https://hackage.haskell.org/package/idris/idris.cabal Since ‘hurl’ and ‘idris’ aren’t available on the current Stackage LTS release, they should be filtered out before the Stackage updater even tries to update them. * stackage.scm (stackage-package?): New procedure. (%stackage-updater): Use it. --- guix/import/stackage.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index bbd903a2cd..731e69651e 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017 Federico Beffa ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Xinglu Chem ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,10 +22,12 @@ (define-module (guix import stackage) #:use-module (ice-9 match) #:use-module (ice-9 regex) + #:use-module (ice-9 control) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-43) #:use-module (guix import json) #:use-module (guix import hackage) #:use-module (guix import utils) @@ -141,11 +144,23 @@ (define latest-lts-release (version version) (urls (list url)))))))))) +(define (stackage-package? package) + "Whether PACKAGE is available on the default Stackage LTS release." + (and (hackage-package? package) + (let ((packages (lts-info-packages + (stackage-lts-info-fetch %default-lts-version))) + (hackage-name (guix-package->hackage-name package))) + (vector-any identity + (vector-map + (lambda (_ metadata) + (string=? (cdr (list-ref metadata 2)) hackage-name)) + packages))))) + (define %stackage-updater (upstream-updater (name 'stackage) (description "Updater for Stackage LTS packages") - (pred hackage-package?) + (pred stackage-package?) (latest latest-lts-release))) ;;; stackage.scm ends here base-commit: 8c6c33a2a5bf385e1589b405ee7f842684ed80c1 -- 2.33.0