all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: 50618@debbugs.gnu.org
Cc: Lars-Dominik Braun <lars@6xq.net>
Subject: [bug#50618] [PATCH v2] import: stackage: Don’t try to update packages not available on Stackage.
Date: Wed, 22 Sep 2021 17:31:49 +0200	[thread overview]
Message-ID: <0aa369b60b785e933cab9de136cf9745dc4ea50a.1632324617.git.public@yoctocell.xyz> (raw)
In-Reply-To: <33ce44c6b5dc4f0c2ea2cf7a8402807d91e849a6.1631791821.git.public@yoctocell.xyz>

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.
---
Changes since v1:

* Use ‘stackage-lts-info-fetch’ to improve performance.

 guix/import/stackage.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index bbd903a2cd..9b757f1986 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Xinglu Chem <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,10 +22,13 @@
 (define-module (guix import stackage)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #: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 +145,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: 33bc3fb2a5f30a6e21f1b8d6d43867d921bd951c
-- 
2.33.0







  parent reply	other threads:[~2021-09-22 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 11:31 [bug#50618] [PATCH] import: stackage: Don’t try to update packages not available on Stackage Xinglu Chen
2021-09-22  6:07 ` Lars-Dominik Braun
2021-09-22 12:37   ` Xinglu Chen
2021-09-22 15:31 ` Xinglu Chen [this message]
2021-09-27  9:18   ` [bug#50618] [PATCH v2] " Lars-Dominik Braun
2021-09-27  9:56     ` Xinglu Chen
2021-09-27 11:59       ` bug#50618: " Lars-Dominik Braun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0aa369b60b785e933cab9de136cf9745dc4ea50a.1632324617.git.public@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=50618@debbugs.gnu.org \
    --cc=lars@6xq.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.