Subject: Re: bug#50871: Stackage importer change breaks tests/lint, build

From: Xinglu Chen <[email-masked]>
Date: Tue, 28 Sep 2021 20:39:35 +0200

On Tue, Sep 28 2021, Tobias Geerinckx-Rice via Bug reports for GNU Guix wrote:

> Guix,
>
> Guix doesn't currently build because of a ‘lint’ test failure (log 
> attached).  Reverting commit 
> 9c5e5ca1c0de56a0d5b2b924de10548172095b58 makes it pass.

Thanks for catching this!  The attached patch should fix this.

From 45b002a1a39adaf76ca0ab6ca2c1dd95eb26da30 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Xinglu Chen <[email-masked]>
Date: Tue, 28 Sep 2021 20:34:25 +0200
Subject: [PATCH] =?UTF-8?q?test:=20lint:=20Fix=20=E2=80=98haskell-stackage?=
 =?UTF-8?q?=E2=80=99=20test.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is a follow-up to commit 9c5e5ca1c0de56a0d5b2b924de10548172095b58.

The previous package was called “ghc-x” which is not available on Stackage,
instead change it to “ghc-pandoc” which does exist, and adjust its version.

* tests/lint.scm ("haskell-stackage"): Add additional metadata for the
  package; change package name to “ghc-pandoc”; and change to version to
  “100.0”.

Reported-by: Tobias Geerinckx-Rice <[email-masked]>
---
 tests/lint.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/lint.scm b/tests/lint.scm
index 0f51b9ef79..e96265a55a 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1317,29 +1317,30 @@ (define (package-with-phase-changes changes)
 
 (test-assert "haskell-stackage"
   (let* ((stackage (string-append "{ \"packages\": [{"
-                                  "    \"name\":\"x\","
+                                  "    \"name\":\"pandoc\","
+                                  "    \"synopsis\":\"synopsis\","
                                   "    \"version\":\"1.0\" }]}"))
          (packages (map (lambda (version)
                           (dummy-package
-                           (string-append "ghc-x")
+                           "ghc-pandoc"
                            (version version)
                            (source
                             (dummy-origin
                              (method url-fetch)
                              (uri (string-append
                                    "https://hackage.haskell.org/package/"
-                                   "x-" version "/x-" version ".tar.gz"))))))
-                        '("0.9" "1.0" "2.0")))
+                                   "pandoc-" version "/pandoc-" version ".tar.gz"))))))
+                        '("0.9" "1.0" "100.0")))
          (warnings (pk (with-http-server `((200 ,stackage) ; memoized
-                                           (200 "name: x\nversion: 1.0\n")
-                                           (200 "name: x\nversion: 1.0\n")
-                                           (200 "name: x\nversion: 1.0\n"))
+                                           (200 "name: pandoc\nversion: 1.0\n")
+                                           (200 "name: pandoc\nversion: 1.0\n")
+                                           (200 "name: pandoc\nversion: 1.0\n"))
                          (parameterize ((%hackage-url (%local-url))
                                         (%stackage-url (%local-url)))
                            (append-map check-haskell-stackage packages))))))
     (match warnings
       (((? lint-warning? warning))
-       (and (string=? (package-version (lint-warning-package warning)) "2.0")
+       (and (string=? (package-version (lint-warning-package warning)) "100.0")
             (string-contains (lint-warning-message warning)
                              "ahead of Stackage LTS version"))))))

base-commit: 5edfa6d15e5bb92609ecff7e37e3985eced1dd4d
-- 
2.33.0