[PATCH] guix import stackage: default to a LTS release compatible with GHC 8.4

  • Done
  • quality assurance status badge
Details
4 participants
  • John Soo
  • Ludovic Courtès
  • Robert Vollmert
  • Timothy Sample
Owner
unassigned
Submitted by
Robert Vollmert
Severity
normal
R
R
Robert Vollmert wrote on 14 Jul 2019 21:38
(address . guix-patches@gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
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->guix-package, latest-lts-release): Use it.
(lts-info-ghc-version): Remove unused function.
(lts-info-packages, latest-lts-release): Fix documentation typos.
---
guix/import/stackage.scm | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

Toggle diff (50 lines)
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 1c1e73a723..de12ae4cb9 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)
@@ -90,7 +88,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 +117,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)
R
R
Robert Vollmert wrote on 16 Jul 2019 15:41
[PATCH v2] guix import stackage: default to a LTS release compatible with GHC 8.4
(address . 36653@debbugs.gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
20190716134122.21947-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(-)

Toggle diff (65 lines)
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)
L
L
Ludovic Courtès wrote on 17 Aug 2019 15:52
(name . Robert Vollmert)(address . rob@vllmrt.net)(address . 36653@debbugs.gnu.org)
87lfvrew5m.fsf@gnu.org
Hi Robert,

Too bad this patch is still in the queue! I’m not familiar with
Stackage but I trust your judgment. One minor comment:

Robert Vollmert <rob@vllmrt.net> skribis:

Toggle quote (12 lines)
> 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.

[...]

Toggle quote (3 lines)
> +;;; Latest LTS version compatible with bundled ghc version.
> +(define %default-lts-version "12.26")

What about storing this elsewhere? Perhaps in the ‘properties’ field of
the ‘ghc’ package? That should make it easier to keep these numbers in
sync.

Besides, it’s usually clearer to separate unrelated cleanups, but it’s
no big deal in this case.

Thanks,
Ludo’.
J
J
John Soo wrote on 14 Nov 2019 20:03
Re: Stackage LTS 14
(name . Marius Bakke)(address . mbakke@fastmail.com)
0F9FEE41-6A34-45A4-8A23-4FF2C86F8F58@asu.edu
Hey everyone,

When we bump to Stackage 14 can issue 36653 be closed?

- John
T
T
Timothy Sample wrote on 14 Nov 2019 21:30
(name . John Soo)(address . jsoo1@asu.edu)
87h836p5eh.fsf@ngyro.com
Hi John,

John Soo <jsoo1@asu.edu> writes:

Toggle quote (2 lines)
> When we bump to Stackage 14 can issue 36653 be closed?

I think these changes should still be merged (with review and fixes).
Eventually Stackage LTS 15 will come out while we’re still on LTS 14.
At that point, we will have the same issue with the importer and linter
giving us information about LTS 15 when we only want LTS 14.


-- Tim
J
J
John Soo wrote on 14 Nov 2019 22:09
(name . Timothy Sample)(address . samplet@ngyro.com)
EFC98A33-CE5D-4F3B-AC9B-BC5BC0041C98@asu.edu
Ah, ok makes sense!
T
T
Timothy Sample wrote on 3 Nov 2020 21:55
Re: [bug#36653] [PATCH v2] guix import stackage: default to a LTS release compatible with GHC 8.4
(name . Ludovic Courtès)(address . ludo@gnu.org)
87tuu6not7.fsf@ngyro.com
Hello,

Over a year later, and I finally went ahead and pushed this! See commit
f0bb2662bb05625042094e124521197c5f43505e.

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (9 lines)
> Robert Vollmert <rob@vllmrt.net> skribis:
>
>> +;;; Latest LTS version compatible with bundled ghc version.
>> +(define %default-lts-version "12.26")
>
> What about storing this elsewhere? Perhaps in the ‘properties’ field of
> the ‘ghc’ package? That should make it easier to keep these numbers in
> sync.

That’s true, but we already have this problem with the Hackage importer.
It has a version-specific list of packages included with GHC. It’s true
that two wrongs don’t make a right, but having this patch in place –
even with shortcomings – will prevent real problems. Besides, we can
always fix it later.

Toggle quote (3 lines)
> Besides, it’s usually clearer to separate unrelated cleanups, but it’s
> no big deal in this case.

Agreed. (The typos were fixed in the interim, but I let the “https”
change hitch a ride along with the LTS version stuff.)

Anyway, this will pave the way for a lint check and then we can finally
put an end to the Haskell package roll-backs. :)


-- Tim
Closed
?