unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Vollmert <rob@vllmrt.net>
To: 36653@debbugs.gnu.org
Cc: Robert Vollmert <rob@vllmrt.net>
Subject: [bug#36653] [PATCH v2] guix import stackage: default to a LTS release compatible with GHC 8.4
Date: Tue, 16 Jul 2019 15:41:23 +0200	[thread overview]
Message-ID: <20190716134122.21947-1-rob@vllmrt.net> (raw)
In-Reply-To: <20190714193843.23405-1-rob@vllmrt.net>

In particular, this means that guix lint won't warn to update to
versions that won't necessarily fit our package set well.

Also some minor clean-up tweaks.

* guix/import/stackage.scm (%stackage-url): Change to https, avoiding
redirect log messages.
(%default-lts-version): New field.
(stackage-lts-info-fetch, stackage->guix-package, latest-lts-release): Use it.
(lts-info-ghc-version): Remove unused function.
(lts-info-packages, latest-lts-release): Fix documentation typos.
---

This fixes the patch to *also* apply to normal use of `guix import stackage`,
as originally intended.

 guix/import/stackage.scm | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 1c1e73a723..f845da4b27 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -39,15 +39,13 @@
 ;;; Stackage info fetcher and access functions
 ;;;
 
-(define %stackage-url "http://www.stackage.org")
+(define %stackage-url "https://www.stackage.org")
 
-(define (lts-info-ghc-version lts-info)
-  "Retruns the version of the GHC compiler contained in LTS-INFO."
-  (and=> (assoc-ref lts-info "snapshot")
-         (cut assoc-ref <> "ghc")))
+;;; Latest LTS version compatible with bundled ghc version.
+(define %default-lts-version "12.26")
 
 (define (lts-info-packages lts-info)
-  "Retruns the alist of packages contained in LTS-INFO."
+  "Returns the alist of packages contained in LTS-INFO."
   (or (assoc-ref lts-info "packages") '()))
 
 (define (leave-with-message fmt . args)
@@ -57,9 +55,11 @@
   ;; "Retrieve the information about the LTS Stackage release VERSION."
   (memoize
    (lambda* (#:optional (version ""))
-     (let* ((url (if (string=? "" version)
-                     (string-append %stackage-url "/lts")
-                     (string-append %stackage-url "/lts-" version)))
+     (let* ((url (string-append %stackage-url
+                                "/lts-"
+                                (if (string=? "" version)
+                                    %default-lts-version
+                                    version)))
             (lts-info (json-fetch-alist url)))
        (if lts-info
            (reverse lts-info)
@@ -90,7 +90,7 @@
    (lambda* (package-name ; upstream name
              #:key
              (include-test-dependencies? #t)
-             (lts-version "")
+             (lts-version %default-lts-version)
              (packages-info
               (lts-info-packages
                (stackage-lts-info-fetch lts-version))))
@@ -119,10 +119,12 @@ included in the Stackage LTS release."
 ;;;
 
 (define latest-lts-release
-  (let ((pkgs-info (mlambda () (lts-info-packages (stackage-lts-info-fetch)))))
+  (let ((pkgs-info
+        (mlambda () (lts-info-packages
+                     (stackage-lts-info-fetch %default-lts-version)))))
     (lambda* (package)
       "Return an <upstream-source> for the latest Stackage LTS release of
-PACKAGE or #f it the package is not inlucded in the Stackage LTS release."
+PACKAGE or #f it the package is not included in the Stackage LTS release."
       (let* ((hackage-name (guix-package->hackage-name package))
              (version (lts-package-version (pkgs-info) hackage-name))
              (name-version (hackage-name-version hackage-name version)))
-- 
2.20.1 (Apple Git-117)

  reply	other threads:[~2019-07-16 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-14 19:38 [bug#36653] [PATCH] guix import stackage: default to a LTS release compatible with GHC 8.4 Robert Vollmert
2019-07-16 13:41 ` Robert Vollmert [this message]
2019-08-17 13:52   ` [bug#36653] [PATCH v2] " Ludovic Courtès
2020-11-03 20:55     ` bug#36653: " Timothy Sample

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20190716134122.21947-1-rob@vllmrt.net \
    --to=rob@vllmrt.net \
    --cc=36653@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).